What is X (Twitter) MCP server?
A Model Context Protocol (MCP) server for interacting with Twitter (X) via AI tools. It allows users to fetch tweets, post tweets, search Twitter, manage followers, and perform other actions through natural language commands in AI clients like Claude Desktop. The server uses Twitter API v2 with proper authentication (API keys and tokens) to minimize the risk of account suspensions.
How to use X (Twitter) MCP server?
Install via Smithery (recommended for Claude Desktop), from PyPI (pip install x-twitter-mcp), or from source. Set required Twitter API credentials as environment variables (TWITTER_API_KEY, TWITTER_API_SECRET, TWITTER_ACCESS_TOKEN, TWITTER_ACCESS_TOKEN_SECRET, TWITTER_BEARER_TOKEN). Run the server either as a Streamable HTTP service (Docker or local ASGI) or as a STDIO CLI script (x-twitter-mcp-server). For Claude Desktop, configure the server in claude_desktop_config.json with the appropriate command and environment variables.
Key features of X (Twitter) MCP server
- Fetch user profiles, followers, and following lists
- Post, delete, and favorite tweets
- Search Twitter for tweets and trends
- Manage bookmarks and timelines
- Built-in rate limit handling for the Twitter API
- Uses Twitter API v2 with proper authentication
- Complete implementation of Twitter API v2 endpoints
Use cases of X (Twitter) MCP server
- Fetch a user's Twitter profile via natural language prompts
- Post tweets directly from an AI assistant like Claude Desktop
- Search Twitter for recent tweets on a topic
- Retrieve current trending topics on Twitter
- Manage bookmarks (get bookmarks, delete all bookmarks) with an OAuth 2.0 user token
评论