X

X-MCP服

一种允许克劳德通过聊天界面直接创建、管理和发布X/Twitter帖子的MCP服务器。

social-media

513 查看 · 2026-07-07 更新

简介

一种允许克劳德通过聊天界面直接创建、管理和发布X/Twitter帖子的MCP服务器。

简介

一种允许克劳德通过聊天界面直接创建、管理和发布X/Twitter帖子的MCP服务器。

X(Twitter) MCP 服务器

smithery 徽章

通过 Claude 聊天直接创建、管理和发布 X/Twitter 帖子的 MCP 服务器。

X(Twitter) 服务器 MCP 服务器

快速设置

通过 Smithery 安装

要通过 Smithery 自动为 Claude Desktop 安装 X(Twitter) MCP 服务器:

npx -y @smithery/cli install x-mcp --client claude

手动安装

  1. 克隆仓库:
git clone https://github.com/yourusername/x-mcp.git
  1. 使用 Homebrew 在终端中全局安装 UV:
brew install uv
  1. 创建 claude_desktop_config.json 文件:

    • 对于 MacOS:打开目录 ~/Library/Application Support/Claude/ 并在其中创建文件
    • 对于 Windows:打开目录 %APPDATA%/Claude/ 并在其中创建文件
  2. 将以下配置添加到 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" } } } }
  1. 获取您的 X/Twitter API 凭证:

    • 前往 X API 开发者门户
    • 创建一个项目
    • 在用户身份验证设置中:设置读写权限,Web 应用程序类型
    • 将回调 URL 设置为 http://localhost/,网站 URL 设置为 http://example.com/
    • 从密钥和令牌部分生成并复制所有密钥和令牌
  2. 更新配置文件:

    • /path/to/x-mcp 替换为您实际的仓库路径
    • 添加您的 X/Twitter API 凭证
  3. 完全退出 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 路径是否与您实际的仓库位置匹配

工具列表

  • create_draft_tweet: Create a draft tweet

  • create_draft_thread: Create a draft tweet thread

  • list_drafts: List all draft tweets and threads

  • publish_draft: Publish a draft tweet or thread

  • delete_draft: Delete a draft tweet or thread

服务配置

[{'mcpServers': {'x_mcp': {'args': ['--directory', '/path/to/x-mcp', 'run', 'x-mcp'], 'command': 'uv', 'env': {'TWITTER_ACCESS_TOKEN': 'your_access_token', 'TWITTER_ACCESS_TOKEN_SECRET': 'your_access_token_secret', 'TWITTER_API_KEY': 'your_api_key', 'TWITTER_API_SECRET': 'your_api_secret'}}}}]

来源