x-mcp
Optional local dependency used for media processing: when ffmpeg is installed, the server samples videos and GIFs into 1–6 frames so agents can see video content returned as image content (otherwise only a preview frame plus the video URL is returned).
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Give AI agents access to X: read and search posts, publish threads, upload media, manage Lists, send DMs, and see images and video frames.
Install
Requires Node.js 22.18+.
npm install
npm run buildAdd it to your MCP client (Claude Desktop, Cursor, Codex, custom agents):
{
"mcpServers": {
"x": {
"command": "node",
"args": ["/absolute/path/to/x-mcp/dist/index.mjs"],
"env": { "X_BEARER_TOKEN": "..." }
}
}
}Once published to npm: { "command": "npx", "args": ["-y", "@el4cteo/x-mcp"] }.
Or install the CLI globally:
npm install -g @el4cteo/x-mcp
x-mcpRelated MCP server: x-mcp-server
Sign in
Public reads — set
X_BEARER_TOKEN.Posting, DMs, bookmarks — run:
node dist/index.mjs auth --client-id YOUR_OAUTH2_CLIENT_IDSet the X app callback to http://127.0.0.1:8787/callback. Tokens are stored in ~/.config/x-mcp/credentials.json and refreshed automatically. OAuth 1.0a keys (X_API_KEY, X_API_SECRET, X_ACCESS_TOKEN, X_ACCESS_TOKEN_SECRET) also work.
Tools
Ten tools. Each call takes an action plus that action's parameters:
{ "action": "search", "query": "mcp -is:retweet", "max_results": 20 }Tool | Actions |
| create, create_thread, delete, get, get_many, search, count, thread, likers, reposters, quotes, hide_reply |
| home, user, mentions, liked, bookmarks |
| me, get, get_many, search, followers, following, follow, unfollow, mute, unmute, block, unblock, muted, blocked |
| like, unlike, repost, unrepost, bookmark, unbookmark |
| create, update, delete, get, owned, memberships, pinned, add_member, remove_member, posts, members, followers, follow, unfollow |
| search, get, get_many, posts |
| by_location, personalized |
| send, send_to_conversation, events, conversation, with_user, delete |
| upload, status, view |
| auth_status, rate_limits, usage |
Run node dist/index.mjs tools for descriptions.
See images and video
x_media action view returns the post's media as MCP image content.
Photos come back directly; carousels use
media_index(0–3).Videos and GIFs are sampled into 1–6 frames when ffmpeg is installed.
Without ffmpeg you get the preview frame plus the video URL.
Install ffmpeg: winget install Gyan.FFmpeg (Windows), brew install ffmpeg (macOS), sudo apt install ffmpeg (Linux). Or set X_MCP_FFMPEG.
Limit: 15 MB per image, 200 MB per video; raise with X_MCP_MAX_IMAGE_MB / X_MCP_MAX_VIDEO_MB.
Commands
node dist/index.mjs # stdio
node dist/index.mjs serve --http # http://127.0.0.1:3333/mcp
node dist/index.mjs doctor # credentials + connection check
node dist/index.mjs auth --logout # remove tokensSettings
Variable | Default | Purpose |
| — | App-only token for public reads |
|
| Block all writes |
|
| Preview writes without sending |
| all | Expose only some tools, e.g. |
| cwd | Directories allowed for uploads |
| — | Bearer token for HTTP mode |
Full list in .env.example.
Safety
--read-onlyfor research-only agents,--dry-runto preview writes.Media downloads reject private addresses; uploads are restricted to media files in allowed roots.
HTTP mode binds to loopback by default and requires a token off-loopback.
Posts and DMs are public or permanent — agents are instructed to confirm first.
Development
npm run typecheck
npm test # 85 tests, no X credentials needed
npm run buildMIT — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Live X/Twitter data: profiles, tweets, search, followers, lists and trends. 29 read-only tools.
X (formerly Twitter) posts, profiles, and search for AI agents. Free key, self-minted, no signup.
Publish and schedule tweets and threads on X (Twitter) from your AI assistant.
Search and read public data from X/Twitter, Reddit, YouTube, Instagram, TikTok, Facebook, Threads, Bluesky, Trustpilot, Amazon, Google Maps, news, forums and the web. 90+ read-only tools plus ready-made research playbooks (lead finding, brand monitoring, review mining). Hosted: connect with an API key; 50 free requests per endpoint each month.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables LLM agents to interact with Twitter (X) for searching tweets, posting content with images, analyzing engagement, and extracting topics using the Twitter API.-
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to interact with X (Twitter) API v2 for posting tweets, searching, liking, retweeting, and more through natural language.17 PyPIMIT
- AlicenseCqualityBmaintenanceEnables AI agents to search, read user profiles, timelines, media, follow threads, track trends, and manage accounts on X/Twitter via GraphQL, without browser automation or paid API keys.10011MIT
- AlicenseNot gradedqualityCmaintenanceProvides 19+ tools for AI agents to interact with X/Twitter, including search, posting, analysis, and monitoring capabilities.9 npm2MIT