Enhanced MCP server for X with OAuth 2.0 support, media uploads, and comprehensive rate limiting.
X mcp server connects X to AI assistants that speak the Model Context Protocol. Enhanced MCP server for X with OAuth 2.0 support, media uploads, and comprehensive rate limiting.
An enhanced Model Context Protocol (MCP) server for X that adds OAuth 2.0 support, v2 API media uploads, and comprehensive rate limiting to the original implementation.
Once connected, the assistant can call these 5 tools directly:
post_tweet — Post a new tweet with optional media attachments and repliessearch_tweets — Example prompts: - "Search for tweets about #MachineLearning" - "Find 50 recent tweets mentioning @ClaudeAI" - "Search for tweets about TypeScript tutorials"delete_tweet — Example prompts: - "Delete tweet with ID 1234567890" - "Remove my last tweet (provide the ID)"Setup — The Setup tool exposed by this serverCommands — The Commands tool exposed by this serverThe server is distributed via npm as npm, so most clients can run it without a manual build step. Add it to your MCP client's configuration and restart the client to pick it up — the copy-paste configs for Claude Desktop, Claude Code and Cursor are on this page.
Before the server will start you need to supply 8 environment variables: API_KEY, API_SECRET_KEY, ACCESS_TOKEN, ACCESS_TOKEN_SECRET, AUTH_TYPE, OAUTH2_CLIENT_ID, OAUTH2_CLIENT_SECRET, OAUTH2_ACCESS_TOKEN. Keep credentials in your client's env block or a secrets manager rather than committing them.
Developer-tool servers are usually the first ones people connect, because they turn "help me with this code" into an assistant that can actually read the repo and act on it. X sits in that group, and the shape of its toolset — post_tweet, search_tweets, delete_tweet among others — tells you what it is really for. Worth comparing against the other developer tools servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.
| Tool | What it does |
|---|---|
| post_tweet | Post a new tweet with optional media attachments and replies. |
| search_tweets | Example prompts: - "Search for tweets about #MachineLearning" - "Find 50 recent tweets mentioning @ClaudeAI" - "Search for tweets about TypeScript tutorials" |
| delete_tweet | Example prompts: - "Delete tweet with ID 1234567890" - "Remove my last tweet (provide the ID)" |
| Setup | The Setup tool exposed by this server. |
| Commands | The Commands tool exposed by this server. |
For OAuth 2.0:
```json
{
"mcpServers": {
"twitter-mcp": {
"command": "npx",
"args": ["-y", "@mbelinky/x-mcp-server"],
"env": {
"AUTH_TYPE": "oauth2",
"OAUTH2_CLIENT_ID": "your_client_id",
"OAUTH2_CLIENT_SECRET": "your_client_secret",
"OAUTH2_ACCESS_TOKEN": "your_access_token",
"OAUTH2_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}Configuration as documented by the project. Restart the client after saving.
| Variable | Description | Required |
|---|---|---|
| API_KEY | Credential the server authenticates with. | Yes |
| API_SECRET_KEY | Credential the server authenticates with. | Yes |
| ACCESS_TOKEN | Credential the server authenticates with. | Yes |
| ACCESS_TOKEN_SECRET | Credential the server authenticates with. | Yes |
| AUTH_TYPE | Configuration value read at startup. | Optional |
| OAUTH2_CLIENT_ID | Configuration value read at startup. | Optional |
| OAUTH2_CLIENT_SECRET | Credential the server authenticates with. | Yes |
| OAUTH2_ACCESS_TOKEN | Credential the server authenticates with. | Yes |
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.