| Server | What it does | URL |
|---|---|---|
| XMCP | Call X API endpoints (create posts, search, look up users, etc.) | http://127.0.0.1:8000/mcp (local) |
| Docs MCP | Search and read X API documentation | https://docs.x.com/mcp (hosted) |
XMCP — X API endpoints
XMCP is an official MCP server that exposes X API endpoints as callable tools. Run it locally and connect any MCP-compatible client — like Cursor, Windsurf, or your own agent — to read and write to X programmatically.GitHub repository
Source code, setup instructions, and configuration.
What is MCP?
Learn about the Model Context Protocol standard.
- 200+ tools automatically generated from the OpenAPI spec — search posts, create posts, look up users, manage likes, and more
- OAuth 1.0a authentication with browser-based consent flow
- Tool allow-listing via
X_API_TOOL_ALLOWLISTto restrict which API operations are available - Works with any MCP client — Cursor, Windsurf, or custom implementations
- Optional Grok test client using the xAI API
Quick setup
Configure credentials
Copy the example environment file and add your X API credentials:Edit
.env with your app’s OAuth consumer key, consumer secret, and bearer token from the Developer Console. Set your callback URL (e.g., http://127.0.0.1:8976/oauth/callback) — make sure to register it in the Developer Console too.Start the server
http://127.0.0.1:8000/mcp by default. Host and port are configurable via environment variables.Connect your AI tool
Point your MCP-compatible client to
http://127.0.0.1:8000/mcp. See the XMCP README for client-specific configuration.Configuration
Add XMCP to your MCP client settings:Tool allow-listing
By default, XMCP exposes all X API operations as tools. Use theX_API_TOOL_ALLOWLIST environment variable to restrict which tools are available:
Limitations
- No streaming or webhook endpoints — these require persistent connections that don’t fit the MCP request/response model
- Spec fetched at startup — restart the server to pick up any API spec updates
- Tokens stored in memory — OAuth tokens are not persisted across restarts
Docs MCP — documentation search
An MCP server for the X API documentation is hosted athttps://docs.x.com/mcp. Connect it to your AI tool to search and read documentation pages without leaving your workflow.
Available tools
| Tool | Description |
|---|---|
search_x | Search across the X documentation for relevant information, code examples, API references, and guides |
get_page_x | Retrieve the full content of a specific documentation page by its path |
Configuration
Add the docs MCP server to your MCP client configuration:Using both servers together
You can connect both MCP servers simultaneously. This gives your AI assistant the ability to both look up documentation and call the API:OpenAPI specification
The machine-readable API specification for all X API v2 endpoints. This is the same spec that XMCP uses to generate its tools.| Resource | URL |
|---|---|
| OpenAPI Spec (JSON) | https://api.x.com/2/openapi.json |