使用说明
MCP X服务器
极简主义X(推特)MCP服务器,配备32个克劳德代码工具。
快速安装(3个步骤)
# 1. Clone and setup
git clone https://github.com/bigsky77/mcp-x-server.git
cd mcp-x-server
./scripts/setup.sh
# 2. Add your cookies (export from browser while logged into twitter.com)
# Save to config/cookies.json
# 3. Add to Claude Code
claude mcp add mcp-x-server "$(pwd)/venv/bin/python" -m src.server
测试其工作原理:
claude mcp call mcp-x-server search_tweets '{"query":"AI", "limit":1}'
所得
32个MCP工具 按类别组织:
基本操作(10个工具)
- 搜索推文,获取用户资料、时间线、提及
- 发布推文、回复、点赞、转发、删除
参与度和背景(5个工具)
- 引用带有评论的推文
- 获取完整的对话线索
- 看看谁转发了推特
关系(4个工具)
- 关注/取消关注用户
- 获取关注者和关注列表
适度(6工具)
- 与推特不同,删除转发
- 静音/取消静音,阻止/取消阻止用户
列表(3个工具)
- 创建和管理推特列表
- 在列表中添加/删除用户
发现(3个工具)
- 搜索用户
- 为推文添加书签
- 检查费率限制
看 docs/API_REFERENCE.md文件 获取完整的刀具参数。
用法
用自然语言问克劳德:
"Search for tweets about AI"
"Get the latest tweets from @sama"
"Post a tweet: Hello from MCP X Server!"
"Quote tweet 1234567890 with: Great insights!"
"Get the full conversation thread for tweet 1234567890"
"Follow @elonmusk and add them to my AI Leaders list"
"Create a private list called AI Researchers"
"Check my rate limits"
建筑
简单的三文件设计:
twikit_client.py-写入操作(发布、点赞等)twscrape_client.py-读取操作(搜索、获取)server.py-带32个工具的MCP服务器
身份验证: 基于Cookie(从浏览器导出) 费率限制: 约300次读取/15分钟,约50次写入/24小时
状态
✅ 所有32个工具功能齐全 (成功率100%)
故障排除
服务器未启动?
# Check Python version (need 3.10+)
python3 --version
# Manually test
cd mcp-x-server
source venv/bin/activate
python -m src.server
# Press Ctrl+C to stop
Cookie问题?
# Validate cookies file
cat config/cookies.json | python -m json.tool
从其他目录安装?
# From your project directory
git clone https://github.com/bigsky77/mcp-x-server.git
cd mcp-x-server
./scripts/setup.sh
# Add cookies to config/cookies.json
claude mcp add mcp-x-server "$(pwd)/venv/bin/python" -m src.server
需求
- Python 3.10+
- X(推特)帐户Cookie
- 已安装克劳德代码
项目结构
mcp-x-server/
├── config/
│ ├── config.yaml # Server configuration
│ └── cookies.json # Auth cookies (you provide)
├── src/
│ ├── server.py # MCP server (32 tools)
│ ├── auth/ # Cookie authentication
│ ├── clients/ # TwiKit + Twscrape clients
│ └── utils/ # Rate limiting
├── scripts/
│ ├── setup.sh # Install dependencies
│ └── verify.sh # Test installation
└── docs/
└── API_REFERENCE.md # Complete tool documentation
文档
- API_REFERENCE.md -带参数的完整工具列表
- GitHub问题 -报告错误
贡献
欢迎投稿!重点领域:
- 添加更多参与工具
- 改进错误处理
- 添加媒体上传支持
许可证
MIT许可证-有关详细信息,请参阅许可证文件
内置: TwiKit、Twscrape、MCP SDK 兼容: 克劳德密码(人类学)
