Skip to main content
Glama

Spectre is an MCP server that gives AI agents 100+ tools for X/Twitter — from search and posting to DMs, lists, and communities. Under the hood, it talks directly to X's internal GraphQL and REST APIs. No browser to spin up, no Puppeteer to maintain, no DOM scraping that breaks on UI changes.

Spectre

XActions

twikit

Architecture

Direct GraphQL/REST

Puppeteer (headless browser)

Python API wrapper

Speed

<1s per request

3–10s (browser startup)

~1s per request

Memory

~10 MB

~200 MB+ (Chromium)

~10 MB

MCP Server

✓ 100+ tools

~50 API tools

✗ None

Account Pool

✓ Multi-account rotation

✗ Single auth_token

✗ Single session

Browser Required

✗ Never

✓ Always

✗ Never

DOM Breakage Risk

✗ None

~ breaks on UI changes

✗ None

Pagination

✓ Cursors on list endpoints

✗

partial

Media Upload

✓ Cookie-based (no API keys)

~ requires API keys

✗

Lists

✓ Full CRUD + members + subscribe

✗

✗

Drafts & Scheduled

✓ Full CRUD

~ Basic

✗

Bookmark Folders

✓ Full CRUD + timeline

✗

✗

DM Search

✓ All / groups / people

✗

✗

Quote Tweets

✓ Full timeline

✗

✗

Community Notes

✓ Read + rate

✗

✗

Highlights

✓ Create, delete, get

✗

✗

Notifications

✓ Full timeline

✗

✗

Language

Python

JavaScript

Python

Every tool returns the same clean JSON shapes, and failures carry a kind (auth, rate_limit, permission, validation, not_found, upstream) so your agent knows whether to retry, switch accounts, or stop.


1. Install

pipx install spectre-mcp    # or: uv tool install spectre-mcp

2. Add Your X Account

Extract cookies from your browser:

  1. Open x.com and make sure you're logged in

  2. Open DevTools (F12 or Ctrl+Shift+I)

  3. Go to Storage → Cookies → select https://x.com

  4. Find and copy these two values:

    • auth_token — long hex string (e.g. a1b2c3d4...)

    • ct0 — 160-character hex string

spectre add myaccount "auth_token=a1b2c3d4...; ct0=e5f6a7b8..."

Spectre checks the cookies with X before saving them, so a bad copy fails immediately instead of at the first empty search.

Tip: ct0 is exactly 160 hex characters. Double-check you copied the full value.

Handy commands:

spectre list      # accounts and their state
spectre status    # pool health
spectre doctor    # auth + connectivity check

3. Configure Your MCP Client

Add to your MCP client config (claude_desktop_config.json, .cursor/mcp.json, opencode.json, or equivalent):

{
  "mcpServers": {
    "spectre": {
      "command": "uvx",
      "args": ["spectre-mcp"]
    }
  }
}

For client-specific setup (Claude, Cursor, OpenCode, OMP, DeepSeek Harness, Python), see Integrations.

No uv? Install it: curl -LsSf https://astral.sh/uv/install.sh | sh Or use python3 -m spectre.server to run from a local clone.


What You Get

Area

Tools

What they cover

Search

search, search_users

full operator syntax: from:, since:, filter:media, min_faves:, lang:

Profiles

get_user, get_user_by_id, get_users_by_ids, get_user_tweets, get_followers, get_following

timelines, media, up to 5,000 followers/following, verified followers, mutuals, likes, highlights

Posts

get_tweet, get_tweets, get_thread, get_tweet_quotes, get_tweet_replies

batch fetch, quote timelines, retweeters, favoriters, edit history, similar posts, community notes

Compose

post_tweet, upload_media, download_media, schedule_tweet, create_draft

text, replies, quotes, media, scheduling, drafts

Engagement

like_tweet, retweet, bookmark_tweet, pin_tweet, pin_reply

each one has its undo

Social

follow_user, unfollow_user, mute_user, block_user, remove_follower

plus muted and blocked lists

DMs

send_dm, get_dm_inbox, get_dm_conversation, search_dm

search across all / groups / people, muted threads, DM block

Lists

create_list, update_list, add_list_member, get_list_timeline, subscribe_list

members, subscribers, memberships, ownerships

Communities

get_community_info, get_community_tweets, join_community, leave_community

info, posts, join, leave

Topics & trends

get_topic_info, follow_topic, get_trends, get_trend_locations

topics, trends by location, woeid lookup

Bookmarks

get_bookmarks, search_bookmarks, get_bookmark_folders, get_bookmark_folder_timeline

list, search, folders, folder timeline

Account

get_me, get_account_settings, update_profile, get_rate_limits

settings, profile edits, avatar, banner, pool management

Full list with arguments and gotchas: docs/tools.md.


  • All tools — every tool, grouped by feature

  • Integrations — Claude, Cursor, OpenCode, OMP, DeepSeek Harness, Python

  • Safety — what to confirm before writing, and rate limits

  • Reference — X query operators, CLI, env vars, output shapes, limitations

  • Changelog — what changed between versions


Related MCP server: TwitterAPI.io MCP Server

License

MIT

Available Tools

113 tools
add_list_memberC

Add an account to a list.

Inputs: list_id (required), user_id (required). Returns: result

add_tweet_to_folderC

Put a bookmarked post into a folder.

Inputs: tweet_id (required), folder_id (required). Returns: result

block_userB

Block an account. They lose access to you; this is visible to them.

Inputs: user_id (required). Returns: result

bookmark_tweetA

Save a post to your bookmarks. Private, reversible.

Inputs: tweet_id (required). Returns: result

clear_all_bookmarksA

Delete every bookmark. Irreversible — confirm first.

Inputs: no named parameters. Returns: result

create_bookmark_folderB

Create a bookmark folder (Premium-gated by X).

Inputs: name (required). Returns: result

create_draftB

Save a draft (never publishes by itself).

Inputs: text (required). Returns: result

create_highlightA

Add posts to your profile's Highlights section (comma-separated ids).

Highlights are public. X limits the feature to eligible accounts and answers kind: permission for the rest.

Inputs: tweet_ids (required). Returns: result

create_listC

Create a list. Returns the list_id you need for members and timelines.

Inputs: name (required), private, description. Returns: result

delete_bookmark_folderA

Delete a bookmark folder. The bookmarks inside are not deleted.

Inputs: folder_id (required). Returns: result

delete_draftB

Delete a saved draft.

Inputs: draft_id (required). Returns: result

delete_highlightC

Remove a post from your profile's Highlights section.

Inputs: tweet_id (required). Returns: result

delete_listB

Delete a list permanently. Members are not affected.

Inputs: list_id (required). Returns: result

delete_profile_bannerB

Remove the banner image.

Inputs: no named parameters. Returns: result

delete_scheduled_tweetC

Cancel a queued post.

Inputs: scheduled_id (required). Returns: result

delete_tweetA

Delete one of your posts. Permanent — confirm first.

Inputs: tweet_id (required). Returns: result

dm_block_userA

Block a user from sending you DMs (does not block them globally).

Inputs: user_id (required). Returns: result

dm_unblock_userC

Allow a user to DM you again.

Inputs: user_id (required). Returns: result

download_mediaB

Download a post's media (or a single media URL) to disk.

Pass a tweet id/URL to get everything attached, or a direct pbs/video URL. Returns the saved paths so you can open or analyse them.

Inputs: source (required), dest_dir. Returns: result

edit_bookmark_folderC

Rename a bookmark folder (Premium-gated by X).

Inputs: name (required), folder_id (required). Returns: result

edit_draftC

Rewrite a saved draft.

Inputs: text (required), draft_id (required). Returns: result

edit_scheduled_tweetC

Change the text or time of a queued post.

Inputs: text (required), execute_at (required), scheduled_id (required). Returns: result

follow_topicC

Follow a topic (X's curated interest feeds).

Inputs: topic_id (required). Returns: result

follow_userB

Follow an account. Takes a numeric user id — resolve handles with get_user first.

Inputs: user_id (required). Returns: result

get_account_settingsA

The authenticated account as X sees it, plus a stale-handle warning.

X removed the REST settings endpoint, so language/timezone are no longer exposed; everything here comes from GraphQL Viewer.

Inputs: no named parameters. Returns: result

get_blocked_accountsC

Accounts you have blocked.

Inputs: limit. Returns: result

get_bookmark_foldersA

List your bookmark folders.

X gates bookmark folders behind Premium.

Inputs: no named parameters. Returns: result

get_bookmark_folder_timelineC

Posts inside one bookmark folder.

Inputs: folder_id (required), limit. Returns: result

get_bookmarksB

Your bookmarked posts, newest first. Paginate with next_cursor.

Inputs: limit, cursor. Returns: result

get_community_infoC

Community name, description, member count and join policy.

Inputs: community_id (required). Returns: result

get_community_notesC

Community Notes attached to a post.

Inputs: tweet_id (required). Returns: result

get_community_tweetsC

Posts inside a community.

Inputs: community_id (required), limit. Returns: result

get_dm_conversationA

Every message in one DM thread, oldest first.

Includes both directions and the participants' profiles. If a reply the user can see on x.com is missing here, X is not serving it to the cookie session — report that instead of assuming it does not exist.

Inputs: conversation_id (required), limit. Returns: result

get_dm_inboxA

Recent DM conversations and their latest messages.

Returns both messages (flat, newest first) and conversations (threads with participants). Use a conversation_id from here with get_dm_conversation.

Inputs: limit. Returns: result

get_dm_mutedD

Muted DM conversations.

Inputs: limit. Returns: result

get_draftsC

Your saved drafts.

Inputs: no named parameters. Returns: result

get_favoritersB

Accounts that liked a post.

Can be empty on very large accounts: X limits who is listable.

Inputs: tweet_id (required), limit. Returns: result

get_followersA

A user's followers, with a real limit.

limit is honoured exactly (the old 100 cap is gone) up to 5000; long walks stop at a time budget and set truncated: true. total_available is the account's follower count so you can see how far you got.

Inputs: username (required), limit. Returns: result

get_followers_you_knowB

Mutual followers between you and another account.

Best first move before cold outreach: the overlap is the warm-intro list.

Inputs: user_id (required), limit. Returns: result

get_followingA

Accounts a user follows, with a real limit (up to 5000).

Same truncation contract as get_followers: truncated tells you the walk stopped early, total_available is the profile's following count.

Inputs: username (required), limit. Returns: result

get_home_timelineA

The authenticated account's "For You" feed, with authors resolved.

Use for ambient awareness rather than targeted research. For the reverse chronological feed use search("filter:follows").

Inputs: limit. Returns: result

get_list_infoC

Name, description, member/subscriber counts and owner of a list.

Inputs: list_id (required). Returns: result

get_list_membersD

Members of a list.

Inputs: list_id (required), limit. Returns: result

get_list_membershipsC

Lists a user belongs to — a fast map of someone's information diet.

Inputs: user_id (required), limit. Returns: result

get_list_ownershipsC

Lists a user created.

Inputs: user_id (required), limit. Returns: result

get_list_subscribersD

Accounts subscribed to a list.

Inputs: list_id (required), limit. Returns: result

get_list_timelineC

Posts from the members of a list (the main reason to build lists).

Inputs: list_id (required), limit. Returns: result

get_meA

Identify the account this server is actually authenticated as.

Call this first in any session. Returns the live handle, id, bio and counts straight from X — not from the local pool — plus whether the stored pool handle has gone stale (accounts get renamed; a stale handle makes every profile lookup on it return "not found").

Inputs: no named parameters. Returns: result

get_muted_accountsC

Accounts you have muted.

Inputs: limit. Returns: result

get_notificationsB

Notifications timeline: likes, follows, replies, mentions, reposts.

Use it to find what needs a response; each item carries the type plus the user/tweet involved. Paginate with next_cursor.

Inputs: limit, cursor. Returns: result

get_rate_limitsA

Per-account rate-limit state: locks, last use, last X rate-limit headers.

Call before a bulk job to decide how many accounts can absorb it, and after a kind: rate_limit error to see when the window resets.

Inputs: no named parameters. Returns: result

get_retweetersC

Accounts that retweeted a post.

Inputs: tweet_id (required), limit. Returns: result

get_scheduled_tweetsB

Everything currently queued, with execute_at in ISO-8601 and state.

Inputs: no named parameters. Returns: result

get_similar_postsB

Posts X considers related to a given post.

Premium-gated upstream: on non-Premium accounts this returns an empty list with a note, not an error.

Inputs: tweet_id (required), limit. Returns: result

get_threadB

The conversation a post belongs to, oldest first.

Pass any id in the thread. Includes the focal post, its ancestors and the replies X returns for that conversation.

Inputs: tweet_id (required), limit. Returns: result

get_topic_infoC

Details and follow state of a topic.

Inputs: topic_id (required). Returns: result

get_trend_locationsA

Places you can request trends for, with their woeids.

Inputs: no named parameters. Returns: result

get_tweetA

One post with full text, metrics, media URLs and author.

Long-form posts are returned in full (the note_tweet body), not truncated at 280 characters. Use get_tweets() to batch several ids.

Inputs: tweet_id (required). Returns: result

get_tweet_edit_historyA

Edit history of a post (ids of every version).

Only populated for posts that were actually edited.

Inputs: tweet_id (required). Returns: result

get_tweet_quotesB

Posts that quote a given post.

Quotes are where the commentary lives — more useful than replies for judging reaction. Paginate with next_cursor.

Inputs: tweet_id (required), limit, cursor. Returns: result

get_tweet_repliesA

Direct replies to a post.

Use get_thread() instead when you need the whole conversation including the parent chain.

Inputs: tweet_id (required), limit. Returns: result

get_tweetsA

Fetch several posts by id in one call (comma-separated).

Cheaper than looping get_tweet. Missing ids are reported in missing instead of failing the whole batch.

Inputs: tweet_ids (required). Returns: result

get_userA

Full profile for one handle (without the @).

Returns the numeric id you need for follow/block/DM/like-style tools. Also the right call to check whether an account still exists before acting on it.

Inputs: username (required). Returns: result

get_user_by_idA

Resolve a numeric user id to a profile.

Use when an id arrives from a DM, list membership or a tweet's author_id and you need the handle. Cheaper and more reliable than guessing a handle.

Inputs: user_id (required). Returns: result

get_user_highlightsC

Posts a user pinned to their profile Highlights section.

Highlights are curated, so this is the closest thing to "what they want to be known for".

Inputs: user_id (required), limit. Returns: result

get_user_likesB

Posts a user liked.

Usually empty: X hides likes for most accounts.

Inputs: user_id (required), limit. Returns: result

get_user_mediaB

Photos, videos and GIFs a user posted, with direct media URLs.

Use before download_media() when you need the files, or for visual research.

Inputs: username (required), limit. Returns: result

get_users_by_idsA

Resolve many user ids at once (comma-separated).

One call per id internally, so keep it to a handful; missing ids come back in missing rather than failing the batch.

Inputs: user_ids (required). Returns: result

get_user_tweetsA

A user's own posts, newest first (no replies).

X caps how far back this reaches (~3,200 posts). For older material use search("from: since:...").

Inputs: username (required), limit. Returns: result

get_user_tweets_and_repliesB

A user's posts including their replies.

Use to see who someone talks to and how — good for tone/relationship analysis. Costs more than get_user_tweets because replies dilute the page.

Inputs: username (required), limit. Returns: result

get_verified_followersB

Blue-verified followers of a user.

A cheap proxy for "who matters in this audience" — useful for prioritising outreach without walking thousands of followers.

Inputs: user_id (required), limit. Returns: result

join_communityC

Join a community. Visible to its members.

Inputs: community_id (required). Returns: result

leave_communityD

Leave a community.

Inputs: community_id (required). Returns: result

like_tweetB

Like a post. Reversible with unlike_tweet.

Inputs: tweet_id (required). Returns: result

list_accountsA

List the accounts in the pool with their state (active / locked / error).

Use before heavy work to see how much rate-limit headroom the pool has, and when a call fails with kind: auth to spot the dead account.

Inputs: no named parameters. Returns: result

mute_userA

Mute an account (you stop seeing them; they are not told).

Inputs: user_id (required). Returns: result

pin_replyB

Pin a reply inside its conversation (needs the conversation id).

The conversation id is a tweet's conversation_id; get it from get_tweet.

Inputs: tweet_id (required), conversation_id. Returns: result

pin_tweetB

Pin a post to your profile. Replaces any existing pin without warning.

Inputs: tweet_id (required). Returns: result

pool_statusA

Account pool health: counts plus per-account state.

Faster to read than list_accounts when all you need is "do I have a working account right now".

Inputs: no named parameters. Returns: result

post_tweetA

Publish a post, reply or quote. Public the moment it runs.

Confirm with the user first. Upload media before posting and pass the ids here (comma-separated). Standard accounts cap at 280 characters, Premium at 25,000; X rejects identical text as a duplicate.

Inputs: text (required), reply_to, media_ids, quote_tweet. Returns: result

rate_community_noteB

Rate a Community Note: helpful, somewhat_helpful, or not_helpful.

Requires an account enrolled in Community Notes.

Inputs: rating (required), note_id (required). Returns: result

remove_accountA

Remove an account and its cookies from the local pool.

Destructive: the cookies are gone, so re-adding requires fresh browser cookies. Does not touch the X account itself.

Inputs: username (required). Returns: result

remove_followerB

Remove someone from your followers (soft-block). They can follow again.

Inputs: user_id (required). Returns: result

remove_list_memberB

Remove an account from a list.

Inputs: list_id (required), user_id (required). Returns: result

remove_tweet_from_folderB

Remove a post from a folder (keeps the bookmark itself).

Inputs: tweet_id (required), folder_id (required). Returns: result

retweetA

Repost someone's post to your followers. Public — confirm first.

Inputs: tweet_id (required). Returns: result

schedule_tweetA

Schedule a post for a future ISO-8601 time (e.g. 2026-12-01T12:00:00Z).

Posting happens later without you — clear it with the user, and note the time is UTC unless the string carries an offset.

Inputs: text (required), execute_at (required), reply_to, media_ids. Returns: result

search_bookmarksC

Full-text search inside your bookmarks.

Inputs: query (required), limit, cursor. Returns: result

search_dmC

Search across all DM messages.

Inputs: query (required), limit. Returns: result

search_dm_groupsC

Search group DM conversations.

Inputs: query (required), limit. Returns: result

search_dm_peopleC

Search for people you have DM history with.

Inputs: query (required), limit. Returns: result

search_usersA

Find accounts by name or keyword.

Cheaper than search() when you only need the handle/id. Follow up with get_user() for the full profile.

Inputs: query (required), limit. Returns: result

send_dmA

Send a direct message. No recall — confirm the recipient and text first.

The recipient must accept DMs from you (mutual follow, or open message requests). Failures come back as kind: validation with X's reason.

Inputs: text (required), user_id (required). Returns: result

set_active_accountA

Make one account the first choice for every call.

The pool still falls back to the others on a rate limit unless auto-rotation is off. Use when a specific account must own the action (posting as a brand, DMs from a personal handle).

Inputs: username (required). Returns: result

set_auto_rotateA

Turn automatic account rotation on or off.

On (default): a rate-limited or dead account is benched and the next active account retries the call. Off: the call fails instead, so you always know which account acted.

Inputs: enabled (required). Returns: result

subscribe_listB

Subscribe to someone else's list so it appears in your timeline.

Inputs: list_id (required). Returns: result

unblock_userC

Unblock an account.

Inputs: user_id (required). Returns: result

unbookmark_tweetB

Remove a post from your bookmarks.

Inputs: tweet_id (required). Returns: result

unfollow_topicC

Unfollow a topic.

Inputs: topic_id (required). Returns: result

unfollow_userC

Unfollow an account.

Inputs: user_id (required). Returns: result

unlike_tweetC

Remove your like from a post.

Inputs: tweet_id (required). Returns: result

unmute_userC

Unmute an account.

Inputs: user_id (required). Returns: result

unpin_replyC

Unpin a reply from its conversation.

Inputs: tweet_id (required), conversation_id. Returns: result

unpin_tweetC

Unpin the post from your profile.

Inputs: tweet_id (required). Returns: result

unretweetC

Undo your repost.

Inputs: tweet_id (required). Returns: result

unsubscribe_listC

Unsubscribe from a list.

Inputs: list_id (required). Returns: result

update_listC

Rename or re-describe a list.

Inputs: name (required), list_id (required), private, description. Returns: result

update_profileA

Change your public display name, bio, location or website.

Only the fields you pass are touched (empty means "leave it"). Bio cannot contain < > or & — X rejects them with code 120.

Inputs: bio, name, website, location. Returns: result

update_profile_bannerC

Replace the banner/header image (recommended 1500x500).

Inputs: file_path (required). Returns: result

update_profile_imageB

Replace the avatar. Takes a local jpg/png/gif path.

Inputs: file_path (required). Returns: result

upload_mediaA

Upload an image, GIF or video and get the media id for post_tweet.

Cookie auth, no API keys. Chunked (4 MiB) with processing polling for video, so large files take a while but do not time out. jpg/png/webp/gif/mp4/mov.

Inputs: file_path (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.8/5.0

    Scored across 113 tools

    Disambiguation4/5

    Most tools target clearly distinct resource-action pairs, and the descriptions do a good job separating similar reads such as get_tweet_replies vs get_thread or get_user_tweets vs get_user_tweets_and_replies. However, the account/session cluster (get_me, get_account_settings, list_accounts, pool_status, get_rate_limits) overlaps enough that an agent must rely heavily on nuance in descriptions.

    Naming Consistency4/5

    The surface is overwhelmingly snake_case verb_noun and is easy to scan. There are notable deviations such as search (instead of search_tweets), pool_status, get_me, retweet/unretweet, and dm_block_user, but the overall convention remains predictable.

    Tool Count1/5

    At 113 tools, the surface is far beyond a well-scoped set and becomes an extreme selection burden. Many tools are legitimate X operations, but the sheer number of paired actions and specialized read variants makes the server unwieldy.

    Completeness4/5

    Coverage is very broad: authentication/account handling, search, users, tweets, timelines, posting, media, engagement, DMs, lists, communities, trends, bookmarks, scheduling, drafts, and profile management are all represented. Minor gaps remain around tweet editing, polls/Spaces, and some group DM or community management operations, but core workflows are covered.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Connects AI assistants to Twitter/X using cookie-based authentication to read timelines, search tweets, and perform actions like posting and liking. It leverages Twitter's internal GraphQL API to provide full functionality without requiring a developer account.
      19 npm
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides AI agents and coding assistants with Twitter data access including tweets, user profiles, followers, and search functionality.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to fully automate X/Twitter interactions including searching, posting, engaging, and managing multiple accounts without paid API keys.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to interact with X (Twitter) through its private GraphQL API using session cookies, supporting tweets, replies, likes, retweets, searches, direct messages, and more. Provides 24 MCP tools for full account automation.
      24
      1,029 npm
      4
      MIT