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-mcpWhat's trending on Twitter?"
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
MCP (Model Context Protocol) server to interact with Twitter/X directly from any MCP-compatible AI assistant (like opencode). Uses your Twitter session cookies for authentication — no API keys needed.
Features
Post, delete, like, and retweet tweets
Search tweets by keyword
View home timeline, user timeline, and tweet details
Get current trending topics
Look up user profiles
Follow/unfollow users
Authenticated user profile info
Related MCP server: Twitter/X MCP Server
Quick Start
1. Get your Twitter cookies
Open Twitter/X in your browser (logged in)
Open DevTools (
F12) → Application → Cookies →https://x.comCopy the values for
auth_tokenandct0
2. Configure
cp .env.example .envEdit .env:
TWITTER_AUTH_TOKEN=seu_auth_token_aqui
TWITTER_CT0=seu_ct0_aqui3. Install dependencies
pip install -r requirements.txt4. Run
python server.pyThe server will start and listen on stdio, ready for MCP connections.
Register with opencode
Add to ~/.config/opencode/opencode.jsonc:
{
"mcpServers": {
"twitter": {
"command": "python3",
"args": ["/path/to/twitter-mcp/server.py"],
"env": {
"TWITTER_AUTH_TOKEN": "seu_token",
"TWITTER_CT0": "seu_ct0"
}
}
}
}Register with Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"twitter": {
"command": "python3",
"args": ["/caminho/para/twitter-mcp/server.py"],
"env": {
"TWITTER_AUTH_TOKEN": "seu_token",
"TWITTER_CT0": "seu_ct0"
}
}
}
}Register with Codex (by Cursor)
Create/edit ~/.codex/config.json:
{
"mcpServers": {
"twitter": {
"command": "python3",
"args": ["/caminho/para/twitter-mcp/server.py"],
"env": {
"TWITTER_AUTH_TOKEN": "seu_token",
"TWITTER_CT0": "seu_ct0"
}
}
}
}Tools
Tool | Description | Arguments |
| Post a tweet |
|
| Delete a tweet |
|
| Like a tweet |
|
| Retweet a tweet |
|
| Search tweets |
|
| Your home timeline |
|
| Tweets from a user |
|
| User profile info |
|
| Full tweet details |
|
| Current trending topics | — |
| Your own profile | — |
| Follow a user |
|
How it works
The server authenticates via auth_token and ct0 session cookies, then makes requests directly to the Twitter/X internal GraphQL API. Query IDs are extracted from the official Twitter web client bundle, so no API keys or OAuth are needed.
Tests
python -m pytest test_twitter.py -vCI
On every push to main, GitHub Actions runs all tests and automatically creates a tag (v1.YYYYMMDD.HHMM).
Project structure
├── server.py # MCP server entry point (12 tools via FastMCP)
├── twitter_client.py # HTTP client for Twitter GraphQL API
├── auth.py # Authentication via session cookies
├── test_twitter.py # Tests (16 tests, mocked API)
├── requirements.txt # Python dependencies
├── .env.example # Cookie config template
├── .github/workflows/ # CI pipeline
└── README.mdThis 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.
Latest Blog Posts
- 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/n8nfelipe/twitter-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server