X-MCP 2.0
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@X-MCP 2.0 Search for tweets about MCP servers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
X-MCP 2.0
MCP server for the X/Twitter API v2 with OAuth 2.0 PKCE authentication.
Use Claude to post tweets, search X, like, retweet, and more — with modern OAuth 2.0.
Why 2.0?
The original twitter-mcp uses OAuth 1.0a, which requires 4 separate keys and doesn't support newer API features. X-MCP 2.0 uses OAuth 2.0 with PKCE, the recommended auth method for Twitter API v2.
Feature | twitter-mcp | X-MCP 2.0 |
Auth | OAuth 1.0a (4 keys) | OAuth 2.0 PKCE (modern) |
Token refresh | No | Auto-refresh |
Post tweet | Yes | Yes |
Search | Yes | Yes |
Get tweet | No | Yes |
User profile | No | Yes |
Home timeline | No | Yes |
Like | No | Yes |
Retweet | No | Yes |
Reply | No | Yes |
User tweets | No | Yes |
MCP SDK | 0.6.0 | 1.x |
Related MCP server: Twitter MCP Server
Tools (10)
Tool | Description |
| Post a tweet (supports replies & quote tweets) |
| Search tweets by query |
| Get a specific tweet by ID |
| Get your profile info |
| Get any user's profile by username |
| Get your home timeline |
| Like a tweet |
| Retweet a tweet |
| Reply to a tweet |
| Get recent tweets from a user |
Setup
1. Get Twitter API Credentials
Go to developer.x.com and create an app
Under Keys and Tokens, find OAuth 2.0 Client ID and Client Secret
Under User authentication settings, click Set up:
App permissions: Read and write
Type of App: Web App, Automated App or Bot
Callback URI:
http://127.0.0.1:8739/callbackWebsite URL: your website or GitHub profile
2. Authorize (One-Time)
git clone https://github.com/JFan5/X-MCP-2.0.git
cd X-MCP-2.0
npm install
# Run the auth flow — opens browser for Twitter login
CLIENT_ID=your_client_id CLIENT_SECRET=your_client_secret npm run authThis saves tokens to ~/.x-mcp-tokens.json and prints the ACCESS_TOKEN and REFRESH_TOKEN.
3. Configure Claude
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"x-mcp": {
"command": "node",
"args": ["/path/to/X-MCP-2.0/dist/index.js"],
"env": {
"CLIENT_ID": "your_client_id",
"CLIENT_SECRET": "your_client_secret",
"ACCESS_TOKEN": "your_access_token",
"REFRESH_TOKEN": "your_refresh_token"
}
}
}
}Or for Claude Code, add to ~/.claude/settings.json:
{
"mcpServers": {
"x-mcp": {
"command": "node",
"args": ["/path/to/X-MCP-2.0/dist/index.js"],
"env": {
"CLIENT_ID": "your_client_id",
"CLIENT_SECRET": "your_client_secret",
"ACCESS_TOKEN": "your_access_token",
"REFRESH_TOKEN": "your_refresh_token"
}
}
}
}4. Build (if running from source)
npm run buildToken Refresh
If you included the REFRESH_TOKEN, X-MCP 2.0 automatically refreshes your access token when it expires (every 2 hours). No manual intervention needed.
Examples
Ask Claude:
"Post a tweet about my new open-source project"
"Search for tweets about GRPO reinforcement learning"
"What's on my Twitter timeline?"
"Like the top tweet about machine learning"
"Show me @kaboroevich's recent tweets"
License
MIT
Available Tools
10 toolsget_my_profileA
Get the authenticated user's X/Twitter profile.
Inputs: no named parameters.
get_timelineC
Get the authenticated user's home timeline.
Inputs: maxResults.
get_tweetB
Get a specific tweet by its ID.
Inputs: tweetId (required).
get_userB
Get a user's X/Twitter profile by username.
Inputs: username (required).
get_user_tweetsC
Get recent tweets from a specific user.
Inputs: username (required), maxResults.
like_tweetC
Like a tweet on X/Twitter.
Inputs: tweetId (required).
post_tweetB
Post a tweet to X/Twitter. Supports replies and quote tweets.
Inputs: text (required), replyToTweetId, quoteTweetId.
reply_to_tweetC
Reply to a specific tweet on X/Twitter.
Inputs: tweetId (required), text (required).
retweetB
Retweet a tweet on X/Twitter.
Inputs: tweetId (required).
search_tweetsC
Search for tweets on X/Twitter using a query string.
Inputs: query (required), maxResults.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools have distinct purposes, but `post_tweet` supports replies and quote tweets, making it partially overlapping with `reply_to_tweet`. Otherwise, tools are clearly separated.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., get_tweet, like_tweet, post_tweet), making them predictable and easy to understand.
10 tools is well-scoped for a Twitter/X API server, covering essential read and write operations without being too sparse or bloated.
The set covers core reading (profile, timeline, tweets, search) and writing (post, reply, like, retweet). Missing delete/unlike/unretweet, but these are minor gaps.
Related MCP Connectors
Publish and schedule tweets and threads on X (Twitter) from your AI assistant.
Search X (Twitter) posts and read profiles, followers, trends and X Articles. OAuth sign-in.
Hosted MCP server from TwitterAPI.io that gives AI agents read-only access to Twitter/X data. 12 tools: tweet search with X operators, user profiles, a user's latest tweets, followers and followings, replies, quotes, retweeters, mentions and trends. Connect at https://mcp.twitterapi.io/mcp with a TwitterAPI.io API key or account sign-in; usage is paid per result returned.
Lets Claude and AI agents post and schedule on Instagram, TikTok, LinkedIn and 5 more networks.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables 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.101MIT
- AlicenseAqualityCmaintenanceEnables seamless interaction with Twitter/X platform through Claude AI, allowing users to post tweets with images, search for tweets, and engage in conversations using natural language commands.1028 npm26MIT
- AlicenseBqualityDmaintenanceEnables posting tweets to X (Twitter) via the X API v2, using Claude.17MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with X (Twitter) API v2 for posting tweets, searching, liking, retweeting, and more through natural language.MIT