Twitter MCP Server is an MCP server that provides tools for interacting with Twitter (X) directly through Model Context Protocol clients. Built on the agent-twitter-client library, it connects AI assistants to Twitter to perform read, write, and social management operations. AI developers and automation engineers use it to enable language models to query timelines, search posts, publish content, and manage account interactions. The server enables users to fetch tweets from profiles, search by keywords or hashtags, and retrieve home, following, or user timelines. It also supports posting new tweets with optional media attachments such as JPEG, PNG, GIF, or MP4 files, publishing multi-tweet threads, liking or retweeting posts, and following or unfollowing accounts. In addition, the server offers tools for fetching trending topics, inspecting followers or following relationships, and reading Twitter lists, all managed with rate limiting and structured text responses over stdio.
Category: Communication & Messaging
Tags: microblogging, social-media, twitter, x
bash npm install 2. Build the project: bash npm run build 3. Configure required environment variables for authentication: bash TWITTER_USERNAME=your_username TWITTER_PASSWORD=your_password TWITTER_EMAIL=your_email Optional Twitter API credentials can also be set (TWITTER_API_KEY, TWITTER_API_SECRET_KEY, TWITTER_ACCESS_TOKEN, TWITTER_ACCESS_TOKEN_SECRET). 4. Register the server in your Claude Desktop configuration file (claude_desktop_config.json): json { "mcpServers": { "twitter-mcp-server": { "command": "/path/to/twitter-mcp-server/build/index.js" } } } 5. Restart your MCP client to load the tools.Part of MCP Servers
You can install Twitter MCP Server by cloning its repository from GitHub, running npm install, and building the project with npm run build. Then, supply your Twitter account credentials as environment variables and configure your MCP client to execute the compiled build/index.js file over standard input and output.
Twitter MCP Server allows an AI client to read user profiles, search tweets by keywords or hashtags, and fetch home, following, or user timelines. It also supports posting single tweets, attaching images or videos, creating threads, liking, retweeting, following or unfollowing users, reading lists, and tracking trending topics.
Twitter MCP Server works with any client that implements the Model Context Protocol over stdio transport. It is tested and documented for Claude Desktop on macOS and Windows, and developers can also test and inspect tools locally using the MCP Inspector.
Yes, Twitter MCP Server is open source and distributed under the MIT License on GitHub. You can freely inspect the codebase, modify the implementation, and contribute improvements via pull requests.