Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"x-twitter-mcp": {
"env": {
"TWITTER_API_KEY": "your_api_key",
"PYTHONUNBUFFERED": "1",
"TWITTER_API_SECRET": "your_api_secret",
"TWITTER_ACCESS_TOKEN": "your_access_token",
"TWITTER_BEARER_TOKEN": "your_bearer_token",
"TWITTER_ACCESS_TOKEN_SECRET": "your_access_token_secret"
},
"args": [],
"command": "x-twitter-mcp-server"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A Model Context Protocol (MCP) server for interacting with Twitter (X) via AI tools. This server allows you to fetch tweets, post tweets, search Twitter, manage followers, and more, all through natural language commands in AI Tools.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y '@rafaljanicki/x-twitter-mcp-server' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked @rafaljanicki/x-twitter-mcp-server against OSV.dev.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in communication
Asynchronous coordination layer for AI coding agents: identities, inboxes, searchable threads, and advisory file leases over FastMCP + Git + SQLite
An MCP server that securely interfaces with your iMessage database via the Model Context Protocol (MCP), allowing LLMs to query and analyze iMessage conversations. It includes robust phone number validation, attachment processing, contact management, group chat handling, and full support for sending and receiving messages.
Email & SMS infrastructure for AI agents — send and receive real email and text messages programmatically
A Model Context Protocol (MCP) server for interacting with Microsoft 365 and Office services through the Graph API
MCP Security Weekly
Get CVE alerts and security updates for X Twitter Mcp Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A Model Context Protocol (MCP) server for interacting with Twitter (X) via AI tools. This server allows you to fetch tweets, post tweets, search Twitter, manage followers, and more, all through natural language commands in AI Tools.
uv or pip for Python dependencies.To install X (Twitter) MCP server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @rafaljanicki/x-twitter-mcp-server --client claude
The easiest way to install x-twitter-mcp is via PyPI:
pip install x-twitter-mcp
If you prefer to install from the source repository:
Clone the Repository:
git clone https://github.com/rafaljanicki/x-twitter-mcp-server.git
cd x-twitter-mcp-server
Set Up a Virtual Environment (optional but recommended):
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
Install Dependencies:
Using uv (recommended, as the project uses uv.lock):
uv sync
Alternatively, using pip:
pip install .
Configure Environment Variables:
.env file in the project root (you can copy .env.example if provided).TWITTER_API_KEY=your_api_key
TWITTER_API_SECRET=your_api_secret
TWITTER_ACCESS_TOKEN=your_access_token
TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret
TWITTER_BEARER_TOKEN=your_bearer_token
get_bookmarks, delete_all_bookmarks), also add an OAuth 2.0 user access token:
TWITTER_OAUTH2_USER_ACCESS_TOKEN=your_oauth2_user_token
See Obtaining an OAuth 2.0 User Token below.The bookmark endpoints (GET /2/users/:id/bookmarks, DELETE /2/users/:id/bookmarks/:tweet_id) require OAuth 2.0 User Context — they reject both app-only bearer tokens and OAuth 1.0a. You need to perform the PKCE authorization flow once to obtain a user-scoped token.