X (Twitter)
CommunityMCP server by Role1776 · updated · ★ 2
Search, read and publish X posts and manage users, lists and media via the X API v2. X (Twitter) is a community project by Role1776, not verified by a company domain.
Last commit 42 days ago
MIT: permissive, fine for commercial use
Clear description, published package or server URL, original repository
Not checked yet. What we check
What you need
| Setting | Needed | What it is |
|---|---|---|
X_Environment variable, secret | Required | OAuth 1.0a consumer key. developer.x.com -> your project -> your app -> Keys and tokens. |
X_Environment variable, secret | Required | OAuth 1.0a consumer secret, issued together with X_API_KEY. |
X_Environment variable, secret | Required | User access token. Set the app permissions to Read and Write BEFORE generating it: a token keeps the permissions it was created with, and a read-only one fails every write until it is regenerated. |
X_Environment variable, secret | Required | User access token secret, issued together with X_ACCESS_TOKEN. |
MEDIA_Environment variable | Required | Absolute path to an existing directory - the only one x_media_upload may read files from. Anything outside it is refused, symlinks included. Checked at startup. |
MCP_Environment variable | Optional | stdio (client spawns the process) or http (streamable HTTP listener). Default: stdio |
MCP_Environment variable | Optional | Server name reported in the MCP initialize handshake. Default: mcp-x |
MCP_Environment variable | Optional | HTTP path the MCP endpoint is served on. Used only when MCP_TRANSPORT=http. Default: /mcp |
SERVER_Environment variable | Optional | TCP port to listen on. Used only when MCP_TRANSPORT=http. Default: 8080 |
SERVER_Environment variable | Optional | HTTP read timeout as a Go duration. Used only when MCP_TRANSPORT=http. Default: 60s |
SERVER_Environment variable | Optional | HTTP write timeout as a Go duration. Used only when MCP_TRANSPORT=http. Default: 60s |
LOG_Environment variable | Optional | local (text, debug) or prod (JSON, info). Logs go to stderr. Default: local |
MAX_Environment variable | Optional | Idle connections the outbound HTTP client keeps per host. Default: 100 |
X_Environment variable | Optional | Log the raw requests sent to the X API. Verbose; the output can contain request details, so keep it off outside debugging. Default: false |
POSTS_Environment variable | Optional | Queries accepted in one x_posts_search or x_posts_count call. Default: 5 |
POSTS_Environment variable | Optional | Usernames accepted in one x_posts_by_user call. Default: 5 |
POSTS_Environment variable | Optional | Post ids accepted in one x_posts_lookup call. The X API caps this at 100. Default: 100 |
POSTS_Environment variable | Optional | Posts returned per query when the call does not ask for a count. Every post returned is billed. Default: 10 |
POSTS_Environment variable | Optional | Upper bound for posts per query. The X API caps this at 100. Default: 100 |
POSTS_Environment variable | Optional | How far back post searches look when the call does not say, in days. Default: 7 |
From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.
Install X (Twitter)
Built from the published package, never by AIclaude mcp add x-twitter -e X_API_KEY=YOUR_X_API_KEY -e X_API_KEY_SECRET=YOUR_X_API_KEY_SECRET -e X_ACCESS_TOKEN=YOUR_X_ACCESS_TOKEN -e X_ACCESS_TOKEN_SECRET=YOUR_X_ACCESS_TOKEN_SECRET -e MEDIA_ROOT=/tmp/mcp-x-media -- docker run -i --rm -e X_API_KEY -e X_API_KEY_SECRET -e X_ACCESS_TOKEN -e X_ACCESS_TOKEN_SECRET -e MEDIA_ROOT ghcr.io/role1776/mcp-x:0.1.1Run in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"x-twitter": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"X_API_KEY",
"-e",
"X_API_KEY_SECRET",
"-e",
"X_ACCESS_TOKEN",
"-e",
"X_ACCESS_TOKEN_SECRET",
"-e",
"MEDIA_ROOT",
"ghcr.io/role1776/mcp-x:0.1.1"
],
"env": {
"X_API_KEY": "YOUR_X_API_KEY",
"X_API_KEY_SECRET": "YOUR_X_API_KEY_SECRET",
"X_ACCESS_TOKEN": "YOUR_X_ACCESS_TOKEN",
"X_ACCESS_TOKEN_SECRET": "YOUR_X_ACCESS_TOKEN_SECRET",
"MEDIA_ROOT": "/tmp/mcp-x-media"
}
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"x-twitter": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"X_API_KEY",
"-e",
"X_API_KEY_SECRET",
"-e",
"X_ACCESS_TOKEN",
"-e",
"X_ACCESS_TOKEN_SECRET",
"-e",
"MEDIA_ROOT",
"ghcr.io/role1776/mcp-x:0.1.1"
],
"env": {
"X_API_KEY": "YOUR_X_API_KEY",
"X_API_KEY_SECRET": "YOUR_X_API_KEY_SECRET",
"X_ACCESS_TOKEN": "YOUR_X_ACCESS_TOKEN",
"X_ACCESS_TOKEN_SECRET": "YOUR_X_ACCESS_TOKEN_SECRET",
"MEDIA_ROOT": "/tmp/mcp-x-media"
}
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"x-twitter": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"X_API_KEY",
"-e",
"X_API_KEY_SECRET",
"-e",
"X_ACCESS_TOKEN",
"-e",
"X_ACCESS_TOKEN_SECRET",
"-e",
"MEDIA_ROOT",
"ghcr.io/role1776/mcp-x:0.1.1"
],
"env": {
"X_API_KEY": "YOUR_X_API_KEY",
"X_API_KEY_SECRET": "YOUR_X_API_KEY_SECRET",
"X_ACCESS_TOKEN": "YOUR_X_ACCESS_TOKEN",
"X_ACCESS_TOKEN_SECRET": "YOUR_X_ACCESS_TOKEN_SECRET",
"MEDIA_ROOT": "/tmp/mcp-x-media"
}
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add x-twitter --env X_API_KEY=YOUR_X_API_KEY --env X_API_KEY_SECRET=YOUR_X_API_KEY_SECRET --env X_ACCESS_TOKEN=YOUR_X_ACCESS_TOKEN --env X_ACCESS_TOKEN_SECRET=YOUR_X_ACCESS_TOKEN_SECRET --env MEDIA_ROOT=/tmp/mcp-x-media -- docker run -i --rm -e X_API_KEY -e X_API_KEY_SECRET -e X_ACCESS_TOKEN -e X_ACCESS_TOKEN_SECRET -e MEDIA_ROOT ghcr.io/role1776/mcp-x:0.1.1{
"mcpServers": {
"x-twitter": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"X_API_KEY",
"-e",
"X_API_KEY_SECRET",
"-e",
"X_ACCESS_TOKEN",
"-e",
"X_ACCESS_TOKEN_SECRET",
"-e",
"MEDIA_ROOT",
"ghcr.io/role1776/mcp-x:0.1.1"
],
"env": {
"X_API_KEY": "YOUR_X_API_KEY",
"X_API_KEY_SECRET": "YOUR_X_API_KEY_SECRET",
"X_ACCESS_TOKEN": "YOUR_X_ACCESS_TOKEN",
"X_ACCESS_TOKEN_SECRET": "YOUR_X_ACCESS_TOKEN_SECRET",
"MEDIA_ROOT": "/tmp/mcp-x-media"
}
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add x-twitter docker run -i --rm -e X_API_KEY -e X_API_KEY_SECRET -e X_ACCESS_TOKEN -e X_ACCESS_TOKEN_SECRET -e MEDIA_ROOT ghcr.io/role1776/mcp-x:0.1.1Gemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the x-twitter block.
Weekly newsletter
Like X (Twitter)? Get the best new MCP servers every week
The best new tools, security warnings before you install something risky, and one practical tip. Free, three minute read.
Alternatives to X (Twitter)
All alternatives →Connect AI agents to Exa for web search, content fetching, and multi-step research.
Search and discover Agent Skills from the skills.sh registry. Powered by HAPI MCP server.
Visit https://brave.com/search/api/ for a free API key. Search the web, local businesses, images,…
Connect to Atlassian Jira, Confluence, Loom, and more to search, create, and manage your work.
Search, read, annotate, and add to your Zotero research library, local or web.
Digital asset manager - upload, organize, search, and generate on-brand images and videos
X (Twitter): common questions
How do I install X (Twitter)?
In Claude Code run claude mcp add x-twitter -e X_API_KEY=YOUR_X_API_KEY -e X_API_KEY_SECRET=YOUR_X_API_KEY_SECRET -e X_ACCESS_TOKEN=YOUR_X_ACCESS_TOKEN -e X_ACCESS_TOKEN_SECRET=YOUR_X_ACCESS_TOKEN_SECRET -e MEDIA_ROOT=/tmp/mcp-x-media -- docker run -i --rm -e X_API_KEY -e X_API_KEY_SECRET -e X_ACCESS_TOKEN -e X_ACCESS_TOKEN_SECRET -e MEDIA_ROOT ghcr.io/role1776/mcp-x:0.1.1. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is X (Twitter) the official server?
X (Twitter) is a community project by Role1776, not verified by a company domain.
Is X (Twitter) free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is X (Twitter) safe to use?
It scores 42 of 100. Grades: maintenance B, licence A, quality C. The security check has not run for it yet. Review the code before you install. How grades work.
What are alternatives to X (Twitter)?
Similar MCP servers: exa, Agent Skills Search Server, brave, Atlassian Rovo MCP Server.
Does X (Twitter) work with ChatGPT?
Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.
