social Editor's Pick Official server available

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.

View on GitHub
npx -y @xdevplatform/xurl mcp https://api.x.com/mcp
Website

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

X API MCP (hosted)

Remote server URL: https://api.x.com/mcp

This is X's own server, launched June 2026, and the one I'd pick for research and monitoring. You connect through X's 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

1. Create an app in the X Developer Console, turn on pay-per-use billing, and add 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

EnesCinr/twitter-mcp

Small community server with two tools (post_tweet, search_tweets); needs your own X API keys and pays the same API rates.

taazkareem/twitter-mcp-server

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?
Yes. X launched a hosted MCP server at https://api.x.com/mcp on June 30, 2026, and published the self-hostable code as xdevplatform/xmcp on GitHub.
How do I connect X to Claude?
Create an X developer app with pay-per-use billing, then add the xurl bridge (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?
X told TechCrunch the hosted server doesn't expose the posting endpoints. The self-hosted xmcp repo does include createPosts, likePost and repostPost, so check your tool list and read X's automation rules before you let Claude post.
Is the X MCP free?
The server is free to connect, but X API usage is pay-per-use. Posting costs $0.015 per post ($0.20 with a link), and reads are billed per call, so set a spend limit in the developer console.

Added: 2025-02-18 · Last reviewed: 2026-09-22