twitter mcp tool
A Python-based tool that streamlines social media tasks by enabling users to post tweets, track username changes, fetch recent tweets, and send direct messages on Twitter.
A Python-based tool that streamlines social media tasks by enabling users to post tweets, track username changes, fetch recent tweets, and send direct messages on Twitter.
This repository contains the Twitter MCP Tool, a tool designed to streamline social media tasks using Python. It includes features for tweeting, username change history, Fetch recent tweets, and Send a direct message to a user.
Post tweets with or without images directly to Twitter.
Track the username change history of any Twitter account.
Retrieve the latest tweets from any public Twitter user s timeline.
Send a private message directly to a Twitter user.
Clone the repo using
git clone https://github.com/jalaj-pandey/twitter-mcp-tool.git
Install dependencies:
uv venv
.venvScriptsactivate
pip install -r requirements.txt
mcp dev script.py
And if you want to install it in the claude desktop then use
pip install script.py
Create a .env
file with the following keys:
X_api_key=<your_twitter_api_key>
X_api_key_sec=<your_twitter_api_secret>
X_access_token=<your_twitter_access_token>
X_access_token_sec=<your_twitter_access_token_secret>
X_bearer_token=<your_twitter_bearer_token>
GEMINI_API_KEY=<your_gemini_api_key>
Open your claude desktop you will see the Twitter MCP Tool` is ready to use.
If not then Copy paste the config.json
into your claude_desktop_config.json
.
├── script.py # MCP core logic
├── .env # Environment variables
├── requirements.txt # Python dependencies
├── config.json # config file for claude desktop
└── readme.md # Project documentation