Skip to main content
Glama
twittrapi-mcp

twittrapi-mcp

Official

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
RAPIDAPI_KEYNoRapidAPI key. Used only when TWITTRAPI_API_KEY is not set.
RAPIDAPI_HOSTNoHost of your RapidAPI listing.twitter-aio.p.rapidapi.com
TWITTRAPI_API_KEYNoYour TwittrAPI key. Sent as the X-API-KEY header.
TWITTRAPI_X_PROXYNoYour proxy for the account tools, http://user:pass@host:port.
TWITTRAPI_BASE_URLNoAPI base URL for the direct API.https://api.twittrapi.com
TWITTRAPI_X_COOKIENoCookie of your own logged-in x.com session. Turns on the account tools together with TWITTRAPI_X_PROXY.
TWITTRAPI_RESPONSE_FORMATNosimple (default) or raw. See Response format.simple
TWITTRAPI_X_CHAT_PASSCODENoYour X Chat passcode. Adds send_dm, accept_dm_request, decline_dm_request and message text in list_dm_conversations.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Tools for reading public X (Twitter) data through TwittrAPI. Responses use the compact simple format by default: {"data": ...} with flat camelCase tweets and users (id, text, createdAt, author, counts, media, ...). Pass format "raw" to a tool only if you need fields it leaves out (cards, polls, edit history, community notes). Output is cut at max_chars (default 50000). Most user tools accept userId or username; resolve a handle once with username_to_id and reuse the ID. Paginated tools print next_cursor at the top of the result; pass it back as cursor for the next page. Tools without a format argument always return raw JSON. A 402 error means the account has no balance: stop and tell the user. Every call is billed.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_user_by_usernameA

Get an X (Twitter) user's profile by handle: name, bio, follower/following counts, verification, created date, and the numeric user ID (rest_id) needed by other tools.

get_user_by_idA

Get an X user's profile by numeric user ID (rest_id). Same data as get_user_by_username.

username_to_idA

Resolve an X handle to its numeric user ID. Cheaper and smaller than get_user_by_username when you only need the ID.

users_by_idsA

Get profiles for up to 500 X users in one call, by numeric user ID.

get_user_tweetsA

Get a user's recent tweets (their profile timeline, without replies), newest first, including retweets and pinned tweet. Paginated.

get_user_tweets_and_repliesB

Get a user's tweets including their replies to others, newest first. Paginated.

get_user_mediaA

Get a user's tweets that contain photos or videos. Paginated.

get_followersA

Get accounts that follow a user, newest followers first. Paginated.

get_followingC

Get accounts a user follows. Paginated.

get_verified_followersB

Get a user's followers that have a verified (blue check) badge. Paginated.

get_user_affiliatesB

Get the accounts affiliated with an organization, as in the Affiliates tab of its profile. Empty for accounts without affiliates. Paginated.

get_friendships_batchA

Check whether one account follows up to 50 others, and whether they follow it back, in one call. Returns raw JSON: one relationship per target, in order, plus errors for handles that could not be looked up.

get_user_about_batchA

Get the "About this account" data (country the account is based in, username changes, verification) of up to 20 accounts in one call. Returns raw JSON: one entry per handle, in order, plus errors for handles that could not be looked up.

search_tweetsA

Search X like the search box. Supports X search operators in the query, e.g. from:user, to:user, "exact phrase", lang:en, since:2025-01-01, until:2025-02-01, min_faves:100, filter:media, -filter:replies. category Latest gives newest first; People returns accounts instead of tweets. Paginated.

get_tweetA

Get a tweet by ID with full text, author, media, engagement counts and the reply thread (conversation). Use cursor to load more replies.

tweets_by_idsA

Get up to 100 tweets in one call by numeric tweet ID, billed as one call. Results keep the request order; tweets that were deleted or never existed are left out (raw format: an empty {} in their place).

get_tweet_retweetsB

Get the users who retweeted a tweet. Paginated.

get_tweet_quotesA

Get tweets that quote a given tweet. Paginated.

get_tweet_repliesA

Get only the replies to a tweet, without the tweet itself or the tweets above it. Paginated.

get_tweet_threadA

Get the author's own thread around a tweet in reading order: their tweets above it and their replies to themselves below it, up to the first reply by someone else.

get_list_detailsA

Get an X list's name, description, owner, and member/follower counts.

get_list_tweetsA

Get the tweet timeline of an X list (tweets from its members), newest first. Paginated.

get_list_membersB

Get the accounts that are members of an X list. Paginated.

get_communityB

Get an X Community's name, description, rules, member count and admins.

get_community_aboutA

Get the About page of an X Community: description, rules, creation date, moderators and a preview of members. Returns raw JSON.

get_community_tweetsB

Get tweets posted in an X Community. Paginated.

search_communitiesA

Search X Communities by keyword. Returns community IDs for get_community and get_community_tweets. Paginated.

get_trendsA

Get trending topics for a location by WOEID (1 = worldwide, 23424977 = United States, 23424975 = United Kingdom). Use get_trend_locations to look up other WOEIDs.

get_trend_locationsA

List the locations (countries and cities) that have trends, with their WOEIDs for get_trends.

get_spaceA

Get an X Space by ID: title, state, host and participants, and whether a replay is available. Returns raw JSON.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

B3.4/5.0

Scored across 30 tools

Disambiguation4/5

Most tools map to distinct resources or actions, and the descriptions make differences clear. There is some overlap between get_user_by_id/get_user_by_username/username_to_id and between get_community/get_community_about, but the intended use cases are mostly distinguishable.

Naming Consistency4/5

The set is predominantly consistent snake_case with predictable verb_noun naming such as get_user_tweets and search_tweets. Minor deviations like username_to_id, users_by_ids, and tweets_by_ids are still readable and do not seriously undermine consistency.

Tool Count2/5

Thirty tools is heavy for a single MCP surface, even for a broad Twitter/X data domain. Several batch, raw-JSON, and specialized variants could likely be consolidated or made optional to reduce cognitive load.

Completeness4/5

The server covers a strong read-only slice of the X API: users, tweets, social graph, lists, communities, trends, and Spaces. Some adjacent read endpoints such as likes, bookmarks, and broader list/Space detail are missing, but core workflows are covered.

Maintenance

ActivityActive
ResponsivenessNo recent community issues