X-MCP 2.0

X-MCP 2.0

Enables users to interact with X/Twitter via Claude, allowing posting tweets, searching, liking, retweeting, and more using OAuth 2.0 PKCE authentication.

Category
访问服务器

README

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

Tools (10)

Tool Description
post_tweet Post a tweet (supports replies & quote tweets)
search_tweets Search tweets by query
get_tweet Get a specific tweet by ID
get_my_profile Get your profile info
get_user Get any user's profile by username
get_timeline Get your home timeline
like_tweet Like a tweet
retweet Retweet a tweet
reply_to_tweet Reply to a tweet
get_user_tweets Get recent tweets from a user

Setup

1. Get Twitter API Credentials

  1. Go to developer.x.com and create an app
  2. Under Keys and Tokens, find OAuth 2.0 Client ID and Client Secret
  3. 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/callback
    • Website 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 auth

This 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 build

Token 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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选