x-mcp
x-mcp
位于 X(Twitter)API v2 之前的 MCP 服务器。镜像:ghcr.io/robertdwhite/x-mcp。
清单位于 whitehouse-rke2(apps/ai/x-mcp/)。
读取是免费的。写入是两步的 — draft_post 返回预览以及一个
一次性使用的 confirm_token,在调用 publish_post 并传入该确切令牌之前不会发布任何内容。代理无法在一次调用中发布,因此始终会先出现人类可见的预览。当输出是公开且永久的时候,这一点很重要。
故意没有删除工具。删除是破坏性的且不可逆的;请从 X 应用中移除帖子。
工具
工具 | 类型 | 说明 |
| 读取 | 凭据所代表的账户 |
| 读取 | 按 ID 获取一条帖子 |
| 读取 | 从某个用户名获取最近的帖子 |
| 读取 | 对已验证账户的提及 |
| 读取 | 逆时间顺序的主页时间线 |
| 读取 | 最近 7 天的搜索(取决于计划) |
| 暂存 | 验证 + 预览。不发布任何内容。 |
| 读取 | 已暂存的草稿及其剩余 TTL |
| 写入 | 发布草稿。公开且永久。 |
草稿存储在内存中:重启会清除它们,因此过期的确认令牌永远不会 比显示预览的进程存活更久。
Related MCP server: pyX-MCP
端点
POST /mcp— 可流式 HTTP MCP,受Authorization: Bearer $MCP_TOKEN保护GET /healthz— 开放,用于存活/就绪检查
所有其他路径返回 404,而不是 401 — 包括 MCP 客户端在启动时进行的 /.well-known/oauth-* 探测。那里的 401 会使客户端尝试交互式 OAuth 流程,这会导致无头客户端因连接超时而挂起。
配置
| 环境变量 | 必需 | 用途 |
| ----------------------- | --------- ----------------------------------------------- |
| MCP_TOKEN | 推荐 | /mcp 的 Bearer。未设置 = 未认证。 |
| X_API_KEY | 是 | 消费者密钥 |
| X_API_SECRET | 是 | 消费者密钥 |
| XACCESS_TOKEN | 是 | 访问令牌(用户上下文) |
| X_ACCESS_TOKEN_SECRET |是 | 访问令牌密钥 |
| X_MAXARS | 否 | 长度限制,默认 280。为高级版。 | | _DRAFT_T | 否 | 草稿生命周期(秒),默认 `` | |X_TIMEOUT | 否 | 超时默认30` |
对 X 的认证是OAuth 1.0a 用户上下文**,每个请求都签名。仅应用 Bear 令牌无法发布,因为发布是以账户身份进行的。从具有 读取和写入 权限 X 应用获取值:消费者密钥以及为你的账户生成的一对访问令牌/密钥。
如果凭据缺失,每个工具都会返回清晰的“未配置”错误,而不是堆栈跟踪 — 因此服务可以在凭据存在之前部署。
关于 X API 计划的说明
写入访问受 X 付费 API 层级限制,免费层级受到严格限制。来自此服务器的 429 会在 X 提供时显示速率限制重置时间。如果写入立即失败,请查看 developer.x.com上的计划。
本地运行
pip install -r requirements.txt
MCP_TOKEN=dev X_API_KEY=... X_API_SECRET=... \
X_ACCESS_TOKEN=... X_ACCESS_TOKEN_SECRET=... python server.pyThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables interacting with Twitter/X through natural language, including searching tweets, posting, sending DMs, and managing timelines via any MCP client.8MIT
- FlicenseAqualityDmaintenanceEnables AI assistants to post, search, and manage tweets on X (Twitter) via the MCP protocol.102
- FlicenseAqualityDmaintenanceEnables interaction with the X (Twitter) API through MCP tools for managing users, posts, bookmarks, likes, and lists. Supports markdown or JSON output and uses OAuth 2.0 PKCE authentication.22
- AlicenseAqualityBmaintenanceMCP server for the Twitter/X read API, enabling search, user profiles, tweets, followers, and more via natural language.94149MIT
Related MCP Connectors
FastMCP server for posting formatted content to X (Twitter) — Tollbooth-monetized, DPYC-native
128 REST operations. 120 MCP routes; 119 JSON/text ops. OAuth 2.1. Not affiliated with X Corp.
Bluesky MCP — wraps the AT Protocol API
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/RobertDWhite/x-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server