MCP server
X MCP Server: Connect Claude, Cursor and AI Agents to X (Twitter)
Prices checked:
Quick Answer
An X MCP server gives an AI assistant tools for reading X (Twitter), so you ask in plain language instead of writing API calls. TwexAPI runs a hosted one at https://api.twexapi.io/mcp. Add the URL to Claude, ChatGPT, Cursor, VS Code or any client that supports Streamable HTTP, then sign in with your TwexAPI account or send your API key in the x-api-key header. Your agent can then search tweets and read profiles, followers and trends. Each call costs the normal API rate: about $0.05 per 1,000 tweets or profiles, keyword search results included.
Connection details
| Setting | Value |
|---|---|
| Server URL | https://api.twexapi.io/mcp |
| Transport | Streamable HTTP |
| Authentication | Sign in with your TwexAPI account (OAuth), or send x-api-key: <your TwexAPI key> (Authorization: Bearer also works) |
| MCP Registry name | io.twexapi/mcp |
| Server card | https://api.twexapi.io/.well-known/mcp.json |
A request without credentials gets a 401 with a sign-in challenge, which is how clients know to open the sign-in page. Both API key headers returned 200 when we checked on December 1, 2026.
Set up the X MCP server in your client
| Client | How to add it |
|---|---|
| Claude.ai and Claude Desktop | Settings → Connectors → Add custom connector. Name it TwexAPI, enter https://api.twexapi.io/mcp, select Connect and approve the sign-in. |
| Claude Code | Run claude mcp add --transport http twexapi https://api.twexapi.io/mcp, then /mcp → twexapi → Authenticate. |
| Cursor | Add the server to ~/.cursor/mcp.json, then open Settings → MCP and select Authenticate. With an API key, use the config below. |
| VS Code | Command Palette → MCP: Add Server → HTTP, or add it to .vscode/mcp.json with "type": "http". |
| Codex | Run codex mcp add twexapi --url https://api.twexapi.io/mcp, then codex mcp login twexapi. |
| ChatGPT | Turn on Developer mode, add a custom MCP server with the URL and sign in. ChatGPT cannot send an API key header. |
| Windsurf | API key only: add serverUrl and an x-api-key header to mcp_config.json. |
Signing in needs no key in your config: the client opens twexapi.io in a browser and you approve access, read-only if you clear the write checkbox. We ran the full sign-in in Cursor; the other clients follow each vendor’s documented MCP sign-in, so switch to an API key if sign-in fails. The MCP docs have the complete config for every client.
{
"mcpServers": {
"twexapi": {
"url": "https://api.twexapi.io/mcp",
"headers": {
"x-api-key": "${env:TWEXAPI_API_KEY}"
}
}
}
}Tools the server exposes
| Tool | What it does |
|---|---|
| explore | Searches the TwexAPI endpoint catalog and returns each endpoint’s method, path and parameters, and which tool calls it. Uses no Credits. |
| twexapi_request | Calls a read-only endpoint that explore returned: search, profiles, followers, replies, lists, communities, trends and X Articles |
| twexapi_write | Calls a write endpoint, which today means posting a tweet or reply from your own account. Listed only when you grant write access. |
Three tools keep the agent’s context small: it looks up the right endpoint first, then calls it, instead of loading dozens of tool definitions. The catalog listed 55 endpoints on December 1, 2026.
What your agent can do
- Search tweets with advanced search operators, by keyword, account or date.
- Read timelines, profiles, followers and following lists.
- Pull replies, quotes and retweeters of a tweet, and trends by country.
- Read long X Articles as Markdown.
- Post a tweet or reply from your own account through twexapi_write, if you grant write access and add that account’s session cookie.
Example prompts
- Use TwexAPI to get the trending topics in Japan and the United States, and tell me what differs.
- Search X posts from @nasa in the last week and list the five with the most likes, with links.
- Read the profile of @openai and return its bio, follower count and join date.
- Pull the replies to this post and group them into supportive, critical and neutral.
Twitter (X) MCP servers compared
| Server | How it runs | What you need | Cost of reading 1,000 tweets |
|---|---|---|---|
| TwexAPI MCP | Hosted, Streamable HTTP at api.twexapi.io/mcp | A TwexAPI account or API key | ~$0.05 |
| xmcp (xdevplatform on GitHub) | Self-hosted Python server that turns the X API spec into tools, on 127.0.0.1:8000 by default | An X developer app: consumer key and secret, bearer token, OAuth consent in a browser | $5.00 at X pay-per-use rates |
| x-mcp (infatoshi on GitHub) | Self-hosted Node server over stdio | Five X developer credentials, with Read and Write permission for posting | $5.00 at X pay-per-use rates |
Self-hosted servers call X’s own API with your developer credentials, so every tool call is billed at X’s pay-per-use rates and some actions depend on your X access level. A hosted server needs no developer account and nothing to run. Checked on 2026-10-28 from each project’s README.
Cost
| Action | TwexAPI MCP | Official X API |
|---|---|---|
| Read 1,000 tweets from account timelines | ~$0.05 | $5.00 |
| Search 1,000 tweets by keyword | ~$0.05 | $5.00 |
| Read 1,000 profiles | ~$0.05 | $10.00 |
| Create a post | $0.0005 | $0.015 ($0.200 with a link) |
FAQ
What is an X MCP server?
A Model Context Protocol (MCP) server that gives an AI assistant tools for X (Twitter) data, such as searching posts and reading profiles. You connect it to a client like Claude or Cursor once, then ask for the data in plain language.
Which clients work with the Twitter MCP server?
Claude.ai, Claude Desktop, Claude Code, ChatGPT, Cursor, Codex, VS Code and OpenCode can sign in with your TwexAPI account after you add the server URL. Windsurf and other clients connect with an API key header.
Do I need an X developer account?
No. You only need a TwexAPI account or API key. New accounts get 20,000 free Credits: about 4,000 tweet, search or profile reads.
What is the best X (Twitter) MCP server for Claude?
If you want nothing to install and low read costs, use a hosted server such as TwexAPI MCP: add it as a custom connector in Claude, or with one command in Claude Code. If your project must run on X’s own API under a developer agreement, self-host xmcp or x-mcp with your X developer keys and pay X’s rates.
Is the MCP server free?
Connecting is free and the explore tool uses no Credits. Each data call is billed like the matching REST call, so the free Credits cover about your first 4,000 reads.
Can I connect the X MCP server read-only?
Yes. Clear the write checkbox on the sign-in page and the write tool is not listed, so the agent can only read.
Is TwexAPI affiliated with X?
No. TwexAPI is an independent third-party provider of public social data and is not affiliated with or endorsed by X Corp.
Related Guides
Sources
Prices change. Confirm current rates on each provider’s pricing page before you buy. TwexAPI is an independent provider and is not affiliated with or endorsed by X Corp.