Enables creation, management and publishing of X/Twitter posts, threads, and replies directly through chat interface, including draft management and direct tweet interactions
X(Twitter) MCP Server
English | 中文
An MCP server to create, manage and publish X/Twitter posts directly through Claude Desktop and Gemini CLI chat.
Note: This project is modified from vidhupv/x-mcp, with added reply functionality for tweets.
Features
- ✅ Create draft tweets
- ✅ Create draft tweet threads
- ✅ Create draft replies to existing tweets
- ✅ List all drafts
- ✅ Publish drafts (tweets, threads, and replies)
- ✅ Reply to tweets directly (without creating drafts)
- ✅ Delete drafts
- ✅ Draft preservation on publish failure
Quick Setup
Installing via Smithery
To install X(Twitter) MCP Server for Claude Desktop automatically via Smithery:
Manual Installation for Claude Desktop
- Clone the repository:
- Install UV globally using Homebrew in Terminal:
- Create claude_desktop_config.json:
- For MacOS: Open directory
~/Library/Application Support/Claude/
and create the file inside it - For Windows: Open directory
%APPDATA%/Claude/
and create the file inside it
- For MacOS: Open directory
- Add this configuration to claude_desktop_config.json:
- Get your X/Twitter API credentials:
- Go to X API Developer Portal
- Create a project
- In User Authentication Settings: Set up with Read and Write permissions, Web App type
- Set Callback URL to
http://localhost/
and Website URL tohttp://example.com/
- Generate and copy all keys and tokens from Keys and Tokens section
- Update the config file:
- Replace
/path/to/x-mcp
with your actual repository path - Add your X/Twitter API credentials
- Replace
- Quit Claude completely and reopen it
Configuration for Gemini CLI
If you want to use this MCP server with Gemini CLI instead of Claude Desktop:
- Install Gemini CLI:
- Create or update your MCP configuration file:
- Create a file named
~/.gemini/settings.json
- Add the following configuration:
- Create a file named
- Start Gemini CLI with MCP support:
- Update the config file:
- Replace
/path/to/x-mcp
with your actual repository path - Add your X/Twitter API credentials
- Replace
Usage Examples
Works with both Claude Desktop and Gemini CLI:
- "Tweet 'Just learned how to tweet through AI - mind blown! 🤖✨'"
- "Create a thread about the history of pizza"
- "Show me my draft tweets"
- "Publish this draft!"
- "Delete that draft"
- "Reply to tweet 1234567890 with 'Great point! Thanks for sharing.'"
- "Create a draft reply to tweet 1234567890 saying 'I completely agree with this perspective.'"
Troubleshooting
If not working:
- Make sure UV is installed globally (if not, uninstall with
pip uninstall uv
and reinstall withbrew install uv
) - Or find UV path with
which uv
and replace"command": "uv"
with the full path - Verify all X/Twitter credentials are correct
- Check if the x-mcp path in config matches your actual repository location
Credits
This project is based on the excellent work by Vidhu Panhavoor Vasudevan in the original x-mcp repository.
What's New in This Fork
- ✅ Reply to tweets functionality - Create draft replies and reply directly to existing tweets
- ✅ Enhanced draft management - Improved draft preservation on publish failure
- ✅ Better error handling - More detailed error messages and recovery options
Special thanks to the original author for creating the foundation of this MCP server!
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables creating, managing, and publishing X/Twitter posts, threads, and replies directly through Claude chat. Supports draft management with the ability to create, list, publish, and delete tweet drafts.