xmcp

MCP.Pizza Chef: xdevplatform

Once connected, your AI assistant can read and publish posts, search recent tweets, manage direct messages, follow or block users, create lists, and pull analytics on your X account. It runs on your own computer using Python, and requires you to register a free developer app with X to get access keys. Because it needs local setup and some coding know-how, this is best suited for someone comfortable with technical instructions rather than a complete beginner.

Communication
Data
Web/Research

Use This MCP server To

Post an update to my X account Search recent posts on X for a topic Reply to posts or send direct messages Look up a user's profile and follower count Create and manage lists of accounts to follow Check how my posts are performing Bookmark posts I want to save for later

README

X API FastMCP Server

Run a local MCP server that exposes the X API OpenAPI spec as tools using FastMCP. Streaming and webhook endpoints are excluded.

Prerequisites

  • Python 3.9+
  • An X Developer Platform app (to get tokens)
  • Optional: an xAI API key if you want to run the Grok test client

Setup (local)

  1. Create a virtual environment and install dependencies:
    • python -m venv .venv
    • source .venv/bin/activate
    • pip install -r requirements.txt
  2. Create your local .env:
    • cp env.example .env
    • Required values (do not skip):
      • X_OAUTH_CONSUMER_KEY
      • X_OAUTH_CONSUMER_SECRET
      • X_BEARER_TOKEN (required for this setup; keep it set even if using OAuth1)
    • OAuth1 callback (defaults are fine):
      • X_OAUTH_CALLBACK_HOST (default 127.0.0.1)
      • X_OAUTH_CALLBACK_PORT (default 8976)
      • X_OAUTH_CALLBACK_PATH (default /oauth/callback)
      • X_OAUTH_CALLBACK_TIMEOUT (default 300)
    • Server settings (optional):
      • X_API_BASE_URL (default https://api.x.com)
      • X_API_TIMEOUT (default 30)
      • MCP_HOST (default 127.0.0.1)
      • MCP_PORT (default 8000)
      • X_API_DEBUG (default 1)
  • Tool filtering (optional, comma-separated):
    • X_API_TOOL_ALLOWLIST
  • Optional Grok test client:
    • XAI_API_KEY
    • XAI_MODEL (default grok-4-1-fast)
    • MCP_SERVER_URL (default http://127.0.0.1:8000/mcp)
  • Optional OAuth2 token generation:
    • CLIENT_ID
    • CLIENT_SECRET
    • X_OAUTH_ACCESS_TOKEN - X_OAUTH_ACCESS_TOKEN_SECRET (optional)
  • Optional OAuth1 debug output:
    • X_OAUTH_PRINT_TOKENS
    • X_OAUTH_PRINT_AUTH_HEADER
  1. Register the callback URL in your X Developer App:
http://<X_OAUTH_CALLBACK_HOST>:<X_OAUTH_CALLBACK_PORT><X_OAUTH_CALLBACK_PATH>

Example (defaults):

http://127.0.0.1:8976/oauth/callback
  1. Start the server:
python server.py

The MCP endpoint is http://127.0.0.1:8000/mcp by default.

  1. Connect an MCP client:
  • Local client: point it to http://127.0.0.1:8000/mcp.
  • Remote client: tunnel your local server (e.g., ngrok) and use the public URL.

Whitelisting tools

Use X_API_TOOL_ALLOWLIST to load a small, explicit set of tools:

X_API_TOOL_ALLOWLIST=getUsersByUsername,createPosts,searchPostsRecent

Whitelisting is applied at startup when the OpenAPI spec is loaded, so restart the server after changes. See the full tool list below before building your allowlist.

xmcp FAQ

Can I use this to post updates to my X account?
Yes — once it's set up, your assistant can draft and publish posts, reply to others, and send direct messages on your behalf.
Can I use this to research trends and mentions?
Yes — it can search recent posts, look up trending topics, and check who has been mentioning a topic or username.
Which apps does this work with?
It runs as a small program on your own computer, and any assistant that supports MCP — such as Claude, Cursor, or other MCP-compatible tools — can connect to it.
Do I need an account or access keys?
Yes — you need a free X Developer Platform account to get access keys, which you save into a private settings file before starting the server.
How hard is it to set up?
This one takes real technical effort — installing Python, creating a private environment on your computer, and running a program from a command line — so it suits someone comfortable with technical instructions, or with developer help, more than a total beginner.
Can I limit which actions my assistant is allowed to take?
Yes — you can create an allow list of specific actions, such as only allowing it to read and search, so it can't post, delete, or message anyone until you add that permission yourself.
Does this work with Claude, ChatGPT, or Gemini?
It should work with any assistant that supports MCP, including Claude, Gemini, and other MCP-compatible tools — though getting it running does require some technical steps first.