Skip to main content
MCP server CX Codex

X-Use - X (Twitter) MCP Server — Claude Code MCP server

Connects AI clients to X for profile lookups, direct message management, and drafted posts through a local browser session without developer API tokens.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env X_USE_HOME=<X_USE_HOME> --env OPENAI_API_KEY=<OPENAI_API_KEY> --env OPENAI_BASE_URL=<OPENAI_BASE_URL> --transport stdio x-use-x-twitter-mcp-server -- uvx x-use-mcp
Open on GitHub

What X-Use - X (Twitter) MCP Server does

This package links assistants like Claude Code, Codex, or Cursor to X by automating a local Chromium instance via patchright. You do not need official platform tokens because the tool loads existing login cookies from an exported JSON file. Accounts and operational files reside in the path assigned to X_USE_HOME.

Version 3.2.0 includes 82 discrete tools. It handles tasks like reading discussion threads, checking incoming message folders, and queuing outreach campaigns. To avoid unintended posts, outgoing replies and tweets stay in a staging area until you explicitly confirm publication with approve_draft.

The server will not operate unless you install Chromium and import a valid web session cookie beforehand. An OpenAI-compatible API key is optional and only used if you rely on built-in server generation instead of client reasoning.

What it helps with

  • inspect public feeds and profiles to collect reply context
  • manage direct message folders and notifications without platform keys
  • stage outgoing tweets and threads for mandatory human sign-off
  • track prospective contacts and opt-out preferences locally

Example prompts for the agent

  • Check account status with get_account_health and inspect recent inbox conversations.
  • Gather recent posts from this handle and create a draft response without publishing it.
  • Pull the thread context for this post and stage an answer for my review.

How to install X-Use - X (Twitter) MCP Server

Platform CLI

claude mcp add --env X_USE_HOME=<X_USE_HOME> --env OPENAI_API_KEY=<OPENAI_API_KEY> --env OPENAI_BASE_URL=<OPENAI_BASE_URL> --transport stdio x-use-x-twitter-mcp-server -- uvx x-use-mcp

Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from x-use-mcp <command>

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about X-Use - X (Twitter) MCP Server

How do I install X-Use - X (Twitter) MCP Server in Claude Code?

Run `claude mcp add --env X_USE_HOME=<X_USE_HOME> --env OPENAI_API_KEY=<OPENAI_API_KEY> --env OPENAI_BASE_URL=<OPENAI_BASE_URL> --transport stdio x-use-x-twitter-mcp-server -- uvx x-use-mcp` in your command line.

Does X-Use require an official Twitter API subscription?

No official API access is needed. The tool relies on your authenticated browser session and Chromium to interact with the platform.

Can the AI publish posts automatically?

Publishing tools stage messages as drafts by default. A tweet is only posted to the platform once you trigger the approve_draft tool.

Similar MCP servers

All MCP servers for Browser and scraping →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor