Supports environment variable configuration through .env files
Enables cloning the Twitter MCP repository from GitHub
Supported platform for running the Claude MCP configuration
Supported platform for running the Claude MCP configuration
Provides the runtime environment required for the MCP server (version 18.x or higher)
Used for package management and running the server
X (Twitter) MCP Server
This MCP server allows Clients to interact with X (formerly Twitter), enabling comprehensive platform operations including posting tweets, searching content, managing accounts, and organizing lists.
Quick Start
- Create an X Developer account and get your API keys from X Developer Portal
- Set all required API keys in the environment variables
- Clone this repository:
git clone https://github.com/Dishant27/twitter-mcp.git
- Install dependencies:
npm install
- Run the server:
- With environment variables:
- Using a
.env
file:
- Use with a MCP client, such as Claude.
Claude Configuration
To use this server with Claude, you'll need to set up the MCP configuration. Here's an example of how the configuration structure should look:
Save this configuration in your Claude MCP config directory, typically located at:
- Windows:
%APPDATA%\AnthropicClaude\mcp-servers
- macOS:
~/Library/Application Support/AnthropicClaude/mcp-servers
- Linux:
~/.config/AnthropicClaude/mcp-servers
Features
Post Operations
- Post content (up to 280 characters)
- Search for posts by query with customizable result count
Account Management
- Get profile information for any user or the authenticated account
- Update profile details (name, bio, location, website URL)
- Follow and unfollow users
- List followers for any user or the authenticated account
- List accounts that a user is following
List Management
- Create new lists (public or private)
- Get information about specific lists
- Retrieve all lists owned by the authenticated user
Available MCP Tools
Tool Name | Description |
---|---|
post_tweet | Post new content to X |
search_tweets | Search for content on X |
get_profile | Get profile information for a user or the authenticated account |
update_profile | Update the authenticated user's profile |
follow_user | Follow a user |
unfollow_user | Unfollow a user |
list_followers | List followers of a user or the authenticated account |
list_following | List accounts that a user or the authenticated account is following |
create_list | Create a new list |
get_list_info | Get information about a list |
get_user_lists | Get all lists owned by the authenticated user |
Requirements
- Node.js 18.x or higher
- X Developer account with API keys
- API v1 and v2 access
Environment Variables
Variable | Description |
---|---|
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 |
Repository Structure
License
MIT
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 interaction with X (formerly Twitter), allowing for posting tweets, searching content, managing accounts, and organizing lists.
Related MCP Servers
- AsecurityAlicenseAqualityServer for X (Twitter) integration that provides tools for reading your timeline and engaging with tweets. Designed for use with Claude desktop.Last updated -3230JavaScriptMIT License
- -securityAlicense-qualityEnables interaction with Twitter through a Model Context Protocol, allowing large language models to post tweets, search for tweets, and reply to tweets.Last updated -25318TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables AI models and applications to interact directly with Twitter/X, providing capabilities to create posts, reply to tweets, retrieve user data, and manage account actions.Last updated -108TypeScriptMIT License
- -securityFlicense-qualityA 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.Last updated -Python
Appeared in Searches
- A search for strategies to promote a directory website and generate ideas for solopreneur SAAS businesses
- Managing Social Media Content Creation Using Monday
- A guide to researching LinkedIn profiles and personalizing outreach based on customer persona and company signals
- How to access and manage bookmarks on X / Twitter
- Automating Business Processes in Marketing