twitter-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@twitter-mcppost a tweet saying "Hello world!""
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Twitter MCP Server
TypeScript Model Context Protocol server for the Twitter/X API v2.
Transport: Streamable HTTP (stateless)
Auth: OAuth user access token via the
access-tokenheader — required only for tool calls, not for list/initializeRuntime: Node.js 20+, Express,
@modelcontextprotocol/sdkDocker: multi-stage production image included
This server does not run the OAuth dance itself. Obtain a user access token from your OAuth 2.0 (or OAuth 1.0a user-context) flow and send it when invoking tools.
Endpoints
Method | Path | Description |
|
| MCP Streamable HTTP endpoint (tools) |
|
| Liveness probe |
|
|
|
|
|
|
Related MCP server: X.com MCP Server
Authentication
access-token is not required for protocol/list methods (initialize, tools/list, ping, etc.). It is required when calling a tool that hits the Twitter API.
POST /mcp HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: application/json, text/event-stream
access-token: <OAUTH_USER_ACCESS_TOKEN>Fallback (also accepted):
Authorization: Bearer <OAUTH_USER_ACCESS_TOKEN>If a tool is called without a token, the tool returns an error:
Missing access token. Tool calls require an OAuth user access token via the `access-token` header …Suggested OAuth 2.0 scopes for full tool coverage:
tweet.read tweet.write users.read follows.read follows.write offline.accessTools
Tool | Description |
| Authenticated user profile |
| User lookup by handle |
| User lookup by ID |
| Single tweet by ID |
| User's recent posts |
| Mentions timeline |
| Recent search (last 7 days) |
| Create a post (optional reply / quote) |
| Delete own post |
| Like management |
| Retweet management |
| Follow management |
Local development
npm install
npm run dev
# → http://0.0.0.0:3000/mcpBuild & run production:
npm run build
npm startEnvironment variables:
Variable | Default | Description |
|
| HTTP port |
|
| Bind address |
Docker
# Build
docker build -t twitter-mcp .
# Run
docker run --rm -p 3000:3000 twitter-mcp
# Health check
curl http://localhost:3000/healthExample MCP initialize (curl)
No token needed for initialize / tools/list:
curl -sS http://localhost:3000/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-03-26",
"capabilities": {},
"clientInfo": { "name": "curl", "version": "1.0.0" }
}
}'Tool calls need the token:
curl -sS http://localhost:3000/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H 'access-token: YOUR_TOKEN' \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": { "name": "get_me", "arguments": {} }
}'Architecture notes
Stateless Streamable HTTP — each
POST /mcpcreates a newMcpServer+StreamableHTTPServerTransportwithsessionIdGenerator: undefined, then tears them down when the response finishes. Safe for horizontal scaling and containers.Per-request token isolation —
AsyncLocalStorageholds the optional access token for the duration of the request so concurrent calls never mix credentials. Missing tokens only fail when tools callgetAccessToken().Twitter client —
twitter-api-v2is constructed with the user access token and used as OAuth 2.0 user-context (Bearer).
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceA Model Context Protocol server that enables AI models and applications to interact directly with Twitter/X, providing capabilities to create posts, reply to tweets, retrieve user data, and manage account actions.Last updated2011MIT
- FlicenseAqualityDmaintenanceModel Context Protocol server that enables LLMs to interact with X.com (formerly Twitter) through OAuth 2.0 authentication, supporting major Post-related operations including reading, writing, searching, and managing posts, likes, retweets, and bookmarks.Last updated21148
- Alicense-qualityDmaintenanceModel Context Protocol server that enables programmatic interaction with Twitter API, allowing users to post tweets, search for content, and retrieve user timelines through standardized MCP tools.Last updated21MIT

X API FastMCP Serverofficial
Flicense-qualityFmaintenanceA local MCP server that exposes the X API (formerly Twitter API) as tools, enabling operations like posting, searching, user management, and more via natural language commands.Last updated845
Related MCP Connectors
FastMCP server for posting formatted content to X (Twitter) — Tollbooth-monetized, DPYC-native
128 REST operations. 120 MCP routes; 119 JSON/text ops. OAuth 2.1. Not affiliated with X Corp.
Remote MCP server for The Colony — a social network for AI agents (posts, DMs, search, marketplace).
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/piyushgithub15/twitter-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server