Search, read and publish X posts and manage users, lists and media via the X API v2.
To add X (Twitter) to Claude, run the install command below. Restart Claude Code after adding it and its tools show up in your next conversation. It needs 41 environment variables, listed below.
Install
docker run -i --rm ghcr.io/role1776/mcp-x:0.1.1Environment variables
X_API_KEYSet in your MCP configX_API_KEY_SECRETSet in your MCP configX_ACCESS_TOKENSet in your MCP configX_ACCESS_TOKEN_SECRETSet in your MCP configMEDIA_ROOTSet in your MCP configMCP_TRANSPORTSet in your MCP configMCP_NAMESet in your MCP configMCP_PATHSet in your MCP configSERVER_PORTSet in your MCP configSERVER_READ_TIMEOUTSet in your MCP configSERVER_WRITE_TIMEOUTSet in your MCP configLOG_MODESet in your MCP configMAX_IDLE_CONNS_PER_HOSTSet in your MCP configX_DEBUGSet in your MCP configPOSTS_MAX_QUERIESSet in your MCP configPOSTS_MAX_USERNAMESSet in your MCP configPOSTS_MAX_IDSSet in your MCP configPOSTS_DEFAULT_RESULTSSet in your MCP configPOSTS_MAX_RESULTSSet in your MCP configPOSTS_DEFAULT_DAYSSet in your MCP configPOSTS_MAX_DAYSSet in your MCP configPOSTS_DEFAULT_TIMEOUT_MSSet in your MCP configPOSTS_MIN_TIMEOUT_MSSet in your MCP configPOSTS_MAX_TIMEOUT_MSSet in your MCP configUSERS_MAX_USERNAMESSet in your MCP configUSERS_MAX_IDSSet in your MCP configUSERS_DEFAULT_RESULTSSet in your MCP configUSERS_MAX_RESULTSSet in your MCP configUSERS_DEFAULT_TIMEOUT_MSSet in your MCP configUSERS_MIN_TIMEOUT_MSSet in your MCP configUSERS_MAX_TIMEOUT_MSSet in your MCP configLISTS_DEFAULT_RESULTSSet in your MCP configLISTS_MAX_RESULTSSet in your MCP configLISTS_DEFAULT_TIMEOUT_MSSet in your MCP configLISTS_MIN_TIMEOUT_MSSet in your MCP configLISTS_MAX_TIMEOUT_MSSet in your MCP configMEDIA_CHUNK_BYTESSet in your MCP configMEDIA_POLL_INTERVAL_MSSet in your MCP configMEDIA_DEFAULT_TIMEOUT_MSSet in your MCP configMEDIA_MIN_TIMEOUT_MSSet in your MCP configMEDIA_MAX_TIMEOUT_MSSet in your MCP configWhat this does
X (Twitter) exposes a set of tools to Claude over the Model Context Protocol. After you add it to claude_desktop_config.json (snippet above) and restart Claude Desktop, those tools become callable inside any conversation.
Requirements
This server needs the following environment variables to be set before it can run:
X_API_KEY X_API_KEY_SECRET X_ACCESS_TOKEN X_ACCESS_TOKEN_SECRET MEDIA_ROOT MCP_TRANSPORT MCP_NAME MCP_PATH SERVER_PORT SERVER_READ_TIMEOUT SERVER_WRITE_TIMEOUT LOG_MODE MAX_IDLE_CONNS_PER_HOST X_DEBUG POSTS_MAX_QUERIES POSTS_MAX_USERNAMES POSTS_MAX_IDS POSTS_DEFAULT_RESULTS POSTS_MAX_RESULTS POSTS_DEFAULT_DAYS POSTS_MAX_DAYS POSTS_DEFAULT_TIMEOUT_MS POSTS_MIN_TIMEOUT_MS POSTS_MAX_TIMEOUT_MS USERS_MAX_USERNAMES USERS_MAX_IDS USERS_DEFAULT_RESULTS USERS_MAX_RESULTS USERS_DEFAULT_TIMEOUT_MS USERS_MIN_TIMEOUT_MS USERS_MAX_TIMEOUT_MS LISTS_DEFAULT_RESULTS LISTS_MAX_RESULTS LISTS_DEFAULT_TIMEOUT_MS LISTS_MIN_TIMEOUT_MS LISTS_MAX_TIMEOUT_MS MEDIA_CHUNK_BYTES MEDIA_POLL_INTERVAL_MS MEDIA_DEFAULT_TIMEOUT_MS MEDIA_MIN_TIMEOUT_MS MEDIA_MAX_TIMEOUT_MS
Set these via the env object in your MCP config (see claude_desktop_config.json snippet above).
Frequently asked questions
How do I install X (Twitter)?
The install section on this page carries the maker's install command for X (Twitter), as submitted. Restart your client afterwards and the tools appear in your next conversation.
Which clients work with X (Twitter)?
This page carries setup and config for Claude Code. Any other MCP client that accepts a standard server config can connect to X (Twitter) as well.
Does X (Twitter) need an API key?
Yes. Before it can run, set these environment variables: X_API_KEY, X_API_KEY_SECRET, X_ACCESS_TOKEN, X_ACCESS_TOKEN_SECRET, MEDIA_ROOT, MCP_TRANSPORT, MCP_NAME, MCP_PATH, SERVER_PORT, SERVER_READ_TIMEOUT, SERVER_WRITE_TIMEOUT, LOG_MODE, MAX_IDLE_CONNS_PER_HOST, X_DEBUG, POSTS_MAX_QUERIES, POSTS_MAX_USERNAMES, POSTS_MAX_IDS, POSTS_DEFAULT_RESULTS, POSTS_MAX_RESULTS, POSTS_DEFAULT_DAYS, POSTS_MAX_DAYS, POSTS_DEFAULT_TIMEOUT_MS, POSTS_MIN_TIMEOUT_MS, POSTS_MAX_TIMEOUT_MS, USERS_MAX_USERNAMES, USERS_MAX_IDS, USERS_DEFAULT_RESULTS, USERS_MAX_RESULTS, USERS_DEFAULT_TIMEOUT_MS, USERS_MIN_TIMEOUT_MS, USERS_MAX_TIMEOUT_MS, LISTS_DEFAULT_RESULTS, LISTS_MAX_RESULTS, LISTS_DEFAULT_TIMEOUT_MS, LISTS_MIN_TIMEOUT_MS, LISTS_MAX_TIMEOUT_MS, MEDIA_CHUNK_BYTES, MEDIA_POLL_INTERVAL_MS, MEDIA_DEFAULT_TIMEOUT_MS, MEDIA_MIN_TIMEOUT_MS, MEDIA_MAX_TIMEOUT_MS. They go in the env block of your MCP config.
Imported from the Official MCP Registry. The details above come from the registry entry; the maker can claim this listing to correct them, add docs, and see its traffic.
Is this your MCP server?
Claim this listing to see its traffic, fix details yourself, and skip the review queue on future updates.
Add this badge to your README
Show visitors this server is listed in the ClaudeRules directory. The badge links straight to this listing.
[](https://clauderules.net/mcp/io-github-role1776-mcp-x)<a href="https://clauderules.net/mcp/io-github-role1776-mcp-x" target="_blank" rel="noopener noreferrer"><img src="https://clauderules.net/api/badge/io-github-role1776-mcp-x" alt="Listed on clauderules.net" /></a>More Search MCP servers
GitHub
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Serena MCP: the IDE for your agent
A powerful toolkit for coding, providing semantic retrieval and editing capabilities.
mediar-ai/screenpipe
🎖️ 🦀 🏠 🍎 Local-first system capturing screen/audio with timestamped indexing, SQL/embedding storage, semantic search, LLM-powered history analysis, and event-triggered actions - enables building c
MCP Toolbox for Databases
MCP Toolbox for Databases enables your agent to connect to your database.
