通过Claude聊天直接创建、管理和发布X/Twitter帖子的MCP服务器,为您提供便捷的社交内容管理体验。
通过Smithery可自动安装X/Twitter MCP服务器,只需执行以下命令:
npx -y @smithery/cli install x-mcp --client claude
git clone https://github.com/yourusername/x-mcp.git
brew install uv
创建claude_desktop_config.json文件:
~/Library/Application Support/Claude/
并在其中创建文件。%APPDATA%/Claude/
并在其中创建文件。将以下配置添加到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凭证:
http://localhost/
和网站URL为 http://example.com/
。更新配置文件:
/path/to/x-mcp
替换为您实际的仓库路径。完全退出Claude,然后重新打开它。
以下是一些使用示例,您可以在Claude聊天中输入这些指令:
如果无法使用该服务器,可参考以下解决方法:
pip uninstall uv
卸载,然后重新安装 brew install uv
)。"command": "uv"
。