Twitter MCP server: 3 kinds and a 1-line setup
A Twitter MCP server gives an AI agent such as Claude Code or Cursor a set of tools for X, and it reaches X through your developer app, your X login or a data API key; the official X MCP bills $0.005 per post.
Short answer: A server's connection sets its price: the official X MCP needs your X developer app and bills $5.00 per 1,000 posts. For agents that read X, use sorsa-mcp from Sorsa API, a Twitter (X) API and scraper: each tool call is one request, and POST /tweet-info-bulk returns 100 tweets per call, from $0.014 per 1,000, with 100 free requests to start.
npx -y sorsa-mcp- 40 read-only tools
- Price
- tweets from $0.014 per 1,000
#What a Twitter MCP server does
A Twitter MCP server is a small program that hands an AI agent a set of tools for X, such as "search posts" or "list followers", through the Model Context Protocol (opens in a new tab), the open standard that Claude, Cursor, Codex and VS Code use to call outside tools.
You ask in plain words. The agent picks a tool, fills in its arguments and calls it; the server turns the call into a request for X data, hands the JSON back, and the agent answers from it. You never write the request yourself, and the agent can chain several calls to finish one job, such as a search followed by a profile lookup for each author it found.
The protocol is free and open, and so is the code of most servers. What a server costs, and what it can do to your X account, comes from the connection behind it: whose credentials it holds and who bills each read. That connection splits Twitter MCP servers into three kinds, and it decides more than the tool list does.
#The three kinds of Twitter MCP server
Every Twitter MCP server reaches X through one of three connections: your own X developer app, your logged-in X account, or a data API key. The connection decides what you set up, what a read costs and what your agent can do to your account.
Only the data-key kind leaves your X account out entirely, and it reads posts for a small fraction of the official rate:
| Kind of server | What you set up | Reading 1,000 posts | Can the agent post? | Your X account |
|---|---|---|---|---|
| On a data API key (Sorsa API's sorsa-mcp) | One Sorsa API key | From $0.014 by ID, from $0.07 through search | No, read-only by design | Never connected |
| On your X developer app (the official X MCP, open-source servers on the official X API) | An X app with OAuth, its keys and prepaid credits | $5.00, at $0.005 per post | Depends on the server and your app's write access | Your app acts for you |
| On your X login (servers that sign in as you) | Your X username and password, or session cookies | Set by the vendor | Yes, as you | Logged in by a bot, so it can be flagged |
On a data API key (Sorsa API's sorsa-mcp)
- What you set up
- One Sorsa API key
- Reading 1,000 posts
- From $0.014 by ID, from $0.07 through search
- Can the agent post?
- No, read-only by design
- Your X account
- Never connected
On your X developer app (the official X MCP, open-source servers on the official X API)
- What you set up
- An X app with OAuth, its keys and prepaid credits
- Reading 1,000 posts
- $5.00, at $0.005 per post
- Can the agent post?
- Depends on the server and your app's write access
- Your X account
- Your app acts for you
On your X login (servers that sign in as you)
- What you set up
- Your X username and password, or session cookies
- Reading 1,000 posts
- Set by the vendor
- Can the agent post?
- Yes, as you
- Your X account
- Logged in by a bot, so it can be flagged
Six questions settle the choice for an agent that reads X: what you set up before the first call, what a read costs, whether the agent can post, whether your X account is involved, how fast it answers, and how much of the agent's context the tools take. The table settles the first four; the official X MCP below and the setup section after it answer the rest for each kind.
#The official X MCP: what it needs and what it bills
The official X MCP needs your own X developer app and bills every call at the official X API's pay-per-use rates. X launched the hosted server at api.x.com/mcp on June 30, 2026 (X's announcement (opens in a new tab)), and its MCP docs (opens in a new tab) list what a working setup takes:
- an X app in the Developer Console with OAuth 2.0 and the redirect URI
http://localhost:8080/callback; - the app's client ID and secret in your agent's config, read by xurl, a local bridge that runs through npx;
- a one-time sign-in in a browser, with the client's startup timeout raised to at least 300 seconds;
- the app moved to X's Pay-per-use package, or the login ends in
client-not-enrolled.
A shorter route sends an app-only Bearer token from the same app, and X marks it read-only. Either way, the developer account comes first; our guide to the Twitter API without a developer account walks through everything it involves.
The server's tools read posts with their likers, reposters and quoters, run full-archive search, and look up users, timelines, mentions, news and trends. Its writes are bookmarks and Articles; X's docs list no tool that creates a post. Every read bills at the official X API's rates (opens in a new tab): $0.005 per post and $0.010 per user, up to 3 million post reads a month before X asks for an Enterprise contract. From November 22, 2026, X also bills the authors and media that come back with posts, at $0.010 per user (X's notice (opens in a new tab)). Our X API pricing breakdown has the whole rate card.
#Set up the Sorsa MCP server in one line
For an agent that does research, monitoring, lead lists or checks on X, add Sorsa API's MCP server: one command in Claude Code or Codex, or one JSON block in Cursor and VS Code, with your key in SORSA_API_KEY, and the first 100 tool calls are free.
It answers the six questions with numbers: one API key, tweets from $0.014 per 1,000, zero write tools, no X account at risk, 20 requests per second on every plan, and 40 tool definitions in about 5,800 tokens. Posting is the one job it leaves out on purpose; to post, pair it with the official X API, which keeps writes on your own app. The server runs on your computer and turns each tool call into one request, whichever of the 40 tools it is, whether it returns one profile or 100 posts.
You need Node.js 18 or newer (check with node -v) and an app that runs local MCP servers. The Sorsa MCP server page keeps the line for every agent in one place.
-
Get a key. Sign up with your email or Google account. The dashboard shows your API key; the first 100 requests need no card and never expire.
-
Add the server to your agent. Put your key in place of
YOUR_API_KEY. Claude Code and Codex take one line in the terminal, and-s usermakes Sorsa API available in every Claude Code project. Cursor reads a JSON block from~/.cursor/mcp.jsonfor every project or.cursor/mcp.jsonfor one; VS Code reads.vscode/mcp.jsonand asks for the key once, so it never sits in the file.claude mcp add sorsa -s user -e SORSA_API_KEY=YOUR_API_KEY -- npx -y sorsa-mcp{ "mcpServers": { "sorsa": { "command": "npx", "args": ["-y", "sorsa-mcp"], "env": { "SORSA_API_KEY": "YOUR_API_KEY" } } } } -
Check that it works. Ask your agent "How many Sorsa API requests do I have left?". It calls
get_key_usage_info, which readsGET /key-usage-info(opens in a new tab) and never counts against your requests; a number in the answer means the agent, the server and the key are connected. In Claude Code,claude mcp get sorsashould also say "Connected". -
Ask a real question. Try "Find the 50 most-liked posts about MCP servers from this week and group them by theme". The agent turns it into a
search_tweetscall like the one below, repeats it three or four times with thenext_cursoreach answer returns, about 20 posts per call, and writes the summary from the results.Tool call { "name": "search_tweets", "arguments": { "query": "\"mcp server\" min_faves:20 since:2026-10-26", "order": "popular" } }
Good to know
In Claude Code, the server's name goes before
-e. A line likeclaude mcp add --env SORSA_API_KEY=... sorsa -- npx -y sorsa-mcpfails with "Invalid environment variable format: sorsa", because--envtakes several values and reads the name as one more.Everything after
--belongs to the server's command, so a-eplaced at the end never reaches the server, and it stops at start with no key. We ran all three forms in Claude Code 2.1.314; only the line above connects.
#Lines for other MCP apps
Any app that runs local MCP servers starts sorsa-mcp with the same three settings: the command npx, the arguments -y sorsa-mcp, and your key as SORSA_API_KEY in its environment. Grok Build and OpenClaw add it from a terminal, and Hermes Agent reads it from its config file:
grok mcp add sorsa -e SORSA_API_KEY=YOUR_API_KEY -- npx -y sorsa-mcp
mcp_servers:
sorsa:
command: "npx"
args: ["-y", "sorsa-mcp"]
env:
SORSA_API_KEY: "YOUR_API_KEY"
Where each one goes, and how to see that it connected:
- Claude Desktop: paste the Cursor block into the file that Settings, Developer, Edit Config opens, quit the app fully and reopen it; the tools sit under "+".
- Gemini CLI: paste the Cursor block into
~/.gemini/settings.jsonand check with/mcp. - Grok Build: check with
grok mcp doctor sorsa. - OpenClaw: check with
openclaw mcp doctor sorsa --probe. - Hermes Agent: add the block to
~/.hermes/config.yaml, then run/reload-mcpin your session.
Claude.ai, ChatGPT and grok.com in a browser add servers by URL only, so they can't start a server on your computer: use Claude Desktop or Claude Code with the same key. Ready prompts that put the server to work sit on build with AI.
#What your agent can read: 40 tools
Sorsa API's MCP server has 40 tools, one for each API endpoint it covers, and every one of them reads public X data. The agent picks them by name from your request, so you rarely need to know which is which; here is what one call brings back in each group:
- Search, about 20 posts or accounts per call, with X search operators, back to 2006:
search_tweets,search_users,search_mentions. - Posts, up to 100 posts by ID per call, each with its author's full profile:
get_tweet_info,get_tweet_info_bulk,get_tweet_comments,get_tweet_quotes,get_retweeters,get_article,get_trends. - Accounts, up to 100 profiles per call, or a timeline 20 posts at a time:
get_user_info,get_user_info_batch,get_account_about,get_user_tweets. - Followers, up to 200 per page:
get_followers,get_following,get_verified_followers. - Checks, a yes or a no per call:
check_follow,check_retweet,check_quoted,check_comment,check_community_member. - Lists, Communities and Spaces, members, feeds and Space details:
get_list_members,get_list_tweets,get_list_followers,get_community_members,get_community_tweets,search_community_tweets,get_space_info. - Utilities, IDs and the requests you have left:
username_to_id,id_to_username,link_to_id,get_key_usage_info.
Seven more tools return Sorsa Score data for crypto accounts. The batch tools are where an agent saves the most: get_tweet_info_bulk runs POST /tweet-info-bulk (opens in a new tab) and get_user_info_batch runs GET /info-batch (opens in a new tab), 100 items for one request, and check_follow answers POST /check-follow (opens in a new tab) in one call instead of paging through a follower list.
No tool posts, replies, likes, follows or sends DMs, and none returns who liked a post, a user's likes or bookmarks, DMs or protected accounts: the server reads public data only.
#What one tool call costs
A tool call on Sorsa API costs one request, from $0.0014, whatever it returns; the official X MCP bills every item inside the call, so the same search for 20 posts costs $0.10 at $0.005 per post.
The gap grows with the size of the answer, because Sorsa API returns up to 200 items for the price of one request and includes each post's author at no extra cost:
| Tool call | What it returns | Sorsa API | Official X API rates | With authors, from Nov 22 |
|---|---|---|---|---|
search_tweets | About 20 posts | From $0.0014 | $0.10 | Up to $0.30 |
get_tweet_info_bulk | 100 posts | From $0.0014 | $0.50 | Up to $1.50 |
get_user_info_batch | 100 profiles | From $0.0014 | $1.00 | $1.00 |
get_followers | 200 followers | From $0.0014 | $2.00 | $2.00 |
search_tweets- What it returns
- About 20 posts
- Sorsa API
- From $0.0014
- Official X API rates
- $0.10
- With authors, from Nov 22
- Up to $0.30
get_tweet_info_bulk- What it returns
- 100 posts
- Sorsa API
- From $0.0014
- Official X API rates
- $0.50
- With authors, from Nov 22
- Up to $1.50
get_user_info_batch- What it returns
- 100 profiles
- Sorsa API
- From $0.0014
- Official X API rates
- $1.00
- With authors, from Nov 22
- $1.00
get_followers- What it returns
- 200 followers
- Sorsa API
- From $0.0014
- Official X API rates
- $2.00
- With authors, from Nov 22
- $2.00
At the scale of a month, search results through POST /search-tweets (opens in a new tab) cost from $0.07 per 1,000 on Sorsa API, against $5.00 per 1,000 posts at the official X API's rates. Lookups by ID come 100 to a call, from $0.014 per 1,000, and follower lists through GET /followers (opens in a new tab) from $0.007 per 1,000. Pick the size of your agent's month:
Official X API
$500
for 100K posts
$0.005 per post
Sorsa API
from$7
for 100K posts
from $0.07 per 1,000
Speed comes with the price: Sorsa API answers 20 requests per second on every plan, free accounts included, which is up to 2,000 tweets a second through batch lookups. A call that fails costs nothing, because failed requests are never charged.
#Why a read-only server suits an agent
A read-only server can't post, follow or pay for writes, so a confused or looping agent can only spend requests, never act on X in your name.
- No tool writes. There is no posting, reply, like, follow or DM tool, and the API behind the server has no such endpoint. Asked for
post_tweet, the server answers "Tool post_tweet not found". - One destination. The server runs on your computer, and its code sends every call to
https://api.sorsa.io/v3with your key in theApiKeyheader. The source is on GitHub (opens in a new tab) under the MIT license. - No X account. Sorsa API never asks for your X login, cookies or app.
- A ceiling on spend. A key makes at most 20 requests per second, and on pay as you go a spending limit, $100 by default, caps each billing period.
The tools are light on the agent's context too. The 40 tool definitions come to about 23K characters, roughly 5,800 tokens, and Claude Code loads only their names until it needs one. Results are full JSON with each author's profile, so ask for what you need ("the 50 newest posts"): Claude Code warns when one tool result passes 10K tokens.
Good to know
Text inside posts is data, not instructions. An agent that reads X will meet posts written to steer AI agents; with a read-only server, the most such a post can cost you is a wasted request. Keep the agent's other tools, such as sending email or editing files, behind your approval.
#Fix a setup that doesn't connect
Most failed setups come down to where the key sits, a missing Node.js, or an app that hasn't reloaded its servers. Match what you see:
| What you see | Why | Fix |
|---|---|---|
Invalid environment variable format: sorsa in Claude Code | The server name sits right after --env | Put the name first: claude mcp add sorsa -s user -e ... |
| "Failed to connect", and the server's environment is empty | -e came after --, so it went to npx | Move -e SORSA_API_KEY=... before -- |
npx: command not found | Node.js isn't installed | Install Node.js 18 or newer, then restart the app |
Missing SORSA_API_KEY environment variable | The config has no key | Add SORSA_API_KEY to the server's env |
Every call returns 401 invalid api key | The key is mistyped | Paste it again from the dashboard, with no spaces |
| Calls return 403 after a while | Your requests ran out | Upgrade the plan or switch on pay as you go; the same key keeps working |
| The server is added but shows no tools | The app hasn't reloaded | Quit Claude Desktop fully, run /reload-mcp in Hermes, or switch sorsa on in Cursor |
| A timeout on the very first start | npx is downloading the package | Start it again, or set startup_timeout_sec = 30 in Codex |
Invalid environment variable format: sorsain Claude Code- Why
- The server name sits right after
--env - Fix
- Put the name first:
claude mcp add sorsa -s user -e ...
"Failed to connect", and the server's environment is empty
- Why
-ecame after--, so it went to npx- Fix
- Move
-e SORSA_API_KEY=...before--
npx: command not found- Why
- Node.js isn't installed
- Fix
- Install Node.js 18 or newer, then restart the app
Missing SORSA_API_KEY environment variable- Why
- The config has no key
- Fix
- Add
SORSA_API_KEYto the server's env
Every call returns 401
invalid api key- Why
- The key is mistyped
- Fix
- Paste it again from the dashboard, with no spaces
Calls return 403 after a while
- Why
- Your requests ran out
- Fix
- Upgrade the plan or switch on pay as you go; the same key keeps working
The server is added but shows no tools
- Why
- The app hasn't reloaded
- Fix
- Quit Claude Desktop fully, run
/reload-mcpin Hermes, or switch sorsa on in Cursor
A timeout on the very first start
- Why
- npx is downloading the package
- Fix
- Start it again, or set
startup_timeout_sec = 30in Codex
Still stuck? Ask the agent to call get_key_usage_info and show you the raw result: a number means the key reaches Sorsa API, and an error names what is missing.
#Give your agent X data today
Add Sorsa API's MCP server and your agent reads X through 40 read-only tools: one line in Claude Code or Codex, tweets from $0.014 per 1,000 instead of $5.00 at the official X API's rates, 20 requests per second, and no X account of yours anywhere in the chain. The first 100 tool calls are free. For agents that call X data without MCP, through plain REST or the agent skill, read our guide to the Twitter API for AI agents.
#FAQ
Does X have an official MCP server?
Yes. X launched a hosted MCP server at api.x.com/mcp on June 30, 2026. It needs your own X developer app with OAuth 2.0, a local bridge called xurl and a one-time browser sign-in, and it bills each call at the official X API's pay-per-use rates. Its writes are bookmarks and Articles; its docs list no tool that creates a post.
Is the X MCP server free?
No. Connecting to the official X MCP costs nothing, but every call bills at X's pay-per-use rates: $0.005 per post and $0.010 per user, so a search that returns 20 posts costs $0.10. Sorsa API's MCP server bills one request per call, from $0.0014, and every new account starts with 100 free requests that never expire.
What is the best Twitter MCP server for an AI agent?
For an agent that reads X, use Sorsa API's MCP server: 40 read-only tools behind one API key, no X developer app, 20 requests per second on every plan, and tweets from $0.014 per 1,000 against $5.00 at the official X API's rates. Your X account is never connected, so the agent can't post or get it flagged. To post, add the official X API.
Can a Twitter MCP server post tweets?
Some can, through your X developer app's write keys or your logged-in account, and every post then runs on your account and its limits. The official X MCP lists no tool that creates a post; its writes are bookmarks and Articles. Sorsa API's MCP server is read-only by design: it can't post, like, follow or send DMs.
Which apps can run the Sorsa MCP server?
Any app that runs local MCP servers: Claude Code, Claude Desktop, Cursor, Codex, VS Code, Grok Build, Gemini CLI, OpenClaw and Hermes Agent. Each starts it with npx -y sorsa-mcp and your key in SORSA_API_KEY, which needs Node.js 18 or newer. Claude.ai, ChatGPT and grok.com in a browser add servers by URL only, so use a desktop app or a CLI.
#How we checked
On November 2, 2026 we installed sorsa-mcp 1.0.4 from npm, listed its tools (40, with about 23K characters of definitions) and called it with a made-up key to record what a wrong key returns. We added it to Claude Code 2.1.314 in a scratch configuration in three ways and kept the one line that connects. The same day we read X's MCP documentation, its launch post, its pricing page and its notice on billing expansions, and checked every endpoint named here against the live Sorsa API reference.
Sources
- MCP servers for the X API and X developer docs (opens in a new tab), X
- Announcing the hosted X MCP (opens in a new tab), X Developers
- Pay-per-use pricing (opens in a new tab), X
- X API PPU: expansions update (opens in a new tab), X Developers
- Connect Claude Code to tools via MCP (opens in a new tab), Anthropic
- sorsa-mcp on npm (opens in a new tab)
- Model Context Protocol (opens in a new tab)
- Sorsa API reference