# Give your AI agent a Twitter reader: MCP and tool definitions for Claude, ChatGPT and Codex

By Steven Van · 2026-10-07

Claude, ChatGPT and Codex can read public X data over MCP at 1 credit ($0.001) per returned record, and the old free script endpoints now return HTTP 402.

Claude, ChatGPT and Codex can now read public X profiles, posts, replies and search results through the [Unif API](<https://creatorstoolbox.com/resources/unif-api>) MCP server, which [UnifAPI describes in a guide for X access](<https://unifapi.com/blog/read-twitter-from-claude-chatgpt-agents>). For agent loops you run yourself, the guide also supplies copy-paste tool definitions for Anthropic tool use and OpenAI function calling, plus a SKILL.md for Claude Code and Codex.

## Connecting the MCP server

Add https://mcp.unifapi.com in the client and sign in with OAuth, so there is no key to paste. The agent gets three tools: list\_operations to search the catalog, get\_operation to read one operation's parameters, and call\_api to run it. Setup per client:

- **Claude:** Settings, Connectors, Add custom connector, then paste the URL and leave Authentication as OAuth.

- **ChatGPT:** on Plus, Pro, Team or Enterprise, turn on Developer Mode, click Create app and paste the URL as the MCP Server URL.

- **Codex:** run codex mcp add unifapi --url https://mcp.unifapi.com, then codex mcp login unifapi if sign-in does not open on its own.

- **Claude Code:** run claude mcp add --transport http unifapi https://mcp.unifapi.com.

## What the agent can read

The operations are GET calls on the paid X API: profile lookup by username, an account's timeline, a single post, recent search, replies under a post (searching on conversation\_id), trends by WOEID, Communities search, and followers and following lists. A request such as "what has @NASA posted with media lately?" becomes a call\_api call to /x/tweets/search/recent with the query from:nasa filter:media and max\_results of 20.

Every response uses one envelope with data, pagination and billing. Errors come back as { error: { type, message } } with a closed set of types, such as unauthorized, insufficient\_credits, not\_found and rate\_limited. A 429 response adds a Retry-After header.

## Pricing

Calls are pay as you go, with no subscription. Each returned record costs **1 credit ($0.001)**, with a minimum of one credit per call. A profile or single post is 1 credit, a profile with 10 posts is 11, and a 20-post search page is 20 ($0.02).

## Running your own agent loop

For a self-run loop, the guide defines a single read\_x tool with a lookup enum (profile, post, replies, search), so the model never builds a path itself. The handler calls https://api.unifapi.com with a Workspace API key from an environment variable. The guide also gives the model three rules: count credits before paging, sleep on Retry-After, and trim what goes into the context window.

## Old free endpoints

Since October 17, 2026, the old free endpoints under /tools/x/ answer scripts and agents with HTTP 402. The response body names the MCP server and the paid operation that replaces each lookup. The viewer pages, such as the X profile viewer, stay free in a browser.

![Unif API](<https://creatorstoolbox.com/images/logos/unif-api-1ca5c665f23e89e0f50aae022ed0c0b6a8d768873cd543e49e57e58aad1d1f3f.png>)

Unif API

Prebuilt AI marketing agents for SEO, GEO, influencer research, social listening, and competitor analysis — run them inside Claude, ChatGPT, or Codex over one MCP server.

[View Unif API →](<https://creatorstoolbox.com/resources/unif-api>)

Sources

[Original source](<https://unifapi.com/blog/read-twitter-from-claude-chatgpt-agents>)

[Read Give your AI agent a Twitter reader: MCP and tool definitions for Claude, ChatGPT and Codex on Creators Toolbox](<https://creatorstoolbox.com/blog/unif-api-give-your-ai-agent-a-twitter-reader-mcp-and-tool-definitions>)

---
Canonical source: https://creatorstoolbox.com/blog/unif-api-give-your-ai-agent-a-twitter-reader-mcp-and-tool-definitions
