twikit-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| TWITTER_COOKIES | Yes | Path to cookies.json file containing ct0 and auth_token from browser cookies after logging into x.com. |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| send_tweetA | Send a tweet. Optionally reply to a tweet by ID. Args: text: Tweet content (max 280 chars). reply_to: Optional tweet ID to reply to. |
| get_tweetA | Fetch a tweet by ID. Args: tweet_id: The tweet ID (numeric string) or full URL. |
| get_tweet_repliesA | Fetch replies (comments) to a tweet (issue #94). Uses X's TweetDetail GraphQL endpoint via vendored twikit's
Args:
tweet_id: The tweet ID (numeric string) or full URL.
cursor: Pagination cursor from a previous response's
Returns: JSON with tweet_id, replies (compact list — id/author/text/ created_at/likes/retweets), next_cursor, count. |
| download_tweet_videoA | Download video(s) attached to a tweet via yt-dlp. Args: tweet_id: Tweet ID (numeric string) or full URL. output_dir: Where to save. Default: $TWIKIT_DOWNLOAD_DIR or ~/Downloads/twikit-mcp/. format: yt-dlp format selector. Default "best[ext=mp4]" (single muxed mp4, no ffmpeg required). Pass "bestvideo+bestaudio" for separate-stream max-quality merge (requires ffmpeg). Returns: JSON with path, size_bytes, duration_sec, format, width, height, url, tweet_id. Raises ToolError if yt-dlp / ffmpeg is missing, the tweet has no video, or download fails. |
| get_timelineB | Fetch home timeline tweets. Args: count: Number of tweets to fetch (default 20). |
| search_tweetsB | Search tweets. Args: query: Search query string. count: Number of results (default 20). product: "Latest" or "Top" (default "Latest"). |
| like_tweetC | Like a tweet by ID. Args: tweet_id: The tweet ID. |
| retweetC | Retweet a tweet by ID. Args: tweet_id: The tweet ID. |
| get_user_tweetsB | Get recent tweets from a specific user. Args: screen_name: Twitter username (without @). count: Number of tweets to fetch (default 20). |
| get_user_infoA | Get a user's profile metadata by screen name OR numeric user ID. Caller must provide exactly one of Args: screen_name: Twitter username (without @). user_id: Twitter numeric user ID. |
| get_user_followersA | Get a user's followers list. Note: X aggressively rate-limits follower / following requests — use
sparingly, paginate via Caller must provide exactly one of Args:
screen_name: Twitter username (without @).
user_id: Twitter numeric user ID.
count: Number of followers to fetch (default 20, max 100).
cursor: Pagination cursor from a previous response's |
| get_user_followingA | Get accounts that a user follows (their following list). Note: X aggressively rate-limits follower / following requests — use
sparingly, paginate via Caller must provide exactly one of Args:
screen_name: Twitter username (without @).
user_id: Twitter numeric user ID.
count: Number to fetch (default 20, max 100).
cursor: Pagination cursor from a previous response's |
| follow_userA | Follow a user by screen name. Note: X aggressively rate-limits follow / unfollow — avoid bulk usage or your account may be temporarily restricted. Args: screen_name: Twitter username (without @). |
| unfollow_userA | Unfollow a user by screen name. Note: X aggressively rate-limits follow / unfollow — avoid bulk usage or your account may be temporarily restricted. Args: screen_name: Twitter username (without @). |
| delete_tweetA | Delete a tweet by ID. Args: tweet_id: The tweet ID to delete. |
| unfavorite_tweetA | Unlike a tweet by ID. Args: tweet_id: The tweet ID to unlike. |
| delete_retweetC | Un-retweet a tweet by ID. Args: tweet_id: The tweet ID to un-retweet. |
| bookmark_tweetB | Bookmark a tweet. Optionally add it to a bookmark folder. Args: tweet_id: The tweet ID to bookmark. folder_id: Optional bookmark folder ID. |
| delete_bookmarkB | Remove a tweet from bookmarks. Args: tweet_id: The tweet ID to un-bookmark. |
| get_bookmarksB | Get bookmarked tweets (paginated). Args:
count: Number of bookmarks to fetch (default 20, max 100).
cursor: Pagination cursor from a previous response's |
| get_favoritersA | Get users who liked a tweet (paginated). Args:
tweet_id: The tweet ID.
count: Number of users to fetch (default 40, max 100).
cursor: Pagination cursor from a previous response's |
| get_retweetersA | Get users who retweeted a tweet (paginated). Args:
tweet_id: The tweet ID.
count: Number of users to fetch (default 40, max 100).
cursor: Pagination cursor from a previous response's |
| search_userA | Search for users by query (paginated). Args:
query: Search query string.
count: Number of users to fetch (default 20, max 100).
cursor: Pagination cursor from a previous response's |
| get_trendsA | Get trending topics by category. Args: category: One of "trending", "for-you", "news", "sports", "entertainment" (default "trending"). count: Number of trends to fetch (default 20). |
| get_article_previewA | Get title/preview/cover of an X Article embedded in a tweet. Uses X's public syndication endpoint — no authentication required. Args: tweet_id: ID (numeric string) or full URL of a tweet that links to an article. |
| get_articleA | Fetch an X Article (long-form post) by rest_id or URL. Two-hop reader flow (issue #10):
Requires authentication via cookies — same as every other authenticated tool here. No env-var setup. Args: article_id: Article rest_id (numeric string) or full /i/article/ URL. format: Output shape, one of: - "preview" (~1 KB) — rest_id, title, preview_text, cover_image - "plain" (~20 KB, default) — above + plain_text + media URL list + lifecycle_state. The LLM-friendly shape. - "full" (~150 KB+) — raw GraphQL payload including the heavy content_state rich-block tree. Use only when you need it (rich-content rendering, archiving, structure analysis). |
| block_userA | Block a user by screen name. Note: X aggressively rate-limits / risk-scans block + mute. Avoid bulk usage or your account may be temporarily restricted. Args: screen_name: Twitter username (without @). |
| unblock_userA | Unblock a user by screen name. Note: X aggressively rate-limits / risk-scans block + mute. Avoid bulk usage or your account may be temporarily restricted. Args: screen_name: Twitter username (without @). |
| mute_userA | Mute a user by screen name. Note: X aggressively rate-limits / risk-scans block + mute. Avoid bulk usage or your account may be temporarily restricted. Args: screen_name: Twitter username (without @). |
| unmute_userA | Unmute a user by screen name. Note: X aggressively rate-limits / risk-scans block + mute. Avoid bulk usage or your account may be temporarily restricted. Args: screen_name: Twitter username (without @). |
| get_notificationsA | Fetch notifications (paginated). Args:
notification_type: One of "All", "Verified", "Mentions" (default "All").
count: Number to fetch (default 40, max 100).
cursor: Pagination cursor from a previous response's |
| send_dmA | Send a direct message to a user by screen name. Note: Sends a PRIVATE message. Do not bulk-call. X has aggressive anti-spam on DMs and may suspend the account. Args: screen_name: Twitter username (without @) to send the DM to. text: Message content (required, must not be empty). media_id: Optional media ID to attach. |
| send_dm_to_groupA | Send a direct message to a group conversation. Note: Sends a PRIVATE message. Do not bulk-call. X has aggressive anti-spam on DMs and may suspend the account. Args: group_id: The group conversation ID. text: Message content (required, must not be empty). media_id: Optional media ID to attach. |
| get_dm_historyA | Get DM conversation history with a user. Note: Retrieves PRIVATE messages. Do not bulk-call. X has aggressive anti-spam on DMs and may suspend the account. Args:
screen_name: Twitter username (without @).
max_id: If specified, retrieves messages older than this ID (for pagination).
Pass the value from a previous response's |
| delete_dmA | Delete a direct message by ID. Note: Deletes a PRIVATE message. Do not bulk-call. X has aggressive anti-spam on DMs and may suspend the account. Args: message_id: The message ID to delete. |
| get_listC | Get a Twitter List by ID. Args: list_id: The list ID. |
| get_listsA | Get the authenticated user's Twitter Lists (paginated). Args:
count: Number of lists to fetch (default 20, max 100).
cursor: Pagination cursor from a previous response's |
| get_list_tweetsA | Get tweets from a Twitter List (paginated). Args:
list_id: The list ID.
count: Number of tweets to fetch (default 20, max 100).
cursor: Pagination cursor from a previous response's |
| get_list_membersA | Get members of a Twitter List (paginated). Args:
list_id: The list ID.
count: Number of members to fetch (default 20, max 100).
cursor: Pagination cursor from a previous response's |
| get_list_subscribersA | Get subscribers of a Twitter List (paginated). Args:
list_id: The list ID.
count: Number of subscribers to fetch (default 20, max 100).
cursor: Pagination cursor from a previous response's |
| create_listA | Create a new Twitter List. Args: name: The name for the new list (required, must not be empty). description: Description for the list (default empty). is_private: If True, the list is private (default False = public). |
| edit_listA | Edit a Twitter List's metadata. At least one of Args: list_id: The list ID (required). name: New name for the list. description: New description (empty string clears it). is_private: True to make private, False to make public. |
| add_list_memberA | Add a user to a Twitter List. Caller must provide exactly one of Args: list_id: The list ID (required). screen_name: Twitter username (without @). user_id: Twitter numeric user ID. |
| remove_list_memberB | Remove a user from a Twitter List. Caller must provide exactly one of Args: list_id: The list ID (required). screen_name: Twitter username (without @). user_id: Twitter numeric user ID. |
| create_scheduled_tweetA | Schedule a tweet to be posted at a future Unix timestamp. Scheduled tweets follow X's standard rate limits, no special caveats needed. Args: scheduled_at: Unix epoch seconds when the tweet should be posted (must be in the future). text: Tweet text. At least one of text or media_ids must be provided. media_ids: List of media IDs to attach to the scheduled tweet. |
| get_scheduled_tweetsA | Return all scheduled tweets for the authenticated user. Note: returns the FULL list in one call — twikit's API does not paginate scheduled tweets. This is fine in practice since X caps scheduled tweets per account at a small number. Scheduled tweets follow X's standard rate limits, no special caveats needed. |
| delete_scheduled_tweetA | Delete a scheduled tweet by its scheduled tweet ID. Scheduled tweets follow X's standard rate limits, no special caveats needed. Args: scheduled_tweet_id: The ID of the scheduled tweet (from create_scheduled_tweet or get_scheduled_tweets). This is NOT a regular tweet ID. |
| create_pollA | Create an X poll and return its card URI. X polls have 2-4 choices and a duration in minutes. Pass the returned card_uri to send_tweet's poll_uri parameter to attach the poll. Args: choices: Poll choices (2-4 entries required; each must be non-empty). duration_minutes: Poll duration in minutes (must be > 0). |
| voteA | Vote on an X poll. X polls have 2-4 choices and a duration in minutes. The card_uri and card_name come from the tweet's poll card metadata (obtainable via get_tweet). Args: selected_choice: The label of the choice to vote for (must be non-empty). card_uri: The poll card URI (from the tweet's poll card metadata). tweet_id: The ID of the tweet containing the poll. card_name: The name of the poll card (from the tweet's poll card metadata). |
| get_communityB | Get a Twitter Community by ID. Args: community_id: The community ID. |
| search_communityB | Search for Twitter Communities by query (paginated). Note: twikit's search_community does not support a count parameter. Args:
query: Search query string.
cursor: Pagination cursor from a previous response's |
| get_community_tweetsA | Get tweets from a Twitter Community (paginated). Args:
community_id: The community ID.
tweet_type: One of "Top", "Latest", or "Media".
count: Number of tweets to fetch (default 40, max 100).
cursor: Pagination cursor from a previous response's |
| get_communities_timelineA | Get tweets from communities the authenticated user has joined (paginated). Args:
count: Number of tweets to fetch (default 20, max 100).
cursor: Pagination cursor from a previous response's |
| get_community_membersA | Get members of a Twitter Community (paginated). Args:
community_id: The community ID.
count: Number of members to fetch (default 20, max 100).
cursor: Pagination cursor from a previous response's |
| get_community_moderatorsA | Get moderators of a Twitter Community (paginated). Args:
community_id: The community ID.
count: Number of moderators to fetch (default 20, max 100).
cursor: Pagination cursor from a previous response's |
| search_community_tweetA | Search tweets within a Twitter Community (paginated). Args:
community_id: The community ID.
query: Search query string.
count: Number of tweets to fetch (default 20, max 100).
cursor: Pagination cursor from a previous response's |
| join_communityC | Join a Twitter Community. Args: community_id: The community ID to join. |
| leave_communityC | Leave a Twitter Community. Args: community_id: The community ID to leave. |
| request_to_join_communityA | Request to join a Twitter Community. For communities with restricted join policies that require moderator
approval, an Args: community_id: The community ID to request to join. answer: Optional answer to the join request question (required for some communities with moderator approval policy). |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tangivis/twitter-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server