twitterapi.mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@twitterapi.mcp show mentions for @elonmusk"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
twitterapi.mcp
MCP server that exposes twitterapi.io endpoints as tools for AI agents and MCP hosts. Written in TypeScript, distributed on npm, runnable with a single npx command.
Current Tools
Tool | Description | API Endpoint | Auth |
Fetch tweets mentioning a user. |
| API key | |
Fetch a page of the conversation thread around a tweet. |
| API key | |
Create a tweet or reply. |
| API key + cookies + proxy | |
Delete one of your tweets. |
| API key + cookies + proxy |
Related MCP server: x-mcp
Quick Start
1. Get an API key
Visit https://twitterapi.io/dashboard and obtain your x-api-key.
2. Cookies + proxy for write actions
create_tweet and delete_tweet authenticate with your account's own session
cookies. From a browser logged into X, open DevTools → Application → Cookies →
https://x.com and copy the auth_token and ct0 values.
Variable | Required | Description |
| always | twitterapi.io API key |
| writes |
|
| writes |
|
| writes | Residential proxy, |
The server derives the login_cookies value twitterapi.io expects from
auth_token + ct0. These cookies expire over time (typically weeks); when a
write starts returning an auth error, refresh them from the browser.
The API key alone is enough for the read tools. Add the cookie/proxy vars only if you need write actions.
3. Add to your MCP host
Claude Desktop (%APPDATA%\Claude\claude_desktop_config.json on Windows,
~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"twitterapi": {
"command": "npx",
"args": ["-y", "@pedrot95dev/twitterapi.mcp"],
"env": {
"TWITTERAPI_IO_KEY": "your_key_here",
"TWITTERAPI_IO_AUTH_TOKEN": "your_auth_token_cookie",
"TWITTERAPI_IO_CT0": "your_ct0_cookie",
"TWITTERAPI_IO_PROXY": "http://user:pass@ip:port"
}
}
}
}npx -y @pedrot95dev/twitterapi.mcp downloads and runs the latest published version. Only
Node.js (>= 18) is required — no global install needed.
Other MCP hosts (e.g. Cursor): add the same npx command + env vars in the
host's MCP settings UI or config file.
Tool: get_user_mentions
Fetch tweets that mention or reply to a user. Makes a single request per call;
page by passing cursor from a previous response's next_cursor.
Parameter | Type | Default | Description |
| string | (required) | X username, with or without |
| string | — | Start time filter (e.g. |
| string | — | End time filter |
| string | — | Pagination cursor from a previous |
|
|
| Sort mode |
| integer |
| Max tweets to return from this single request |
{
"tweets": [ ... ],
"count": 12,
"has_next_page": true,
"next_cursor": "DAADDAAB...",
"status": "success",
"msg": null
}Tool: get_tweet_thread_context
Fetch the conversation thread around a tweet. Returns the original tweet, the
intermediate replies up the chain, the tweet itself, and its direct replies.
Each returned tweet includes entities.urls with expanded links — useful for
scanning a mention's surrounding conversation for URLs.
Makes exactly one request per call (1-to-1 with the endpoint — no internal
pagination). Page through longer threads with cursor.
Parameter | Type | Default | Description |
| string | (required) | The tweet ID to get the thread context for |
| string | — | Pagination cursor from a previous |
{
"tweets": [ ... ],
"count": 6,
"has_next_page": false,
"next_cursor": "",
"status": "success",
"msg": "success"
}Note: this endpoint paginates unevenly — a page may return few or zero tweets
while has_next_page is still true. Follow next_cursor until
has_next_page is false to collect the whole thread.
Tool: create_tweet
Post a new tweet or reply. Supports quotes, media, communities, and scheduling. Requires the cookie + proxy env vars (see step 2).
Parameter | Type | Default | Description |
| string | (required) | The text content of the tweet |
| string | — | Tweet ID to reply to (makes this a reply) |
| string | — | Tweet ID to quote |
| string | — | URL for quote (alternative to |
| string | — | Post inside a specific community |
| boolean |
| Allow >280 chars (Premium accounts) |
| string[] | — | Media IDs from a prior |
| string | — | ISO-8601 future time, e.g. |
{ "tweet_id": "1234567890123456789", "status": "success", "msg": "success" }Tool: delete_tweet
Delete one of your tweets by ID. Requires the cookie + proxy env vars.
Parameter | Type | Default | Description |
| string | (required) | The ID of the tweet to delete |
{ "status": "success", "msg": "success" }Contributing
Local development, build, and testing instructions are in CONTRIBUTING.md.
License
MIT — see LICENSE.
Credits
Based on the official twitterapi-io agent skill: https://github.com/kaitoInfra/twitterapi-io API service: https://twitterapi.io
Available Tools
4 toolscreate_tweetCreate tweetA
Create or reply to a tweet via the v2 endpoint. Uses login_cookies built from the account's auth_token/ct0 env vars (requires TWITTERAPI_IO_AUTH_TOKEN, TWITTERAPI_IO_CT0, TWITTERAPI_IO_PROXY).
Inputs: tweet_text (required), media_ids, community_id, schedule_for, +4 more.
delete_tweetDelete tweetA
Delete a tweet by ID (must be owned by the logged-in account). Uses login_cookies built from the account's auth_token/ct0 env vars.
Inputs: tweet_id (required).
get_tweet_thread_contextGet tweet thread contextA
Fetch one page of the conversation thread around a tweet (to find links in context). Returns the original tweet, intermediate replies up the chain, the tweet itself, and its direct replies; each tweet includes entities.urls with expanded links. Makes exactly one request per call: pages are uneven (a page may be empty while has_next_page is true), so pass next_cursor back as cursor to fetch the next page.
Inputs: tweet_id (required), cursor.
get_user_mentionsGet user mentionsA
Fetch tweets mentioning a specific X/Twitter user. Makes a single request per call. The caller handles pagination by passing cursor (from a previous next_cursor).
Inputs: user_name (required), limit, cursor, query_type, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct action: fetching mentions, retrieving thread context, creating tweets, and deleting tweets. No overlap in purpose.
All tool names follow a consistent verb_noun pattern using snake_case (e.g., get_user_mentions, create_tweet), making them predictable.
4 tools is slightly minimal for a Twitter API server but reasonable for a focused subset. Each tool serves a clear purpose without redundancy.
The tool set covers core CRUD for tweets (create, delete) and some read operations (mentions, thread context), but lacks common features like timeline retrieval, search, or interactions (like, retweet).
Maintenance
Related MCP Connectors
Hosted MCP server from TwitterAPI.io that gives AI agents read-only access to Twitter/X data. 12 tools: tweet search with X operators, user profiles, a user's latest tweets, followers and followings, replies, quotes, retweeters, mentions and trends. Connect at https://mcp.twitterapi.io/mcp with a TwitterAPI.io API key or account sign-in; usage is paid per result returned. Separately, TwitterAPI.io also offers x402 pay-per-call HTTP endpoints (tweet search, user info, a user's latest tweets) paid in USDC on Base or Solana with no account or API key; see https://docs.twitterapi.io/x402-pay-per-call. The MCP server itself uses an API key or sign-in.
Hosted X (Twitter) MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Official twitterapi.io hosted MCP: Twitter/X tweets, users, followers, trends. OAuth or API key.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants to interact with Twitter functionality using cookie-based authentication, allowing for timeline access, tweet management, user information retrieval, and search capabilities.16-
- AlicenseAqualityCmaintenanceAn MCP server that provides AI agents with full access to the X (Twitter) API for posting, searching, and managing engagement through natural language. It supports comprehensive tools for tweet management, media uploads, and account analytics across multiple MCP-compatible clients.1563MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for interacting with the Twitter/X API v2, enabling AI assistants to retrieve tweets, post content, reply, quote, and more programmatically.13MIT
- AlicenseAqualityCmaintenanceMCP server for Twitter/X enabling AI agents to search, post, reply, and engage with tweets.149 npm2MIT