A Model Context Protocol server allows to interact with Twitter, enabling posting tweets and searching Twitter.
claude mcp add --transport stdio enescinr-twitter-mcp npx -y @enescinar/twitter-mcp \ --env API_KEY="your_api_key_here" \ --env ACCESS_TOKEN="your_access_token_here" \ --env API_SECRET_KEY="your_api_secret_key_here" \ --env ACCESS_TOKEN_SECRET="your_access_token_secret_here"
How to use
This MCP server provides a bridge to Twitter, enabling clients to post tweets and search Twitter from within the MCP framework. It exposes two tools for Claude (or compatible clients): post_tweet, which posts a new tweet to your Twitter account, and search_tweets, which queries Twitter for recent tweets matching a given term or phrase. To use it, configure the MCP server in your client (for Claude Desktop in this example) with the provided credentials, then issue natural language requests that map to these tools, such as asking the assistant to post a message or fetch tweets about a topic. The server handles authentication using your Twitter API keys and tokens and routes requests to Twitter via the underlying MCP runtime.
How to install
Prerequisites:
- Node.js and npm installed on your system
- Access to an active Twitter Developer API project with API key, API secret key, Access token, and Access token secret
Step-by-step:
-
Ensure Node.js and npm are installed. Verify: node -v npm -v
-
Install dependencies and run from source (if cloning): git clone https://github.com/EnesCinr/twitter-mcp.git cd twitter-mcp npm install
-
Build the project (if a build step exists in this package): npm run build
-
Start the MCP server: npm start
-
Alternatively, use the provided npx command directly in your Claude Desktop config as shown in the Quick Start guide: { "mcpServers": { "twitter-mcp": { "command": "npx", "args": ["-y", "@enescinar/twitter-mcp"], "env": { "API_KEY": "your_api_key_here", "API_SECRET_KEY": "your_api_secret_key_here", "ACCESS_TOKEN": "your_access_token_here", "ACCESS_TOKEN_SECRET": "your_access_token_secret_here" } } } }
Additional notes
Environment variables are required to authenticate with Twitter: API_KEY, API_SECRET_KEY, ACCESS_TOKEN, and ACCESS_TOKEN_SECRET. If you encounter authentication errors, double-check that the keys are correct and that the Twitter app has the necessary permissions. Logs may be found at the platform-specific paths referenced in the README. When running via npx, you can prefix the command with OPENAI_API_KEY or other variables for evals as documented in the MCP evaluation guide. If you update API credentials, restart the MCP server to ensure changes take effect.
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud