TwittrAPI
v1.2.0Read public Twitter/X data: tweets, profiles, followers, search.
Values you need
| Variable | What it is | |
|---|---|---|
TWITTRAPI_API_KEY | optional secret | Your TwittrAPI key. Set this or RAPIDAPI_KEY. |
RAPIDAPI_KEY | optional secret | RapidAPI key for the Twitter AIO API. Used when TWITTRAPI_API_KEY is not set. |
RAPIDAPI_HOST | optional | Host of your TwittrAPI listing on RapidAPI. Change it if you subscribed to another listing. Default: twitter-aio.p.rapidapi.com |
TWITTRAPI_BASE_URL | optional | Override the API base URL. Default: https://api.twittrapi.com |
TWITTRAPI_RESPONSE_FORMAT | optional | Format of tool results: simple (compact JSON, far fewer tokens) or raw (X's full GraphQL JSON). Tools also take a format argument. Default: simple |
TWITTRAPI_X_COOKIE | optional secret | Cookie of your own logged-in x.com session (auth_token, ct0, twid). With TWITTRAPI_X_PROXY set, adds the account tools (post, like, follow, DMs, lists, drafts). |
TWITTRAPI_X_PROXY | optional secret | Your proxy for the account tools, http://user:pass@host:port. |
TWITTRAPI_X_CHAT_PASSCODE | optional secret | Your X Chat passcode. Adds send_dm and message text in the DM inbox. |
npm (npx) discovery passed
Requires Node.js 18+
Run in a terminal
claude mcp add twittrapi-mcp -- npx -y twittrapi-mcp@1.2.0Add to
claude_desktop_config.json{
"mcpServers": {
"twittrapi-mcp": {
"args": [
"-y",
"twittrapi-mcp@1.2.0"
],
"command": "npx"
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"twittrapi-mcp": {
"args": [
"-y",
"twittrapi-mcp@1.2.0"
],
"command": "npx"
}
}
}Add to
.vscode/mcp.json{
"servers": {
"twittrapi-mcp": {
"args": [
"-y",
"twittrapi-mcp@1.2.0"
],
"command": "npx",
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.twittrapi-mcp]
command = "npx"
args = ["-y", "twittrapi-mcp@1.2.0"]Remote (hosted)
Run in a terminal
claude mcp add --transport http twittrapi-mcp https://mcp.twittrapi.com/mcpAdd to
Settings → Connectors → Add custom connector (or claude_desktop_config.json via mcp-remote){
"mcpServers": {
"twittrapi-mcp": {
"args": [
"-y",
"mcp-remote",
"https://mcp.twittrapi.com/mcp"
],
"command": "npx"
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"twittrapi-mcp": {
"url": "https://mcp.twittrapi.com/mcp"
}
}
}Add to
.vscode/mcp.json{
"servers": {
"twittrapi-mcp": {
"type": "http",
"url": "https://mcp.twittrapi.com/mcp"
}
}
}Add to
~/.codex/config.toml[mcp_servers.twittrapi-mcp]
command = "npx"
args = ["-y", "mcp-remote", "https://mcp.twittrapi.com/mcp"]For AI agents
- Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
- Restart or reload the client so it starts the server.
- Verify: the server should expose these tools: get_user_by_username, get_user_by_id, username_to_id, users_by_ids, get_user_tweets, get_user_tweets_and_replies, get_user_media, get_followers, ….
- If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.
Machine-readable: install.md · manifest.json