X-MCP服
一种允许克劳德通过聊天界面直接创建、管理和发布X/Twitter帖子的MCP服务器。
可用工具 (5 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
create_draft_tweet 1 个参数 需填 1 项
Create a draft tweet
必填参数:content
create_draft_thread 1 个参数 需填 1 项
Create a draft tweet thread
必填参数:contents
list_drafts
List all draft tweets and threads
该工具无需必填参数,直接调用即可
publish_draft 1 个参数 需填 1 项
Publish a draft tweet or thread
必填参数:draft_id
delete_draft 1 个参数 需填 1 项
Delete a draft tweet or thread
必填参数:draft_id
服务介绍
X(Twitter) MCP 服务器
通过 Claude 聊天直接创建、管理和发布 X/Twitter 帖子的 MCP 服务器。
快速设置
通过 Smithery 安装
要通过 Smithery 自动为 Claude Desktop 安装 X(Twitter) MCP 服务器:
npx -y @smithery/cli install x-mcp --client claude
手动安装
- 克隆仓库:
git clone https://github.com/yourusername/x-mcp.git
- 使用 Homebrew 在终端中全局安装 UV:
brew install uv
-
创建 claude_desktop_config.json 文件:
- 对于 MacOS:打开目录
~/Library/Application Support/Claude/并在其中创建文件 - 对于 Windows:打开目录
%APPDATA%/Claude/并在其中创建文件
- 对于 MacOS:打开目录
-
将以下配置添加到 claude_desktop_config.json 中:
{
"mcpServers": {
"x_mcp": {
"command": "uv",
"args": [
"--directory",
"/path/to/x-mcp",
"run",
"x-mcp"
],
"env": {
"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"
}
}
}
}
-
获取您的 X/Twitter API 凭证:
- 前往 X API 开发者门户
- 创建一个项目
- 在用户身份验证设置中:设置读写权限,Web 应用程序类型
- 将回调 URL 设置为
http://localhost/,网站 URL 设置为http://example.com/ - 从密钥和令牌部分生成并复制所有密钥和令牌
-
更新配置文件:
- 将
/path/to/x-mcp替换为您实际的仓库路径 - 添加您的 X/Twitter API 凭证
- 将
-
完全退出 Claude 并重新打开它
使用示例
- "Tweet 'Just learned how to tweet through AI - mind blown! 🤖✨'"
- "Create a thread about the history of pizza"
- "Show me my draft tweets"
- "Publish this draft!"
- "Delete that draft"
故障排除
如果无法正常工作:
- 确保已全局安装 UV(如果没有,请使用
pip uninstall uv卸载,然后使用brew install uv重新安装) - 或者使用
which uv查找 UV 的路径,并将"command": "uv"替换为完整路径 - 验证所有 X/Twitter 凭证是否正确
- 检查配置中的 x-mcp 路径是否与您实际的仓库位置匹配