MCP Server

X API MCP
X's official remote MCP server for resolving users, searching and retrieving posts, and accessing public X data through OAuth or app authentication.
What is X API MCP?
X API MCP exposes X data through a remote Model Context Protocol endpoint instead of requiring every agent client to implement the REST API directly. The documented local bridge, xurl, handles OAuth 2.0 PKCE login and token refresh, while a bearer-token path supports read-only application access. For intelligence workflows the useful surface includes resolving usernames, fetching user posts, searching across explicit time windows, retrieving posts by ID, expanding authors, and requesting attachments and public metrics. Credentials remain in the bridge or MCP client and should never be embedded in generated feeds.
Key capabilities
Official remote endpoint
Keeps the MCP protocol surface aligned with X's supported API and authentication model.
Local OAuth bridge
xurl handles PKCE login and token refresh outside generated artifacts and agent prompts.
Structured post fields
Lets clients request timestamps, text, authors, metrics, entities, attachments, and referenced posts.
Use cases
Power an X-backed Digest
Search current AI topics, preserve original post links and text, and fetch missing author or media data before local publication.
MCP capabilities
Tools
Resolve users
Resolve one or more usernames to stable user records and profile fields.
Fetch user posts
Read recent posts with requested fields, author expansion, attachments, and public metrics.
Search posts
Search public posts with explicit queries and time windows.
Retrieve post details
Fetch posts by ID when timeline or search results lack required fields.
Connection and auth
- An X developer application or supported X authorization
- An MCP client
- Node.js when using the xurl bridge
Client configuration
Generic MCP client via xurl
{"mcpServers":{"xapi":{"command":"npx","args":["-y","@xdevplatform/xurl","mcp","https://api.x.com/mcp"],"env":{"CLIENT_ID":"YOUR_X_APP_CLIENT_ID","CLIENT_SECRET":"YOUR_X_APP_CLIENT_SECRET"}}}}