TwittrAPI

v1.2.0
io.github.twittrapi/twittrapi-mcp Checked 4 days ago Published 1 month ago

Read public Twitter/X data: tweets, profiles, followers, search.

Values you need

VariableWhat it is
TWITTRAPI_API_KEYoptional secret Your TwittrAPI key. Set this or RAPIDAPI_KEY.
RAPIDAPI_KEYoptional secret RapidAPI key for the Twitter AIO API. Used when TWITTRAPI_API_KEY is not set.
RAPIDAPI_HOSToptional Host of your TwittrAPI listing on RapidAPI. Change it if you subscribed to another listing. Default: twitter-aio.p.rapidapi.com
TWITTRAPI_BASE_URLoptional Override the API base URL. Default: https://api.twittrapi.com
TWITTRAPI_RESPONSE_FORMAToptional 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_COOKIEoptional 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_PROXYoptional secret Your proxy for the account tools, http://user:pass@host:port.
TWITTRAPI_X_CHAT_PASSCODEoptional 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.0
Add 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/mcp
Add 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

  1. 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).
  2. Restart or reload the client so it starts the server.
  3. 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, ….
  4. 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