xdevplatform/xmcp
A self-hosted FastMCP bridge that turns X API operations into MCP tools
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
xmcp is a Python bridge from MCP clients to the X API. On startup, server.py fetches https://api.twitter.com/2/openapi.json and uses FastMCP to expose eligible OpenAPI operations as tools. The HTTP endpoint defaults to http://127.0.0.1:8000/mcp, and X API calls default to https://api.x.com. This keeps tool registration schema-driven rather than requiring a separate wrapper for every operation.
The dependency list includes fastmcp, httpx, python-dotenv, requests-oauthlib, xdk, and xai-sdk. The service is configured through environment variables, including those loaded from a local .env file. Its startup flow opens a browser for OAuth1 consent and waits on a local callback; obtained tokens stay in process memory. The optional test_grok_mcp.py client exercises the MCP endpoint through xAI and is separate from the server runtime path.
Key Capabilities & Differentiators
The tool catalog spans user lookup, recent post search, post analytics, lists, bookmarks, and direct messages, and includes writes such as createPosts and deletePosts. X_API_TOOL_ALLOWLIST takes comma-separated OpenAPI operation IDs, so a deployment can expose only getUsersByUsername and searchPostsRecent, for example. Filtering happens when the schema is loaded, so changing the list requires a restart.
Streaming and webhook coverage is deliberately excluded: matching paths containing /stream or /webhooks, operations tagged Stream or Webhooks, and operations marked x-twitter-streaming: true are filtered out. Tool registration does not guarantee authorization at X, and an allowlist controls what MCP exposes rather than changing what the app or user token is authorized to do.
Trade-offs & Limitations
The schema-driven design saves wrapper maintenance and gives an existing MCP client broad X API reach, but it also ties startup and tool registration to a live upstream specification. Upstream operation or schema changes can affect the available tools after a restart. The dependencies in requirements.txt are unpinned, so a deployment that needs reproducible builds should validate and lock a working set.
Direct API integration is a better fit for a fixed application that needs explicit request handling or streaming and webhooks; a hand-written MCP adapter can keep a small tool contract stable at the cost of more maintenance. Here, browser consent and process-only OAuth1 storage mean restarts need planning for unattended use. Before wider deployment, restrict the tool surface, verify how clients are authenticated, and resolve the unspecified license before redistribution or commercial bundling.
Hardware & Deployment Guide
The local setup calls for Python 3.9+, a virtual environment, dependencies installed from requirements.txt, and an X Developer Platform app. Copy env.example to .env and set X_OAUTH_CONSUMER_KEY, X_OAUTH_CONSUMER_SECRET, and X_BEARER_TOKEN; the bearer token remains required in this setup even when using OAuth1. Register the callback URL, which defaults to http://127.0.0.1:8976/oauth/callback, then start the service with python server.py and complete browser consent.
This is a self-hosted bridge, not an offline X backend: startup needs the remote spec and tool calls go to X. The optional Grok client also needs an xAI API key. A remote client can reach /mcp through a tunnel, but verify client access controls before exposing an account-backed service. X_API_DEBUG defaults to 1, so review log handling and leave credential-printing options disabled in normal operation. No container manifest or published release is listed, and the optional OAuth2 helper generate_authtoken.py is not in the supplied root tree; verify its availability before relying on that path.
Developers with an X Developer Platform app and an MCP client who want to expose a small set of X operations for local integration or controlled internal use.
You need offline access, streaming or webhook delivery, a stable versioned tool contract, or unattended remote operation without building and validating additional authentication controls.
Quick Start & Installation
http://<X_OAUTH_CALLBACK_HOST>:<X_OAUTH_CALLBACK_PORT><X_OAUTH_CALLBACK_PATH>
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| xmcp ★ | 873 | +1 | Python | — | A self-hosted FastMCP bridge that turns X API operations into MCP tools |
| skills | 204.1k | +2.5k | Python | — | A Claude Agent Skills catalog for packaging and reusing task workflows |
| graphify | 156.8k | +2.4k | Python | Apache-2.0 | Local AST graphs for dependency tracing, with CLI and MCP access. |
| last30days-skill | 80.4k | +3.9k | Python | MIT | An agent skill with a CLI and MCP bundle for cited, cross-source 30-day research |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/xdevplatform/xmcp.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about xmcp
How does an MCP client discover and use X API tools?
Does the server or optional Grok test client need a GPU?
What should a team verify before commercial use or redistribution?
When is xmcp preferable to direct API calls or a custom MCP adapter?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy