AdYour product here, seen by people installing AI tools every day Sponsor slots open: 12 of 12, from $249 a month

X (Twitter)

Community

MCP server by Role1776 · updated · ★ 2

Score 42

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.

Yours? Claim it
Maintenance

Last commit 42 days ago

Licence

MIT: permissive, fine for commercial use

Quality

Clear description, published package or server URL, original repository

Security

Not checked yet. What we check

What you need

SettingNeededWhat it is
X_API_KEYEnvironment variable, secretRequiredOAuth 1.0a consumer key. developer.x.com -> your project -> your app -> Keys and tokens.
X_API_KEY_SECRETEnvironment variable, secretRequiredOAuth 1.0a consumer secret, issued together with X_API_KEY.
X_ACCESS_TOKENEnvironment variable, secretRequiredUser 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_ACCESS_TOKEN_SECRETEnvironment variable, secretRequiredUser access token secret, issued together with X_ACCESS_TOKEN.
MEDIA_ROOTEnvironment variableRequiredAbsolute 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_TRANSPORTEnvironment variableOptionalstdio (client spawns the process) or http (streamable HTTP listener). Default: stdio
MCP_NAMEEnvironment variableOptionalServer name reported in the MCP initialize handshake. Default: mcp-x
MCP_PATHEnvironment variableOptionalHTTP path the MCP endpoint is served on. Used only when MCP_TRANSPORT=http. Default: /mcp
SERVER_PORTEnvironment variableOptionalTCP port to listen on. Used only when MCP_TRANSPORT=http. Default: 8080
SERVER_READ_TIMEOUTEnvironment variableOptionalHTTP read timeout as a Go duration. Used only when MCP_TRANSPORT=http. Default: 60s
SERVER_WRITE_TIMEOUTEnvironment variableOptionalHTTP write timeout as a Go duration. Used only when MCP_TRANSPORT=http. Default: 60s
LOG_MODEEnvironment variableOptionallocal (text, debug) or prod (JSON, info). Logs go to stderr. Default: local
MAX_IDLE_CONNS_PER_HOSTEnvironment variableOptionalIdle connections the outbound HTTP client keeps per host. Default: 100
X_DEBUGEnvironment variableOptionalLog the raw requests sent to the X API. Verbose; the output can contain request details, so keep it off outside debugging. Default: false
POSTS_MAX_QUERIESEnvironment variableOptionalQueries accepted in one x_posts_search or x_posts_count call. Default: 5
POSTS_MAX_USERNAMESEnvironment variableOptionalUsernames accepted in one x_posts_by_user call. Default: 5
POSTS_MAX_IDSEnvironment variableOptionalPost ids accepted in one x_posts_lookup call. The X API caps this at 100. Default: 100
POSTS_DEFAULT_RESULTSEnvironment variableOptionalPosts returned per query when the call does not ask for a count. Every post returned is billed. Default: 10
POSTS_MAX_RESULTSEnvironment variableOptionalUpper bound for posts per query. The X API caps this at 100. Default: 100
POSTS_DEFAULT_DAYSEnvironment variableOptionalHow 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 AI
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

Run in your terminal. Add --scope user to use it in every project.

Step-by-step: install X (Twitter) in Claude Code

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.

No spam. Unsubscribe in one click. Privacy

Alternatives to X (Twitter)

All alternatives →

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.

Add to stack

Loading.