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).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@x-mcp search X for recent posts about MCP servers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Available Tools
10 toolsx_dmsX Direct MessagesADestructive
Send and read Direct Messages: send to a user or an existing conversation, read events, read a conversation, and delete an event.
Actions (pass "action" plus that action's parameters):
send: Send a DM to a user, creating the 1:1 conversation if needed. [requires: text]
send_to_conversation: Send a message to an existing DM conversation by conversation id. [requires: conversation_id, text]
events: Recent Direct Message events across all conversations, newest first (1-100 per page).
conversation: Messages in one DM conversation, newest first (1-100 per page). [requires: conversation_id]
with_user: Messages exchanged with one user, newest first (1-100 per page).
delete: Delete a Direct Message event sent by the authenticated account. [requires: event_id]
Inputs: action (required), text, user_id, event_id, +6 more.
x_engagementX engagementAIdempotent
Like, repost and bookmark posts, and undo those actions, as the authenticated account.
Actions (pass "action" plus that action's parameters):
like: Like a post as the authenticated account. [requires: tweet_id]
unlike: Remove a like from a post. [requires: tweet_id]
repost: Repost a post to your followers. [requires: tweet_id]
unrepost: Remove one of your reposts. [requires: tweet_id]
bookmark: Save a post to your bookmarks. [requires: tweet_id]
unbookmark: Remove a post from your bookmarks. [requires: tweet_id]
Inputs: action (required), tweet_id.
x_listsX ListsADestructiveIdempotent
Manage Lists and read their timelines: create, update, delete, look up, owned/memberships/pinned Lists, add/remove members, list members/followers/posts, follow/unfollow.
Actions (pass "action" plus that action's parameters):
create: Create a curated List. [requires: name]
update: Rename, re-describe or change the visibility of a List you own. [requires: list_id]
delete: Delete a List you own. [requires: list_id]
get: Fetch a List by id: name, description, owner, member/follower counts and visibility. [requires: list_id]
owned: Lists created by a user (defaults to the authenticated account), 1-100 per page.
memberships: Lists a user is a member of (defaults to the authenticated account), 1-100 per page.
pinned: Lists pinned to a user profile (defaults to the authenticated account).
add_member: Add a user to a List you manage. [requires: list_id, user_id]
remove_member: Remove a user from a List you manage. [requires: list_id, user_id]
posts: The timeline of a List, newest first (1-100 per page). [requires: list_id]
members: Users who belong to a List, 1-100 per page. [requires: list_id]
followers: Users who follow a List, 1-100 per page. [requires: list_id]
follow: Follow a List so its timeline appears in your Lists tab. [requires: list_id]
unfollow: Stop following a List. [requires: list_id]
Inputs: action (required), name, list_id, private, +5 more.
x_mediaX mediaA
Upload media, check video/GIF processing, and view attached media — photos are returned as images, videos are sampled into frames when ffmpeg is installed.
Actions (pass "action" plus that action's parameters):
upload: Upload an image, GIF, video or subtitle file and get a media_id to attach to x_posts action "create" or x_dms action "send".
status: Poll the processing state of an uploaded video or GIF. [requires: media_id]
view: Downloads media attached to a post and returns it as MCP image content, so vision-capable models can actually see pictures instead of only reading URLs.
Inputs: action (required), url, path, base64, +9 more.
x_metaX diagnosticsARead-onlyIdempotent
Check credentials, observed rate limits and billed API usage.
Actions (pass "action" plus that action's parameters):
auth_status: Diagnose credentials: which auth modes are configured, whether a user session can post/DM, token expiry and scopes, plus the effective server flags (read-only, dry-run, cache, API base).
rate_limits: Shows the last rate-limit window X reported for each endpoint (remaining requests and reset time), the in-memory cache hit/miss counters, and whether the server waits or fails when a buck…
usage: Current billing-period post consumption for the X project: the cap, how many posts have been consumed, and daily usage.
Inputs: action (required).
x_postsX postsADestructive
Create, read, search and moderate posts: publish posts and threads, fetch one or many by id, search recent or full-archive, count volume, reconstruct a conversation, list likers/reposters/quotes, hide replies, delete.
Actions (pass "action" plus that action's parameters):
create: Publish a post (tweet), reply or quote on X as the authenticated account. [requires: text]
create_thread: Publish a multi-post thread by chaining replies. [requires: posts]
delete: Delete a post you authored. [requires: tweet_id]
get: Fetch one post with its author, metrics, media, entities and (when present) the quoted or reposted post. [requires: tweet_id]
get_many: Fetch up to 100 posts in one request. [requires: tweet_ids]
search: Search X posts with the v2 search operators. [requires: query]
count: Get post volume for a query without retrieving the posts themselves. [requires: query]
thread: Reconstruct a conversation: fetches the root post and finds replies via conversation_id search. [requires: tweet_id]
likers: Returns up to 100 users per page who liked the post. [requires: tweet_id]
reposters: Returns up to 100 users per page who reposted the post. [requires: tweet_id]
quotes: Returns up to 100 posts that quote the given post, with authors and metrics. [requires: tweet_id]
hide_reply: Hide a reply to one of your posts, or unhide it. [requires: tweet_id]
Inputs: action (required), poll, text, posts, +19 more.
x_spacesX SpacesARead-onlyIdempotent
Search live or scheduled audio Spaces and read the posts shared in them.
Actions (pass "action" plus that action's parameters):
search: Find live or scheduled audio Spaces by keyword (up to 100 results). [requires: query]
get: Fetch one Space by id: title, state, hosts, participant count and schedule. [requires: space_id]
get_many: Batch lookup of up to 100 Spaces by id. [requires: space_ids]
posts: Posts attached to a Space, 1-100 per page. [requires: space_id]
Inputs: action (required), query, state, space_id, +3 more.
x_timelinesX timelinesARead-onlyIdempotent
Read home and user timelines, mentions, liked posts and your bookmarks.
Actions (pass "action" plus that action's parameters):
home: Reverse-chronological home timeline for the authenticated account.
user: Timeline of posts authored by a user (1-100 per page).
mentions: Posts that mention a user (1-100 per page).
liked: Posts liked by a user, newest first (1-100 per page).
bookmarks: The authenticated account's bookmarks (1-100 per page).
Inputs: action (required), exclude, user_id, end_time, +4 more.
x_trendsX trendsARead-onlyIdempotent
Trending topics by location (WOEID) and personalised trends for the authenticated account.
Actions (pass "action" plus that action's parameters):
by_location: Trending topics for a location identified by WOEID.
personalized: Trending topics personalised for the authenticated account (based on follows, location and activity).
Inputs: action (required), woeid, max_trends.
x_usersX usersADestructiveIdempotent
Profiles and relationships: look up me/one/many, search users, followers, following, follow/unfollow, mute/unmute, block/unblock, muted and blocked lists.
Actions (pass "action" plus that action's parameters):
me: Profile of the authenticated account: id, handle, bio, follower counts and pinned post.
get: Look up one account by handle or numeric id.
get_many: Batch lookup of up to 100 accounts by handle or id in a single request.
search: Search accounts by keyword (name, handle, bio) with 1-100 results per page. [requires: query]
followers: Accounts following a user, 1-1000 per page (X caps at 1000).
following: Accounts a user follows, 1-1000 per page.
follow: Follow an account as the authenticated user.
unfollow: Unfollow an account as the authenticated user.
mute: Mute an account for the authenticated user.
unmute: Unmute an account for the authenticated user.
block: Block an account on behalf of the authenticated user.
unblock: Unblock an account.
muted: Accounts muted by the authenticated user (1-100 per page).
blocked: Accounts blocked by the authenticated user (1-1000 per page).
Inputs: action (required), query, user_id, user_ids, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool is scoped to a distinct X resource or domain: posts, users, timelines, lists, DMs, media, Spaces, trends, engagement, and metadata. Overlaps such as reading liked posts versus liking a post are clearly separated by tool purpose and action descriptions.
All tool names follow a consistent x_<resource> pattern and all action names use snake_case. Minor singular/plural differences such as x_engagement versus x_posts do not undermine predictability.
The 10 tools are well-scoped groups for a broad API, keeping the tool surface manageable while still exposing the necessary operations. Each tool earns its place as a coherent resource bucket.
The set covers the core lifecycle for posts, users, lists, DMs, media, Spaces, trends, engagement actions, and operational metadata. Read/write, search, batch lookup, moderation, and relationship operations are all represented, leaving no obvious workflow dead ends.
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.
Twitter (X) data for agents: profiles, tweets, search, followers, lists. $0.0006 per call.
Publish and schedule tweets and threads on X (Twitter) from your AI assistant.
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 gradedqualityDmaintenanceEnables AI assistants to interact with X (Twitter) API v2 for posting tweets, searching, liking, retweeting, and more through natural language.23 PyPIMIT
- AlicenseCqualityCmaintenanceEnables 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.17 npm3MIT