Twitter MCP Server | Twitter Tools for AI Agents
Connect the @twitterapis/mcp server to Claude, Cursor, and any Model Context Protocol client so your AI agent can search tweets and read profiles as native tools.
The official Model Context Protocol server, @twitterapis/mcp, exposes the read API as native tools for Claude, Cursor, and any MCP client. Ask your agent to "find the latest tweets about AI agents" or "pull @openai's followers" and it calls the API directly, no glue code.
Every tool maps to a REST endpoint at https://api.twitterapis.com. The server holds no state and forwards your API key on each call.
No install step
The server runs on demand with npx. You only need an API key. New accounts start with $0.50 in free credits, enough for hundreds of calls, no card required. Grab one from the dashboard.
Connect a client
Add the server block to your client's MCP config, set TWITTERAPIS_KEY, and restart the client. The twitter_* tools then appear in the tool list.
Open Settings, then Developer, then Edit Config, and add the server to claude_desktop_config.json:
{
"mcpServers": {
"twitterapis": {
"command": "npx",
"args": ["-y", "@twitterapis/mcp@latest"],
"env": { "TWITTERAPIS_KEY": "YOUR_API_KEY" }
}
}
}Edit ~/.cursor/mcp.json (or Settings, then MCP, then Add) and add:
{
"mcpServers": {
"twitterapis": {
"command": "npx",
"args": ["-y", "@twitterapis/mcp@latest"],
"env": { "TWITTERAPIS_KEY": "YOUR_API_KEY" }
}
}
}Any client that speaks the Model Context Protocol over stdio can launch the server the same way. The command is npx -y @twitterapis/mcp@latest with TWITTERAPIS_KEY set in the environment:
{
"command": "npx",
"args": ["-y", "@twitterapis/mcp@latest"],
"env": { "TWITTERAPIS_KEY": "YOUR_API_KEY" }
}Configuration
| Env var | Required | Default | Purpose |
|---|---|---|---|
TWITTERAPIS_KEY | Yes | none | Your API key from the dashboard. |
TWITTERAPIS_BASE_URL | No | https://api.twitterapis.com | Override the API host. |
TWITTERAPIS_TIMEOUT_MS | No | 30000 | Per-request timeout in milliseconds. |
Tools
The server exposes 37 tools: 27 read and 10 write. Read tools need only your API key. Write tools and private-timeline reads also need a registered session (pass auth_token and ct0). User tools accept a username or a numeric user_id; tweet tools accept a tweet id; paged tools take a cursor.
Read tools (27)
| Tool | What it does |
|---|---|
twitter_advanced_search | Search tweets with X operators (from:, min_faves:, filter:, and the rest). |
twitter_user_search | Search accounts by name or keyword. |
twitter_user_info | Full profile by handle. |
twitter_user_info_by_id | Full profile by numeric ID. |
twitter_user_about | The extended About section of a profile. |
twitter_user_affiliates | Accounts affiliated under a Verified Organization. |
twitter_user_tweets | A user's recent tweets, without replies. |
twitter_user_tweets_and_replies | A user's full timeline, tweets plus replies. |
twitter_user_tweets_complete | A user's tweet history, auto-paginated server-side. |
twitter_user_followers | Accounts that follow a user. |
twitter_user_following | Accounts a user follows. |
twitter_user_verified_followers | A user's verified followers. |
twitter_followers_you_know | Followers of a user that your session also follows. |
twitter_check_follow_relationship | The directional follow relationship between two users. |
twitter_user_media | Media a user has posted. |
twitter_user_mentions | Recent tweets mentioning a user. |
twitter_user_likes | The Likes tab of an account read through your session. |
twitter_bookmarks | Bookmarked tweets for the account behind your session. |
twitter_bookmark_search | Search your session account's bookmarks by keyword. |
twitter_home_timeline | The ranked home feed for the account behind your session. |
twitter_tweet_detail | One tweet's full detail. |
twitter_tweet_replies | Replies to a tweet. |
twitter_tweet_thread | A tweet's self-thread. |
twitter_tweet_retweeters | Accounts that retweeted a tweet. |
twitter_list_members | Members of a public List. |
twitter_dm_list | The DM inbox for the account behind your session. |
twitter_dm_conversation | The message history of a single DM conversation. |
Write tools (10)
Write tools need a registered session. Most bill at $0.0008 per call, the same as a standard read; only twitter_create_tweet is higher at $0.0016.
| Tool | What it does |
|---|---|
twitter_create_tweet | Post a tweet as your registered account. |
twitter_delete_tweet | Delete one of your registered account's tweets. |
twitter_favorite_tweet | Like a tweet as your registered account. |
twitter_unfavorite_tweet | Remove a like from a tweet. |
twitter_retweet | Retweet a tweet as your registered account. |
twitter_unretweet | Remove a retweet from a tweet. |
twitter_bookmark_tweet | Bookmark a tweet as your registered account. |
twitter_unbookmark_tweet | Remove a bookmark from a tweet. |
twitter_follow_user | Follow a user as your registered account. |
twitter_unfollow_user | Unfollow a user as your registered account. |
Billing
Most MCP calls bill at $0.0008 per call, the same as a direct REST call. A few cost more: twitter_tweet_thread is $0.004, twitter_user_tweets_complete is $0.0024, and tweet creation plus the DM reads (twitter_dm_list, twitter_dm_conversation) are $0.0016. Your first $0.50 is free. See Rate limits for the full pay-per-call model.
Prefer raw HTTP?
You do not need the MCP server to use the API. Every tool here is a thin wrapper over a REST endpoint you can call yourself.
Quickstart
Make your first REST request in under two minutes.
Client libraries
Copy-paste typed clients for JavaScript and Python.
Advanced Tweet Search
The flagship endpoint behind twitter_advanced_search.
Authentication
How the bearer token works and where to find your key.
FAQ
Which clients does the MCP server support?
Claude Desktop, Cursor, and any client that speaks the Model Context Protocol over stdio. Add the server block and set TWITTERAPIS_KEY.
Do I need to install anything?
No. The server runs on demand with npx -y @twitterapis/mcp@latest. You only need an API key, with $0.50 in free credits to start.
Are the MCP tools read-only?
No. The server exposes 37 tools, 27 read and 10 write. Read tools bill at the standard $0.0008 read rate; write tools (like, retweet, bookmark, follow, create, delete, and their undos) bill at $0.0008 per call too, the same as a read, except create at $0.0016, and need a registered session.