home / mcp / twitter mcp server
Twitter MCP Tool
Configuration
View docs{
"mcpServers": {
"jalaj-pandey-twitter-mcp-tool": {
"command": "mcp",
"args": [
"dev",
"script.py"
],
"env": {
"X_api_key": "YOUR_API_KEY",
"X_api_key_sec": "YOUR_API_SECRET",
"GEMINI_API_KEY": "YOUR_GEMINI_API_KEY",
"X_access_token": "YOUR_ACCESS_TOKEN",
"X_bearer_token": "YOUR_BEARER_TOKEN",
"X_access_token_sec": "YOUR_ACCESS_TOKEN_SECRET"
}
}
}
}The Twitter MCP Tool automates common social media tasks with Python, helping you post tweets, fetch recent activity, track username changes, and send direct messages. It streamlines repetitive actions so you can focus on content strategy and engagement.
You run the Twitter MCP Tool through an MCP client, using the provided stdio configuration to start the local tool. After setting up authentication keys in your environment, you can perform core actions like posting tweets (with or without images), retrieving another userβs recent tweets, tracking username history, and sending direct messages.
{
"name": "twitter_mcp",
"type": "stdio",
"command": "mcp",
"args": ["dev", "script.py"],
"env": {
"X_api_key": "YOUR_API_KEY",
"X_api_key_sec": "YOUR_API_SECRET",
"X_access_token": "YOUR_ACCESS_TOKEN",
"X_access_token_sec": "YOUR_ACCESS_TOKEN_SECRET",
"X_bearer_token": "YOUR_BEARER_TOKEN",
"GEMINI_API_KEY": "YOUR_GEMINI_API_KEY"
}
}The following commands and files are used to set up and run the tool. Use them exactly as shown to ensure the MCP client can load and start the Twitter MCP Tool.
git clone https://github.com/jalaj-pandey/twitter-mcp-tool.git
uv venv
.venv\Scripts\activate
pip install -r requirements.txt
mcp dev script.pyPost tweets to Twitter, with optional images to accompany the text.
Track and retrieve the history of username changes for a Twitter account.
Retrieve the latest tweets from a public Twitter user's timeline.
Send a direct message to a Twitter user.