Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
X_API_KEYNoOAuth 1.0a API key.
X_API_SECRETNoOAuth 1.0a API secret.
X_MCP_FFMPEGNoPath to the ffmpeg executable for video frame sampling.
X_MCP_DRY_RUNNoPreview writes without sending.false
X_ACCESS_TOKENNoOAuth 1.0a access token.
X_BEARER_TOKENNoApp-only token for public reads.
X_MCP_TOOLSETSNoExpose only some tools, e.g. posts,users.all
X_MCP_READ_ONLYNoBlock all writes.false
X_MCP_HTTP_TOKENNoBearer token for HTTP mode.
X_MCP_MEDIA_ROOTSNoDirectories allowed for uploads.cwd
X_MCP_MAX_IMAGE_MBNoMaximum image size in MB.15
X_MCP_MAX_VIDEO_MBNoMaximum video size in MB.200
X_ACCESS_TOKEN_SECRETNoOAuth 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

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": true
}
resources
{
  "subscribe": false,
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
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):

  • 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]

x_timelinesA

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).

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):

  • 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).

x_engagementA

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]

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):

  • 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]

x_spacesA

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]

x_trendsA

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).

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):

  • 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]

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):

  • 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.

x_metaA

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.

Prompts

Interactive templates invoked by user choice

NameDescription
draft_threadPlan a thread on a topic, check it against recent conversation, and publish it as chained posts.
reply_triageReview recent mentions, classify them, and draft replies that add value without spam.
account_reportAnalyse a public account: profile, recent posts, engagement, and what is working.
summarize_conversationRead a thread and produce a neutral summary with key claims and open questions.

Resources

Contextual data attached and managed by the client

NameDescription
meProfile of the account the server is authenticated as.
rate-limitsPer-endpoint rate-limit windows observed during this session, plus cache statistics.
usagePost consumption for the current billing period (requires an app-only bearer token).

TDQS

A4.2/5.0

Scored across 10 tools

Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness5/5

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

ActivityNo data
ResponsivenessOutdated data