X MCP logo

X MCP

by Twitter

Reads public X posts, replies, profiles, and search results through Rettiwt or the official X API over stdio.

Install X MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "twitter-x-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@granitebps/twitter-mcp"
      ],
      "env": {
        "TWITTER_MODE": "YOUR_VALUE_HERE",
        "RETTIWT_API_KEY": "YOUR_VALUE_HERE",
        "TWITTER_BEARER_TOKEN": "YOUR_VALUE_HERE",
        "TWITTER_API_KEY": "YOUR_VALUE_HERE",
        "TWITTER_API_SECRET": "YOUR_VALUE_HERE",
        "TWITTER_ACCESS_TOKEN": "YOUR_VALUE_HERE",
        "TWITTER_ACCESS_SECRET": "YOUR_VALUE_HERE",
        "TWITTER_REQUEST_TIMEOUT_MS": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y @granitebps/twitter-mcp

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked 5d ago.

Overview

Twitter/X MCP MCP server exposes public X data to MCP clients through tools for posts, replies, profiles, search, and server details. It uses Rettiwt by default with a session key, or the official X API when configured with API credentials. Use it when an agent needs to inspect public X content without building provider-specific request handling. The server runs over stdio from npm or a locally built Node.js entry point.

Use cases

  • Inspect a public post from an agent workflow
  • Search X for posts matching a query
  • Read replies and available pagination metadata
  • Look up a public X profile
  • Compare Rettiwt and official API access

Key features

  • Retrieve public posts by ID or URL
  • Read replies and page metadata
  • Fetch public profiles
  • Search public X posts
  • Report provider and server capabilities

Tools5

What X MCP lets your agent do. Expand a tool for its parameters.

Self-reported~92 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 2d ago

Recent health check succeeded.

5/5 checks healthy over the last 36d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 2h ago via OSV.dev · @granitebps/twitter-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
npm downloads744Package downloads in the last 30 days.
Last commit2d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Tools exposed5Callable tools this server registers over MCP.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

How X MCP works

What Twitter/X MCP MCP server does

Twitter/X MCP provides MCP tools for reading public content from X. get_tweet retrieves one post from a numeric ID or an x.com or twitter.com status URL. get_tweet_replies returns replies and any page metadata exposed by the selected provider. get_user_profile reads one public profile and accepts a leading @ in the username.

search_tweets returns posts matching a query along with available pagination metadata. Search syntax depends on whether the request uses Rettiwt or the official X API. get_server_info reports the running version, active provider, available tools, limits, and capabilities.

How it works

The server communicates with an MCP client over standard input and output. You can run the published package with npx -y @granitebps/twitter-mcp, or execute dist/cli.js from a cloned and built repository. Keep diagnostic output off stdout because MCP messages use that stream.

Provider selection is controlled by TWITTER_MODE. With the setting omitted, the server selects Rettiwt. Setting TWITTER_MODE=rettiwt makes that choice explicit, while TWITTER_MODE=api selects the official X API. The tools expose a common MCP interface, but provider-specific limits, search operators, and returned metadata can differ.

Setup and configuration

The Twitter/X MCP MCP server requires Node.js 22.21.0 or a later Node 22 release within the declared engine range. Node 24 testing has passed, but installation may produce engine warnings or fail with strict engine checks because the package and Rettiwt dependency still declare Node 22 compatibility.

For Rettiwt mode, set RETTIWT_API_KEY in the MCP client's environment. This key contains X session information and should be treated like a password. Do not commit it, log it, or pass it as a command-line argument. Rettiwt authenticated-user mode is required; guest mode is not supported.

For API mode, provide TWITTER_BEARER_TOKEN, or provide the complete OAuth set: TWITTER_API_KEY, TWITTER_API_SECRET, TWITTER_ACCESS_TOKEN, and TWITTER_ACCESS_SECRET. The server rejects incomplete OAuth configuration during startup. TWITTER_REQUEST_TIMEOUT_MS optionally sets a request deadline from 1,000 to 120,000 milliseconds; the default is 30,000.

Tools and capabilities

  • Retrieve an individual public post by ID or status URL.
  • Read replies and provider-supplied page metadata.
  • Fetch a public profile by username.
  • Search public posts using provider-dependent operators.
  • Inspect provider, version, limits, and capability information.

Limitations and notes

The Twitter/X MCP MCP server is read-only according to the documented tools: it does not expose posting, replying, liking, following, or other mutation operations. Results and limits depend on the active provider. Rettiwt uses unofficial internal endpoints and may break or put the associated account at risk; X automation rules may prohibit this type of access. The official API follows X's access tiers and pricing, which should be checked before deployment.

When using a local checkout, run npm ci and npm run build, then point the MCP client to the compiled entry point. Do not use src or npm run dev as the stdio command. Configuration examples are documented for Claude Code, Claude Desktop, Codex, Cursor, and OpenCode.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about X MCP

Twitter/X MCP is an MCP server that connects AI clients to public X data through Rettiwt or the official X API. Its main tools retrieve posts, read replies, fetch public profiles, search posts, and report server information such as the active provider, limits, and capabilities.

Install it by running `npx -y @granitebps/twitter-mcp` from an MCP client configuration. For local development, clone the repository, run `npm ci` and `npm run build`, then use Node.js to launch `dist/cli.js`.

Rettiwt mode needs `RETTIWT_API_KEY`, while official API mode needs a bearer token or a complete OAuth credential set. Credentials belong in the MCP client's environment and should not be committed, logged, or passed as command-line arguments.

Yes, Twitter/X MCP works with Cursor through its MCP configuration file. Add the npm command and the required credential under `.cursor/mcp.json` for a project or `~/.cursor/mcp.json` for global use.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewX MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/twitter-x-mcp?style=directory)](https://allmcps.com/mcp/twitter-x-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/twitter-x-mcp"><img src="https://allmcps.com/api/badge/twitter-x-mcp?style=directory" alt="X MCP on AllMCPs" /></a>