x-wing-mcp
An MCP server for X (Twitter) that enables creating posts, threads, likes, follows, and DMs, plus reading posts, timelines, mentions, and search results via a unified OAuth 2.0 connection.
README
x-wing-mcp
A stdio MCP server for X (Twitter) that combines x-wing write tools with x_data read tools.
All tools share one process, one .env, and one official xdk OAuth 2.0 app.
Tools
Write tools
| Tool | Description | Required scope |
|---|---|---|
post |
Create a single post | tweet.write |
create_thread |
Create a multi-post thread | tweet.write |
like |
Like a post | like.write |
repost |
Repost a post | tweet.write |
follow |
Follow a user by ID | follows.write |
unfollow |
Unfollow a user by source/target ID | follows.write |
dm_send |
Send a direct message | dm.write |
Read tools
| Tool | Description | Required scope |
|---|---|---|
x_fetch_urls |
Fetch exact public posts by URL/ID | tweet.read |
x_read_user_posts |
Recent posts for one user | tweet.read + users.read |
x_search_posts |
Search public posts | tweet.read |
x_read_owned_timeline |
Authenticated account timeline | tweet.read |
x_read_mentions |
Mentions for the authenticated account | tweet.read |
x_read_thread |
Thread/conversation from an anchor post | tweet.read |
x_read_replies |
Replies to one post | tweet.read |
x_read_quotes |
Quote posts of one post | tweet.read |
x_read_follow_graph |
Followers/following for one user | follows.read |
x_read_article |
Published X Article via wrapper tweet | tweet.read |
x_collect_posts |
One-shot bulk collection query | tweet.read |
x_data_status |
Server/provider status | none |
x_data_healthcheck |
Provider diagnostics | none |
Read tools use an internal provider router (official_x, syndication, socialdata, getxapi).
max_cost_usd is required on every read tool except status/healthcheck.
Provisioning
- Ensure this repo's
.envexists and is readable only by the owner:chmod 600 .env - Populate
.envwith OAuth 2.0 credentials from the X developer portal:Legacy aliases (X_OAUTH2_CLIENT_ID=... X_OAUTH2_CLIENT_SECRET=... X_OAUTH2_ACCESS_TOKEN=... X_OAUTH2_REFRESH_TOKEN=... X_OAUTH2_SCOPES="offline.access dm.read tweet.write like.write like.read users.read dm.write tweet.read bookmark.write follows.write follows.read"X_CLIENT_ID,X_CLIENT_SECRET,X_ACCESS_TOKEN,X_REFRESH_TOKEN,X_SCOPES) are also accepted. - Optional paid/backup providers:
Leave blank to rely onSOCIALDATA_API_KEY=... GETXAPI_API_KEY=...official_x+syndicationonly. - If the access token is expired, run the included OAuth setup script or use the CLI refresh path to obtain a fresh token.
Running
python -m server
The server speaks MCP over stdio. stdout is the MCP protocol stream — no other process should write to it.
Testing
python -m pytest tests/ -q
Project layout
.
├── .env # real tokens, gitignored, chmod 600
├── .env.example # committed template
├── .gitignore # ignores .env and auth-state files
├── pyproject.toml # x-wing-mcp package metadata
├── README.md # this file
├── x_client.py # vendored + patched x-wing client
├── oauth_setup.py # vendored + patched OAuth setup
├── server.py # FastMCP stdio server (read + write tools)
├── xdata/ # vendored x_data read providers/router/server
├── config/ # provider routing configuration
└── tests/ # vendored + new MCP tests
Verification results
python -c "import x_client; print(x_client.env_path)"→<repo_root>/.env- MCP handshake via the wrapper script:
initialize→tools/listreturns exactly the 20 tools above. x_data_statusreports all configured providers healthy when tokens/keys are present.- Live token check via
_validate_access_tokenagainstusers/me: valid after refresh (access token refreshed successfully;.envand auth-state remain 0600).
Deployment notes
- This repo is repo-relative; it can be relocated without changes.
- Tokens live only in
<repo_root>/.env. After migration, no X OAuth tokens should remain in~/.hermes/.envor profile.envfiles. - The merged x-wing Hermes MCP server is wired into:
~/.hermes/config.yaml(default / main profile)~/.hermes/profiles/yan-cgo/config.yaml~/.hermes/profiles/scout/config.yaml— read-only viatools.excludeon the 7 write tools
- Wrapper script:
x-wing-mcp-hermes.sh(repo root, executable). It deliberately does not source~/.hermes/.env; the server reads tokens exclusively from<repo_root>/.env.
Roadmap
See AGENTS.md. Repo reconciliation is
already complete: this repo (bob0x-ai/x-wing-mcp) is the canonical source of truth.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。