X (Twitter) MCP Server
X has an official MCP server now. How to connect the X (Twitter) MCP to Claude, Cursor or Claude Code, what it can read, and what each API call costs.
- Pricing
- paid
- GitHub stars
- 856
- Last commit
- 2026-04-09
- Page updated
The MCP server is free, but every X API call is billed pay-per-use: $0.015 per post created and $0.20 if it contains a link, with reads billed per call too.
Since June 30, 2026, X runs its own hosted MCP server at https://api.x.com/mcp. It exposes the X API as tools, so Claude can search posts, pull trends, look up accounts and read engagement on your posts using your own account's permissions. X also open-sourced the code as xmcp if you'd rather self-host.
For most marketers the official server is the one to use. It's maintained by X, it follows API changes, and you don't hand your password to a random npm package. The catch: you need an X developer app with pay-per-use billing turned on, and every call costs money. Community servers like EnesCinr/twitter-mcp still work if you only need "post a tweet" and "search tweets", but they hit the same paid API.
A workflow I like: before a launch, ask Claude to pull the last 7 days of posts about your category, group them by complaint, and list the 10 accounts getting the most replies. That's your angle list and your outreach list in one chat. Pair it with the Reddit MCP for the longer-form version of the same complaints.
Two caveats. First, write access is murky: X told TechCrunch the hosted server doesn't expose the endpoints for posting, while the self-hosted xmcp repo includes createPosts, likePost and friends. Check the tool list your client shows before you plan a posting workflow. Second, reads add up. A research session that pages through a few thousand posts is billed per post, so set a spending cap in the developer console first.
Official vs community X (Twitter) MCP
Remote server URL: https://api.x.com/mcp
xurl bridge because X's OAuth only works with your own developer app, so you need one either way. Community servers only make sense if you want a tiny tool surface (post + search) or you already run one.What you can ask it
- “Search X for posts from the last 7 days mentioning "email deliverability" and group the complaints into 5 themes with an example post for each”
- “Pull the 20 accounts that replied most to @competitor this month and tell me which ones also follow us”
- “What's trending in the US right now that a B2B SaaS brand could reasonably post about? Skip anything political”
- “Get analytics for my last 30 posts and rank them by engagement rate. What do the top 5 have in common?”
- “Find posts asking for alternatives to [competitor] in the last 14 days and draft a helpful, non-salesy reply for each”
Features
- Search recent posts and the full archive (`searchPostsRecent`, `searchPostsAll`)
- Trends by location and personalized trends
- User lookups, followers, following, mentions and timelines
- Engagement data on posts: who liked, reposted or quoted
- Post and media analytics for your own account
- Bookmarks, lists and X News search
- Tool allowlist (`X_API_TOOL_ALLOWLIST`) on the self-hosted version so Claude only sees what you allow
How to set up the X (Twitter) MCP Server
Works with: Claude Desktop, Claude Code, Cursor, Grok
http://localhost:8080/callback as an OAuth2 redirect URI. Copy the app's Client ID and Client Secret.
2. Claude Desktop / Cursor: X's xurl CLI acts as a bridge to the hosted server and handles OAuth for you. Add this to your MCP config:
{
"mcpServers": {
"xapi": {
"command": "npx",
"args": [
"-y",
"@xdevplatform/xurl",
"mcp",
"https://api.x.com/mcp"
],
"env": {
"CLIENT_ID": "...",
"CLIENT_SECRET": "..."
},
"startup_timeout_sec": 300
}
}
}
3. Claude Code: add the same bridge from your terminal:
claude mcp add xapi -e CLIENT_ID=your_id -e CLIENT_SECRET=your_secret -- npx -y @xdevplatform/xurl mcp https://api.x.com/mcp
4. Restart the client. The first run opens a browser so you can log in to X; after that the token is cached and refreshed automatically.
5. Self-hosting instead: clone xdevplatform/xmcp, copy env.example to .env, fill in X_OAUTH_CONSUMER_KEY, X_OAUTH_CONSUMER_SECRET and X_BEARER_TOKEN, run python server.py, and point your client at http://127.0.0.1:8000/mcp.Alternatives
Small community server with two tools (post_tweet, search_tweets); needs your own X API keys and pays the same API rates.
Community server with more actions (threads, likes, follows); read its auth setup carefully before giving it account access.
FAQ
Is there an official X (Twitter) MCP server?
How do I connect X to Claude?
npx -y @xdevplatform/xurl mcp https://api.x.com/mcp) with your CLIENT_ID and CLIENT_SECRET to Claude Desktop, Cursor or Claude Code. A browser login runs on first start.Can the X MCP post tweets for me?
Is the X MCP free?
More marketing MCP servers
Bluesky MCP Server
Bluesky MCP servers compared. Use atproto-mcp to let Claude read feeds, analyze accounts and post threads on Bluesky. There's no official server yet.
atproto-mcp free Instagram MCP Server
Instagram MCP setup for Claude: publish posts, read insights, and reply to DMs on a Business account via the official Graph API. No official Meta server yet.
git clone https://github.com/jlbadano/ig-mcp free LinkedIn MCP Server
LinkedIn MCP guide: there's no official server, so here's the best community option for Claude, what it can do, and the account-ban risk to know first.
uvx mcp-server-linkedin@latest free Reddit MCP Server
There's no official Reddit MCP. Here's the community Reddit MCP server I'd use with Claude for audience research, plus setup, rate limits and costs.
reddit-mcp-buddy free Figma MCP Server
Official MCP server by Figma. Convert designs into code, extract design tokens, access components and variables — directly from Claude Code or any MCP-compatible editor.
figma (remote MCP) freemium Added: 2025-02-18 · Last reviewed: 2026-09-22