twikit-mcp

v0.1.45
twikit-mcp Checked 5 days ago Published 3 months ago

Twitter/X MCP server powered by twikit — no API key needed, free forever

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

send_tweet

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.

ParameterTypeDescription
text *string
reply_to

get_tweet

Fetch a tweet by ID. Args: tweet_id: The tweet ID (numeric string) or full URL.

ParameterTypeDescription
tweet_id *

get_tweet_replies

Fetch replies (comments) to a tweet (issue #94). Uses X's TweetDetail GraphQL endpoint via vendored twikit's `Client.get_tweet_by_id`, which populates `tweet.replies` as a paginated `Result[Tweet]`. One page per call; pass the returned `next_cursor` to fetch more. Args: tweet_id: The tweet ID (numeric string) or full URL. cursor: Pagination cursor from a previous response's `next_cursor`; omit for the first page. Returns: JSON with tweet_id, replies (compact list — id/author/text/ created_at/likes/retweets), next_cursor,…

ParameterTypeDescription
tweet_id *
cursor

download_tweet_video

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-…

ParameterTypeDescription
tweet_id *
formatstring
output_dir

get_timeline

Fetch home timeline tweets. Args: count: Number of tweets to fetch (default 20).

ParameterTypeDescription
countinteger

search_tweets

Search tweets. Args: query: Search query string. count: Number of results (default 20). product: "Latest" or "Top" (default "Latest").

ParameterTypeDescription
query *string
countinteger
productstring

like_tweet

Like a tweet by ID. Args: tweet_id: The tweet ID.

ParameterTypeDescription
tweet_id *

retweet

Retweet a tweet by ID. Args: tweet_id: The tweet ID.

ParameterTypeDescription
tweet_id *

get_user_tweets

Get recent tweets from a specific user. Args: screen_name: Twitter username (without @). count: Number of tweets to fetch (default 20).

ParameterTypeDescription
screen_name *string
countinteger

get_user_info

Get a user's profile metadata by screen name OR numeric user ID. Caller must provide exactly one of `screen_name` / `user_id`. Args: screen_name: Twitter username (without @). user_id: Twitter numeric user ID.

ParameterTypeDescription
screen_name
user_id

get_user_followers

Get a user's followers list. Note: X aggressively rate-limits follower / following requests — use sparingly, paginate via `cursor`, don't loop without backoff. Caller must provide exactly one of `screen_name` / `user_id`. 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 `next_cursor`.

ParameterTypeDescription
countinteger
cursor
screen_name
user_id

get_user_following

Get accounts that a user follows (their following list). Note: X aggressively rate-limits follower / following requests — use sparingly, paginate via `cursor`, don't loop without backoff. Caller must provide exactly one of `screen_name` / `user_id`. 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 `next_cursor`.

ParameterTypeDescription
countinteger
cursor
screen_name
user_id

follow_user

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

ParameterTypeDescription
screen_name *string

unfollow_user

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

ParameterTypeDescription
screen_name *string

delete_tweet

Delete a tweet by ID. Args: tweet_id: The tweet ID to delete.

ParameterTypeDescription
tweet_id *

unfavorite_tweet

Unlike a tweet by ID. Args: tweet_id: The tweet ID to unlike.

ParameterTypeDescription
tweet_id *

delete_retweet

Un-retweet a tweet by ID. Args: tweet_id: The tweet ID to un-retweet.

ParameterTypeDescription
tweet_id *

bookmark_tweet

Bookmark a tweet. Optionally add it to a bookmark folder. Args: tweet_id: The tweet ID to bookmark. folder_id: Optional bookmark folder ID.

ParameterTypeDescription
tweet_id *
folder_id

delete_bookmark

Remove a tweet from bookmarks. Args: tweet_id: The tweet ID to un-bookmark.

ParameterTypeDescription
tweet_id *

get_bookmarks

Get bookmarked tweets (paginated). Args: count: Number of bookmarks to fetch (default 20, max 100). cursor: Pagination cursor from a previous response's `next_cursor`.

ParameterTypeDescription
countinteger
cursor

get_favoriters

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 `next_cursor`.

ParameterTypeDescription
tweet_id *
countinteger
cursor

get_retweeters

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 `next_cursor`.

ParameterTypeDescription
tweet_id *
countinteger
cursor

search_user

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 `next_cursor`.

ParameterTypeDescription
query *string
countinteger
cursor

get_article_preview

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.

ParameterTypeDescription
tweet_id *

get_article

Fetch an X Article (long-form post) by rest_id or URL. Two-hop reader flow (issue #10): 1. `ArticleRedirectScreenQuery` resolves the article rest_id to the underlying tweet rest_id. 2. `TweetResultByRestId` (twikit's existing helper) fetches the tweet with article fieldToggles enabled. The body lives at `tweet.article.article_results.result`. 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/<id> URL.…

ParameterTypeDescription
article_id *
formatstring

block_user

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

ParameterTypeDescription
screen_name *string

unblock_user

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

ParameterTypeDescription
screen_name *string

mute_user

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

ParameterTypeDescription
screen_name *string

unmute_user

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

ParameterTypeDescription
screen_name *string

get_notifications

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 `next_cursor`.

ParameterTypeDescription
countinteger
cursor
notification_typestring

send_dm

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.

ParameterTypeDescription
screen_name *string
text *string
media_id

send_dm_to_group

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.

ParameterTypeDescription
group_id *
text *string
media_id

get_dm_history

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. Returns JSON with `messages` (id/text/sender_id/recipient_id/time), `next_cursor` for pagination via `max_id`, and when present: `timeline_events` (non-message entries such as `trust_conversation`) and `warnings` (e.g. incomplete history for end-to-end encrypted / X Chat conversations — legacy DM history does not return ciphertext bodies after upgrade). Args: screen_name: Twitter username (wi…

ParameterTypeDescription
screen_name *string
max_id

delete_dm

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.

ParameterTypeDescription
message_id *

get_list

Get a Twitter List by ID. Args: list_id: The list ID.

ParameterTypeDescription
list_id *

get_lists

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 `next_cursor`.

ParameterTypeDescription
countinteger
cursor

get_list_tweets

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 `next_cursor`.

ParameterTypeDescription
list_id *
countinteger
cursor

get_list_members

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 `next_cursor`.

ParameterTypeDescription
list_id *
countinteger
cursor

get_list_subscribers

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 `next_cursor`.

ParameterTypeDescription
list_id *
countinteger
cursor

create_list

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

ParameterTypeDescription
name *string
descriptionstring
is_privateboolean

edit_list

Edit a Twitter List's metadata. At least one of `name`, `description`, or `is_private` must be provided. Pass an empty string for `description` to clear it. 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.

ParameterTypeDescription
list_id *
description
is_private
name

add_list_member

Add a user to a Twitter List. Caller must provide exactly one of `screen_name` / `user_id`. Args: list_id: The list ID (required). screen_name: Twitter username (without @). user_id: Twitter numeric user ID.

ParameterTypeDescription
list_id *
screen_name
user_id

remove_list_member

Remove a user from a Twitter List. Caller must provide exactly one of `screen_name` / `user_id`. Args: list_id: The list ID (required). screen_name: Twitter username (without @). user_id: Twitter numeric user ID.

ParameterTypeDescription
list_id *
screen_name
user_id

create_scheduled_tweet

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.

ParameterTypeDescription
scheduled_at *integer
media_ids
textstring

get_scheduled_tweets

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_tweet

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.

ParameterTypeDescription
scheduled_tweet_id *

create_poll

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

ParameterTypeDescription
choices *array
duration_minutes *integer

vote

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

ParameterTypeDescription
card_name *string
card_uri *string
selected_choice *string
tweet_id *

get_community

Get a Twitter Community by ID. Args: community_id: The community ID.

ParameterTypeDescription
community_id *

search_community

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 `next_cursor`.

ParameterTypeDescription
query *string
cursor

get_community_tweets

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 `next_cursor`.

ParameterTypeDescription
community_id *
tweet_type *string
countinteger
cursor

get_communities_timeline

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 `next_cursor`.

ParameterTypeDescription
countinteger
cursor

get_community_members

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 `next_cursor`.

ParameterTypeDescription
community_id *
countinteger
cursor

get_community_moderators

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 `next_cursor`.

ParameterTypeDescription
community_id *
countinteger
cursor

search_community_tweet

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 `next_cursor`.

ParameterTypeDescription
community_id *
query *string
countinteger
cursor

join_community

Join a Twitter Community. Args: community_id: The community ID to join.

ParameterTypeDescription
community_id *

leave_community

Leave a Twitter Community. Args: community_id: The community ID to leave.

ParameterTypeDescription
community_id *

request_to_join_community

Request to join a Twitter Community. For communities with restricted join policies that require moderator approval, an `answer` to the join request question may be required. 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).

ParameterTypeDescription
community_id *
answer

xchat_status

Check whether XChat (encrypted DMs) can be read on this machine. Reads X's locally decrypted store — the browser did the decryption; this only opens the resulting SQLite file read-only. Nothing is sent, marked read, or modified. Returns JSON with `state`, and when a store is readable: `database_path`, `conversation_count`, `last_updated`. When no store is configured, returns `discovery` listing the XChat databases found in local browser profiles so you can pick one. Configure with `XCHAT_BROWSER` (auto/chrome/chromium/edge/brave/aside), `XCHAT_BROWSER_P…

xchat_list_conversations

List XChat (encrypted DM) conversations, newest activity first. Note: returns PRIVATE message previews from your own machine. Returns JSON `conversations`: `conversation_id`, `name`, `screen_name`, `preview` (latest message text; `[image attachment]`-style placeholder when the message carried no text), `timestamp`, `unread`. Args: limit: Max conversations to return (1-500, default 50). unread_only: Only conversations with unread messages.

ParameterTypeDescription
limitinteger
unread_onlyboolean

xchat_get_history

Read messages from one XChat (encrypted DM) conversation. Note: returns PRIVATE decrypted message text from your own machine. Reading here does NOT mark the conversation read on X. Returns JSON `messages` oldest-first: `text`, `timestamp`, `direction` (incoming/outgoing), `sender_screen_name`, `sequence_number`, `has_attachment`. Args: conversation_id: From xchat_list_conversations. limit: Max messages, most recent kept (1-500, default 50).

ParameterTypeDescription
conversation_id *string
limitinteger