x-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| X_API_KEY | No | OAuth 1.0a API key. | |
| X_API_SECRET | No | OAuth 1.0a API secret. | |
| X_MCP_FFMPEG | No | Path to the ffmpeg executable for video frame sampling. | |
| X_MCP_DRY_RUN | No | Preview writes without sending. | false |
| X_ACCESS_TOKEN | No | OAuth 1.0a access token. | |
| X_BEARER_TOKEN | No | App-only token for public reads. | |
| X_MCP_TOOLSETS | No | Expose only some tools, e.g. posts,users. | all |
| X_MCP_READ_ONLY | No | Block all writes. | false |
| X_MCP_HTTP_TOKEN | No | Bearer token for HTTP mode. | |
| X_MCP_MEDIA_ROOTS | No | Directories allowed for uploads. | cwd |
| X_MCP_MAX_IMAGE_MB | No | Maximum image size in MB. | 15 |
| X_MCP_MAX_VIDEO_MB | No | Maximum video size in MB. | 200 |
| X_ACCESS_TOKEN_SECRET | No | OAuth 1.0a access token secret. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
X (Twitter) API v2 tools for AI agents.
TOOLS ARE GROUPED
Ten domain tools (x_posts, x_timelines, x_users, x_engagement, x_lists, x_spaces, x_trends, x_dms, x_media, x_meta) each take an "action" field plus that action's parameters.
Read the tool description for the action list, and the input schema for parameter names. Example: {"action":"search","query":"mcp -is:retweet"} on x_posts.
AUTHENTICATION
Public reads work with an app-only bearer token. Anything that acts as a person (posting, replying, liking, reposting, bookmarking, following, DMs, private timelines) needs a user session.
Check x_meta action "auth_status" first when a call fails with 401/403.
COST AND RATE LIMITS
X bills per post returned, not per request. Prefer batched reads (x_posts "get_many", x_users "get_many") over loops, keep max_results small, and use x_posts "count" when only volume matters.
Responses are normalised to compact objects with URLs and resolved authors. Paging uses next_token from meta.
If a rate-limit bucket is exhausted the server either waits for the reset or returns a 429 with the reset time (x_meta "rate_limits" shows the observed windows).
WORKING WITH IDS
Never invent ids. Resolve handles with x_users action "get", then use the numeric id.
Read a post with x_posts "get"; reconstruct a conversation with x_posts "thread".
PUBLIC ACTIONS
Posting, replying, liking, following and DMs are visible to real people. Confirm intent with the user before performing them, never spam or run bulk engagement, and respect X's automation rules.
Check context before replying with x_posts "thread" or "search".
RESOURCES AND PROMPTS
x://me, x://users/{username}, x://posts/{id}, x://lists/{id}, x://rate-limits and x://usage are available as MCP resources.
Prompts draft_thread, reply_triage, account_report and summarize_conversation encode proven workflows.
MEDIA
Posts carry media URLs, but text alone cannot see them. Call x_media with action "view" and a post id to receive the actual image (or evenly spaced video frames when ffmpeg is installed) as MCP image content.
Use media_index for carousels; for videos without ffmpeg the tool returns the preview frame and the video URL.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
| resources | {
"subscribe": false,
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| x_postsA | 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):
|
| x_timelinesA | Read home and user timelines, mentions, liked posts and your bookmarks. Actions (pass "action" plus that action's parameters):
|
| x_usersA | 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):
|
| x_engagementA | Like, repost and bookmark posts, and undo those actions, as the authenticated account. Actions (pass "action" plus that action's parameters):
|
| x_listsA | 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):
|
| x_spacesA | Search live or scheduled audio Spaces and read the posts shared in them. Actions (pass "action" plus that action's parameters):
|
| x_trendsA | Trending topics by location (WOEID) and personalised trends for the authenticated account. Actions (pass "action" plus that action's parameters):
|
| x_dmsA | 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):
|
| x_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):
|
| x_metaA | Check credentials, observed rate limits and billed API usage. Actions (pass "action" plus that action's parameters):
|
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| draft_thread | Plan a thread on a topic, check it against recent conversation, and publish it as chained posts. |
| reply_triage | Review recent mentions, classify them, and draft replies that add value without spam. |
| account_report | Analyse a public account: profile, recent posts, engagement, and what is working. |
| summarize_conversation | Read a thread and produce a neutral summary with key claims and open questions. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| me | Profile of the account the server is authenticated as. |
| rate-limits | Per-endpoint rate-limit windows observed during this session, plus cache statistics. |
| usage | Post consumption for the current billing period (requires an app-only bearer token). |
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.