X/Twitter
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.
What is X/Twitter?
X/Twitter is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 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 dra...
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.
This server falls under the Communication category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Enables creating, managing, and publishing X/Twitter posts,
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx x-twitter-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use X/Twitter
X/Twitter MCP Server is a Python-based MCP server that connects AI assistants to the X (formerly Twitter) API, enabling full tweet lifecycle management including posting tweets, creating threads, replying, searching, managing drafts, bookmarking, and retrieving timelines and trends. It supports 20+ tools covering user lookup, poll creation, reactions, and bookmark management, making it ideal for social media managers and developers who want to automate X content workflows directly from their AI assistant.
Prerequisites
- Python 3.10+ installed with pip
- A Twitter/X developer account with an approved app at https://developer.twitter.com
- TWITTER_API_KEY and TWITTER_API_SECRET (from your X app's OAuth 1.0a settings)
- TWITTER_ACCESS_TOKEN and TWITTER_ACCESS_TOKEN_SECRET (generated for your user account)
- TWITTER_BEARER_TOKEN (from your X app dashboard for read-only search operations)
Install from PyPI
Install the x-twitter-mcp package using pip.
pip install x-twitter-mcpCreate an X Developer App and obtain credentials
Go to https://developer.twitter.com/en/portal/dashboard, create a new app, enable OAuth 1.0a with Read and Write permissions, and generate your API key, API secret, access token, and access token secret.
Set your X API credentials as environment variables
Export all five credential environment variables. The bearer token is used for search and read operations; the OAuth tokens are required for posting and managing tweets.
export TWITTER_API_KEY=your_api_key
export TWITTER_API_SECRET=your_api_secret
export TWITTER_ACCESS_TOKEN=your_access_token
export TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret
export TWITTER_BEARER_TOKEN=your_bearer_tokenAdd the server to your MCP client config
Register the X Twitter MCP server in your Claude Desktop configuration with all required credential environment variables.
{
"mcpServers": {
"x-twitter": {
"command": "python",
"args": ["-m", "x_twitter_mcp"],
"env": {
"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"
}
}
}
}Restart your MCP client and verify
Restart Claude Desktop to load the new configuration. Ask it to get your Twitter profile to confirm authentication is working before attempting to post.
X/Twitter Examples
Client configuration
Claude Desktop configuration for the X/Twitter MCP server with all required OAuth credentials.
{
"mcpServers": {
"x-twitter": {
"command": "python",
"args": ["-m", "x_twitter_mcp"],
"env": {
"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",
"TWITTER_OAUTH2_USER_ACCESS_TOKEN": "optional_oauth2_token"
}
}
}
}Prompts to try
Example prompts for managing X/Twitter content through the AI assistant.
- "Post a tweet saying 'Hello from Claude! Testing my MCP integration #MCP'"
- "Search Twitter for recent tweets about Model Context Protocol, limit to 10"
- "Get the current trending topics on Twitter"
- "Show my Twitter timeline, latest 20 tweets"
- "Create a draft tweet about AI automation and save it for review before publishing"
- "Get the Twitter profile for @anthropic"Troubleshooting X/Twitter
401 Unauthorized errors when posting tweets
Posting requires OAuth 1.0a user authentication. Ensure TWITTER_ACCESS_TOKEN and TWITTER_ACCESS_TOKEN_SECRET are generated for your specific user account (not just the app), and that your X app has Read and Write permissions enabled — not just Read.
403 Forbidden when accessing search or timelines
Search and timeline access may require a paid X API tier (Basic or Pro). The free tier has very limited access. Check your app's access level at https://developer.twitter.com and upgrade if needed.
Bookmark tools fail with authentication errors
Bookmark operations require TWITTER_OAUTH2_USER_ACCESS_TOKEN, which is an OAuth 2.0 user token separate from the OAuth 1.0a tokens. Generate this through the OAuth 2.0 PKCE flow in your X developer app.
Frequently Asked Questions about X/Twitter
What is X/Twitter?
X/Twitter is a Model Context Protocol (MCP) server that 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. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install X/Twitter?
Follow the installation instructions on the X/Twitter GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with X/Twitter?
X/Twitter works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is X/Twitter free to use?
Yes, X/Twitter is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
X/Twitter Alternatives — Similar Communication Servers
Looking for alternatives to X/Twitter? Here are other popular communication servers you can use with Claude, Cursor, and VS Code.
Slack
★ 86.1kEnables interaction with Slack workspaces through comprehensive channel management, messaging, user management, file uploads, and Block Kit formatting. Features secure credential storage via macOS Keychain and supports all major Slack operations incl
LibreChat
★ 37.3kEnhanced ChatGPT Clone: Features Agents, MCP, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenA
Note Gen
★ 11.9kA cross-platform Markdown AI note-taking software.
DeepChat
★ 5.8k🐬DeepChat - A smart assistant that connects powerful AI to your personal world
WhatsApp MCP
★ 5.7kConnects AI assistants to the official Meta WhatsApp Cloud API for managing conversations and sending various message types through natural language. It provides tools for media management, template messages, and real-time webhook processing without
Apple
★ 3.1kEnables interaction with Apple apps like Messages, Notes, and Contacts through the MCP protocol to send messages, search, and open app content using natural language.
Browse More Communication MCP Servers
Explore all communication servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up X/Twitter in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use X/Twitter?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.