Appearance
MCP Servers Fresh
Two MCP (Model Context Protocol) servers are available for working with X from AI tools. They are complementary: one calls the API, the other reads the docs.
| 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 (repository: github.com/xdevplatform/xmcp) 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.
XMCP loads the X API OpenAPI specification (https://api.x.com/2/openapi.json) at startup and converts every operation into an MCP tool. Your AI assistant can then call these tools to interact with the X API - creating posts, searching, looking up users, and more.
Key features
- 200+ tools automatically generated from the OpenAPI spec - search posts, create posts, look up users, manage likes, and more
- OAuth 1.0a authentication with a 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
Configuration
json
{
"mcpServers": {
"xmcp": {
"url": "http://127.0.0.1:8000/mcp"
}
}
}Once connected, ask your assistant to interact with X directly - "search for recent posts about AI", "look up @XDevelopers", or "create a post".
For the full install procedure, see Install XMCP.
Limitations
- No streaming or webhook endpoints - these require persistent connections that do not fit the MCP request/response model
- Spec fetched at startup - restart the server to pick up API spec updates
- Tokens stored in memory - OAuth tokens are not persisted across restarts
See Limitations for the full list.
Docs MCP - documentation search
An MCP server for the X API documentation is hosted at https://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
json
{
"mcpServers": {
"x-docs": {
"url": "https://docs.x.com/mcp"
}
}
}This is useful when you are building with the X API and want your AI assistant to look up endpoint details, authentication guides, or code examples on the fly.
Using both servers together
Connect both simultaneously so your assistant can look up documentation and call the API:
json
{
"mcpServers": {
"xmcp": {
"url": "http://127.0.0.1:8000/mcp"
},
"x-docs": {
"url": "https://docs.x.com/mcp"
}
}
}See Run Both Servers Together.