Skip to content

Install + register with your MCP client

Three steps. Pick your client at step 3.

1. Install the binary

uv tool install twikit-mcp

Why uv tool install: drops twikit-mcp on your PATH in an isolated env (no dependency conflicts), instant subsequent startups, single command to upgrade later (uv tool upgrade twikit-mcp).

If you don't have uv: install it (one curl line on macOS / Linux). Or use pipx / pip — see the README "Choose your install" for those alternatives.

2. Drop your X cookies

Log into x.com in a browser → DevTools (F12) → ApplicationCookieshttps://x.com. Copy ct0 and auth_token.

mkdir -p ~/.config/twitter-mcp
cat > ~/.config/twitter-mcp/cookies.json <<'EOF'
{"ct0": "...", "auth_token": "..."}
EOF
chmod 600 ~/.config/twitter-mcp/cookies.json

3. Register with your client

Same JSON shape (mcpServers block) for every client; only the config file location differs. Replace /home/YOU with your actual home path.

Claude Code

CLI command — no JSON editing:

claude mcp add twitter -s user \
  -e "TWITTER_COOKIES=$HOME/.config/twitter-mcp/cookies.json" \
  -- twikit-mcp

Claude Desktop

OS Config file
macOS ~/Library/Application Support/Claude/claude_desktop_config.json
Windows %APPDATA%\Claude\claude_desktop_config.json
Linux ~/.config/Claude/claude_desktop_config.json

Add (create the file if it doesn't exist):

{
  "mcpServers": {
    "twitter": {
      "command": "twikit-mcp",
      "env": {
        "TWITTER_COOKIES": "/home/YOU/.config/twitter-mcp/cookies.json"
      }
    }
  }
}

Restart Claude Desktop.

Cursor

Edit ~/.cursor/mcp.json (global) or .cursor/mcp.json (per-project):

{
  "mcpServers": {
    "twitter": {
      "command": "twikit-mcp",
      "env": {
        "TWITTER_COOKIES": "/home/YOU/.config/twitter-mcp/cookies.json"
      }
    }
  }
}

Cursor reloads automatically; no restart needed.

Windsurf

Edit ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "twitter": {
      "command": "twikit-mcp",
      "env": {
        "TWITTER_COOKIES": "/home/YOU/.config/twitter-mcp/cookies.json"
      }
    }
  }
}

Restart Windsurf.

Cline (VS Code extension)

Open the Cline panel → ⚙️ → MCP ServersEdit MCP Settings. Cline auto-reloads on save.

{
  "mcpServers": {
    "twitter": {
      "command": "twikit-mcp",
      "env": {
        "TWITTER_COOKIES": "/home/YOU/.config/twitter-mcp/cookies.json"
      }
    }
  }
}

opencode

Edit ~/.config/opencode/config.json:

{
  "mcpServers": {
    "twitter": {
      "command": "twikit-mcp",
      "env": {
        "TWITTER_COOKIES": "/home/YOU/.config/twitter-mcp/cookies.json"
      }
    }
  }
}

Any other MCP client

twikit-mcp is a standard stdio MCP server. Whatever your client's config file looks like, the JSON shape is the same:

{
  "mcpServers": {
    "twitter": {
      "command": "twikit-mcp",
      "env": {
        "TWITTER_COOKIES": "/home/YOU/.config/twitter-mcp/cookies.json"
      }
    }
  }
}

Some clients use mcp.servers instead of mcpServers, or wrap it under a different top-level key — check your client's docs. The command and env fields are universal.

Verify

In your client, ask:

Search tweets about AI

The agent should call search_tweets and return results. If you get a permissions error, your cookies.json path is wrong; double-check TWITTER_COOKIES in the config above.

Upgrading

uv tool upgrade twikit-mcp

That's it — your client picks up the new binary on next launch.