claudekit / tools / x-api
[ MCP · Communication ]

X

X's (formerly Twitter) hosted MCP server. Search posts and users, manage bookmarks, fetch trends and news, and draft Articles from Claude Code.

xdevplatform/xurl ·updated
$ claude mcp add xapi --env CLIENT_ID=YOUR_X_APP_CLIENT_ID --env CLIENT_SECRET=YOUR_X_APP_CLIENT_SECRET -- npx -y @xdevplatform/xurl mcp https://api.x.com/mcp copy

X’s (formerly Twitter) hosted MCP server, connected through the open-source xurl bridge (xdevplatform/xurl).

Why it matters

Searching X posts or analyzing a user’s timeline meant the X developer portal or the raw API. Connect the X MCP and you can search posts and users, manage bookmarks, fetch trends, and draft Articles as a conversation in Claude Code.

What you can do

Representative tasks from X’s official docs:

  • Search posts — “Search the full archive for ‘Claude Code’ posts from the last week and summarize them.” (full-archive search)
  • Analyze users — “Look up @username and summarize the main topics in their recent timeline.” (user lookup, timeline)
  • Manage bookmarks — “Bookmark this post into my ‘AI’ folder.” (bookmarks, folders)
  • Trends and news — “Show me what’s trending right now and the related news.” (trends by WOEID, news)
  • Draft Articles — “Draft an X Article from this content.” (draft Articles)

Grounded in docs.x.com/tools/mcp.

Key features

  • Posts — fetch posts, see likers/reposters/quoters, recent counts
  • Search — full-archive post search, user search, news search
  • Users — resolve current user, look up by ID/handle, read posts/timeline/mentions
  • Bookmarks — list, add, remove, manage folders
  • News & Trends — get stories, trends by location (WOEID)
  • Articles — create and publish draft Articles

Setup

OAuth 2.0 (read and write):

claude mcp add xapi --env CLIENT_ID=YOUR_X_APP_CLIENT_ID --env CLIENT_SECRET=YOUR_X_APP_CLIENT_SECRET -- npx -y @xdevplatform/xurl mcp https://api.x.com/mcp

App-only Bearer (read-only):

claude mcp add --transport http xapi https://api.x.com/mcp --header "Authorization: Bearer YOUR_APP_ONLY_BEARER_TOKEN"

Notes

  • Cost — the MCP server and the xurl bridge are free, but the X API requires a developer account on X’s Pay-per-use plan. Writes (bookmarks, Articles) count against rate limits
  • Auth — OAuth 2.0 PKCE (automatic token refresh) needs the X app’s CLIENT_ID and CLIENT_SECRET; read-only uses an app-only Bearer token. For remote/server environments, use xurl auth oauth2 --headless
  • First run — the first OAuth login needs a browser, so set startup_timeout_sec to 300+ in client configs
  • Install command source — the official docs provide a claude_desktop_config.json JSON for Claude Desktop; the commands above port that to Claude Code’s claude mcp add form
  • License — the xurl bridge is MIT; the MCP server is a service hosted by X
§ 6

Frequently Asked Questions

frequently asked
§ 6.1
What is the X MCP?
X's (formerly Twitter) hosted MCP server (`https://api.x.com/mcp`). It lets Claude Code search posts and users, manage bookmarks, fetch trends and news, and draft Articles using your X account's permissions.
§ 6.2
Where does it work?
It works in Claude Code, Claude Desktop, Cursor, VS Code, and other MCP-compatible tools. OAuth 2.0 is handled through the `xurl` local bridge (`@xdevplatform/xurl`).
§ 6.3
How do I install it?
For OAuth 2.0, pass your X app's `CLIENT_ID` and `CLIENT_SECRET` to the `xurl mcp` bridge. For read-only access, pass an app-only Bearer token via the `Authorization` header to connect directly to `https://api.x.com/mcp`.
§ 6.4
Is it free?
The MCP server and the `xurl` bridge are free, but the underlying X API requires a developer account enrolled in X's Pay-per-use plan. Writes count against rate limits.
§ 6.5
What can I do with it?
Full-archive post search, user lookup and timeline analysis, bookmark management with folders, trends and news, and creating and publishing draft Articles.