MCP server
X data in your AI agent, one URL away.
Add https://api.cheapxapi.com/mcp to Claude Code, Cursor or any MCP client that supports remote servers, with your API key in the x-api-key header. Your agent gets 31 read-only tools for profiles, tweets, search, followers, lists, communities and trends.
$0.0006 per tool call, pay as you go. No X developer account, no cookies, nothing to install.
Connect in a minute.
- 1. Create an account and copy your API key from the dashboard.
- 2. Add the server to your client with the snippet for it, replacing YOUR_KEY.
- 3. Ask your agent something that needs X data, for example “What did @NASA post this week?”
The key in the header is the only credential. Keep config files that contain it out of shared repositories.
claude mcp add --transport http cheapxapi https://api.cheapxapi.com/mcp \
--header "x-api-key: YOUR_KEY"31 tools, all read-only.
Each tool is one API endpoint; its arguments are that endpoint’s query parameters. Paginated tools return next_cursor; the agent passes it back as cursor for the next page, and each page is one call.
Users
x_user_infoGet user profile · userName*
x_user_aboutGet user 'about' details · userName*
x_user_batch_info_by_idsGet users by IDs · userIds*
x_user_searchSearch users · query*, cursor
x_user_last_tweetsGet user's latest tweets · userId, userName, cursor, includeReplies
x_user_tweet_timelineGet user's tweet timeline · userId, includeReplies, includeParentTweet, cursor
x_user_mentionsGet user mentions · userName*, sinceTime, untilTime, cursor
x_user_articlesGet user's articles · username*, cursor
Followers
x_user_followersGet followers · userName*, cursor, pageSize
x_user_followingsGet followings · userName*, cursor, pageSize
x_user_followers_idsGet follower IDs · userName, userId, cursor
x_user_verified_followersGet verified followers · user_id*, cursor
x_user_check_follow_relationshipCheck follow relationship · source_user_name*, target_user_name*
Tweets
x_tweetsGet tweet by ID · tweet_ids*
x_tweet_advanced_searchAdvanced search · query*, queryType*, cursor
x_tweet_repliesGet tweet replies · tweetId*, sinceTime, untilTime, cursor
x_tweet_replies_v2Get tweet replies (sortable) · tweetId*, cursor, queryType
x_tweet_thread_contextGet thread context · tweetId*, cursor
x_tweet_quotesGet quote tweets · tweetId*, sinceTime, untilTime, includeReplies, cursor
x_tweet_retweetersGet retweeters · tweetId*, cursor
x_articleGet article · tweet_id*
Lists
x_list_tweetsGet list tweets · listId*, sinceTime, untilTime, includeReplies, cursor
x_list_tweets_timelineGet list timeline · listId*, cursor
x_list_membersGet list members · list_id*, cursor
x_list_followersGet list followers · list_id*, cursor
Communities
x_community_infoGet community · community_id*
x_community_membersGet community members · community_id*, cursor
x_community_moderatorsGet community moderators · community_id*, cursor
x_community_tweetsGet community tweets · community_id*, cursor
x_community_search_tweetsSearch tweets across communities · query*, queryType*, cursor
Trends
x_trendsGet trends · woeid*, count
* required argument. Full parameter and field reference on each linked docs page.
What a tool call returns.
The server speaks MCP over Streamable HTTP: JSON-RPC in a POST, plain JSON back, no session to keep. A tool result carries the endpoint’s JSON response as text, exactly as the REST API returns it.
When the API answers with an error status, the result has isError set and the text HTTP <status>: <body>, so the agent can read why. A call without a key returns “Missing API key” and is not charged.
curl -X POST https://api.cheapxapi.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Response to “Call a tool”, captured live
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"content": [
{
"type": "text",
"text": "{\"status\":\"success\",\"message\":\"check follow relationship success\",\"data\":{\"following\":false,\"followed_by\":true}}"
}
],
"isError": false
}
}The text, parsed
{
"status": "success",
"message": "check follow relationship success",
"data": {
"following": false,
"followed_by": true
}
}What an agent’s work costs.
You pay per tool call, not per item returned. A search page holds up to 20 tweets and a followers page up to 100 profiles, so jobs that read many items cost far less than on the official X API, which bills each item.
Rate limit: 2 calls a second until your first top-up, 10 after. See pricing and how other providers compare.
| Job | Tool calls | cheapxapi | Official X API |
|---|---|---|---|
| Look up 100 profiles | 100 | $0.06 | $1.00$0.01 per user |
| Read 1,000 tweets from a search | 50 | $0.03 | $5.00$0.005 per post |
| List 10,000 followers with profiles | 100 | $0.06 | $100.00$0.01 per follower |
Official prices: X API pay-per-usage list prices from X’s developer documentation. Tweet counts assume full pages of 20.
Building it yourself instead?
- API documentation: every endpoint behind the tools, plus the account actions (posting, liking, following) that MCP does not expose.
- OpenAPI spec for generating your own client or tool definitions.
- llms-full.txt: the whole reference in one text file for an agent’s context.
Questions.
Is there an MCP server for Twitter (X)?
Yes. cheapxapi hosts one at https://api.cheapxapi.com/mcp. It gives AI agents 31 read-only tools for X data: profiles, tweets, advanced search, replies, followers, lists, communities and trends. You add the URL and your API key to your MCP client; nothing to install or run.
What does it cost?
$0.0006 per tool call, billed to your API key from a prepaid balance, the same as a direct API request. Listing the tools and connecting are free. Calls that fail on our side (rate limited, insufficient balance, invalid key, service errors) are not charged.
Can the agent post tweets or send DMs through it?
No. The MCP server exposes read-only tools only. Posting, liking, following and messaging exist as account-action endpoints in the REST API, not as MCP tools.
Do I need an X developer account or X cookies?
No. Your cheapxapi API key is the only credential. The tools read public X data; no X account, developer app or cookies are involved.
Which clients work?
Any MCP client that connects to remote servers over Streamable HTTP and lets you set a request header, such as Claude Code and Cursor. The server answers with plain JSON (no event stream) and keeps no session, so it also works behind proxies that do not hold connections open.
Is there a local version I can run with npx?
Not yet. The server is hosted only, so clients that run local (stdio) servers only cannot connect to it directly.