social-mediaapi-testingcommunication
357 查看 · 2026-07-07 更新
Twitter MCP 服务器
欢迎使用 Twitter MCP(多渠道平台)服务器!此应用程序通过多种强大的功能帮助您以编程方式管理您的 Twitter 账户。
功能
- 获取时间线: 检索您的 Twitter 主页时间线。
- 获取任何用户的推文: 获取来自任何公开 Twitter 用户的推文。
- 话题标签搜索: 搜索包含任何话题标签的推文(例如,
#AI)。 - 获取回复和摘要: 检索对推文的回复并获取总结性见解。
- 用户直接消息: 发送和接收 Twitter 私信。
- 创建帖子: 以编程方式创建新推文。
- 删除帖子: 通过 API 删除您的推文。
- 等等...

开始使用
前提条件
- Python 3.11+
- uvicorn(用于运行服务器)
- Twitter API 凭证(设置在
.env文件中)
安装
-
克隆此仓库。
-
安装依赖项: bash pip install -r requirements.txt
-
使用您的 Twitter API 凭证设置
.env文件(请参阅.env.example)。
运行应用程序
要启动服务器,请运行: bash uv run --with twikit --with mcp Path\src\tweet_service.py
{
"mcpServers": {
"twitter-mcp": {
"command": "uv",
"args": [
"--directory",
"Path\src\",
"run",
"--with",
"twikit",
"--with",
"mcp",
"tweet_service.py"
],
"env": {
"COOKIES_PATH": "Path\cookies.json",
"ENV_FILE": ".env"
}
}
}
}
欢迎贡献或建议新功能!
来源
- 来源:github
- 链接:https://github.com/LuniaKunal/mcp-twitter