Read public X posts, replies, profiles, and search results through Rettiwt or the official API.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Twitter/X MCP lets an MCP client read public X posts, replies, and profiles, or search X. It uses Rettiwt by default, so you do not need an X developer plan. You can switch to the official X API if you have access.
RETTIWT_API_KEY. Official X API credentials work when you select API mode.Once the package is published, your MCP client can run it without a clone:
The server selects Rettiwt when you omit TWITTER_MODE. Pass RETTIWT_API_KEY in the client configuration.
The server uses stdio. Keep stdout reserved for MCP traffic.
To develop the server or use a clone directly:
Point your MCP client at the compiled entry point:
Run npm run build after each source change. Do not use src or npm run dev as the client's stdio command. Build logs on stdout can corrupt MCP messages.
Each example starts with the npm package, followed by the local equivalent. Replace /absolute/path/to/twitter-mcp with your clone's path and your_key_here with your Rettiwt key. Do not commit a configuration file that contains the key.
Add the npm package to Claude Code:
For a local build:
Claude Code uses local scope by default. Add --scope user before twitter to make the server available across projects.
Claude Desktop reads the same server from claude_desktop_config.json. Restart the app after editing the file.
For a local build, replace command and args with:
Add the npm package to ~/.codex/config.toml, or to .codex/config.toml in a trusted project:
For a local build:
Restart Codex after editing the file. The CLI, IDE extension, and desktop app share this configuration on the same computer.
Add the npm package to opencode.json or opencode.jsonc:
For a local build, replace the command array with:
Add the npm package to .cursor/mcp.json in a project, or to ~/.cursor/mcp.json for global use:
For a local build, replace command and args with:
| Mode | Selection | Credentials | Notes |
|---|---|---|---|
| Rettiwt | Default, or TWITTER_MODE=rettiwt | RETTIWT_API_KEY | Free of X API charges. Uses unofficial internal endpoints and may break or put the account at risk. |
| Official API | TWITTER_MODE=api | Bearer token or complete OAuth credentials | Uses the supported X API. X controls access tiers and pricing. |
Rettiwt requires authenticated user mode in this server. Guest mode is not supported.
RETTIWT_API_KEY in the MCP client's environment.TWITTER_MODE, or set TWITTER_MODE=rettiwt explicitly.A Rettiwt key contains X session cookies and has the same access as the account. Treat it like a password. Do not commit it, paste it into an issue, log it, or pass it as a command-line argument. Use a key only for an account you own or have permission to access.
Rettiwt is unofficial. X's automation rules prohibit non-API website automation and warn that violations may lead to account suspension. Read the X Rules before using this mode. You accept the compliance and account risk.
Use a bearer token:
Or provide the complete OAuth set:
Create credentials in the X Developer Portal. X controls API access and pricing, so check the current terms before choosing this mode.
| Variable | Required | Meaning |
|---|---|---|
TWITTER_MODE | No | rettiwt by default, or api. Other values fail startup. |
RETTIWT_API_KEY | Rettiwt mode | Authenticated Rettiwt session key. |
TWITTER_BEARER_TOKEN | API mode option | Official API bearer token. |
TWITTER_API_KEY | OAuth option | OAuth application key. |
TWITTER_API_SECRET | OAuth option | OAuth application secret. |
TWITTER_ACCESS_TOKEN | OAuth option | OAuth access token. |
TWITTER_ACCESS_SECRET | OAuth option | OAuth access secret. |
TWITTER_REQUEST_TIMEOUT_MS | No | Request deadline from 1,000 to 120,000 ms. Default: 30,000. |
The server rejects an incomplete OAuth configuration at startup. It reads credentials from the process environment and never returns them through get_server_info.
| Tool | Input | Result |
|---|---|---|
get_tweet | tweet_id | One post. Accepts a numeric ID or an x.com or twitter.com status URL. |
get_tweet_replies | tweet_id, optional max_results | Replies and available page metadata. |
get_user_profile | username | One public profile. A leading @ is accepted. |
search_tweets | query, optional max_results | Matching posts and available page metadata. Search operators depend on the provider. |
get_server_info | None | Version, active provider, tools, limits, and capabilities. |
max_results defaults to 10 and accepts 1 through 100. Successful calls return structured MCP content plus JSON text for older clients. Collection tools return the items as JSON text and put cursors and warnings in structured content.
The v1 compatibility contract records the stable tool, input, output, and error behavior for the 1.x release line.
Tool failures use stable codes:
INVALID_INPUTAUTH_REQUIREDAUTH_FAILEDNOT_FOUNDRATE_LIMITEDUPSTREAM_UNAVAILABLETIMEOUTUNSUPPORTED_OPERATIONINTERNAL_ERRORNo reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/twitter-x-mcp)<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>