返回市场
推特-MCP

推特-MCP

作者:EnesCinr325 星标更新:2025-07-18

项目介绍

【技术文档摘要】: MseeP.ai 安全评估徽章

Twitter MCP 服务器

smithery 徽章

此MCP服务器允许客户端与Twitter进行交互,支持发布推文和搜索Twitter。

<a href="https://glama.ai/mcp/servers/dhsudtc7cd"> <img width="380" height="200" src="https://gips1.baidu.com/it/u=3136730966,846971726&fm=3081&app=3081&f=PNG?w=760&h=400" alt="Twitter Server MCP 服务器" /> </a>

快速开始

  1. 创建一个Twitter开发者账户,并从Twitter开发者门户获取您的API密钥。

  2. 将以下配置添加到您的Claude Desktop配置文件中:

Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "twitter-mcp": {
      "command": "npx",
      "args": ["-y", "@enescinar/twitter-mcp"],
      "env": {
        "API_KEY": "your_api_key_here",
        "API_SECRET_KEY": "your_api_secret_key_here",
        "ACCESS_TOKEN": "your_access_token_here",
        "ACCESS_TOKEN_SECRET": "your_access_token_secret_here"
      }
    }
  }
}
  1. 重启Claude Desktop

就这样!Claude现在可以通过两个工具与Twitter进行交互:

  • post_tweet: 发布新推文
  • search_tweets: 搜索推文

示例用法

尝试询问Claude:

  • "你能发布一条推文说'来自Claude的问候!'"
  • "你能搜索关于Claude AI的推文吗?"

故障排除

日志可以在以下位置找到:

  • Windows: %APPDATA%\Claude\logs\mcp-server-twitter.log
  • macOS: ~/Library/Logs/Claude/mcp-server-twitter.log

开发

如果您想贡献或从源码运行:

  1. 克隆仓库:
git clone https://github.com/EnesCinr/twitter-mcp.git
cd twitter-mcp
  1. 安装依赖项:
npm install
  1. 构建:
npm run build
  1. 运行:
npm start

运行评估

评估包加载了一个mcp客户端,然后运行index.ts文件,因此在测试之间无需重新构建。您可以通过在npx命令前缀中加载环境变量。完整的文档可以在这里找到:这里

OPENAI_API_KEY=your-key  npx mcp-eval src/evals/evals.ts src/index.ts

许可证

MIT