$ 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
xurlbridge (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
xurlbridge 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_IDandCLIENT_SECRET; read-only uses an app-only Bearer token. For remote/server environments, usexurl auth oauth2 --headless - First run — the first OAuth login needs a browser, so set
startup_timeout_secto 300+ in client configs - Install command source — the official docs provide a
claude_desktop_config.jsonJSON for Claude Desktop; the commands above port that to Claude Code’sclaude mcp addform - License — the
xurlbridge is MIT; the MCP server is a service hosted by X