Twitter MCP Server

Twitter MCP Server

site icon
2025.03.12 183
TypeScriptTwitter 交互推文发布推文搜索交流协作
Twitter MCP Server 是一个允许客户端与 Twitter 进行交互的服务,支持发布推文和搜索推文。它通过提供两个工具(post_tweet 和 search_tweets)来实现这些功能,适用于需要通过 Claude 或其他客户端与 Twitter 进行交互的场景。
View on GitHub

Overview

基本能力

产品定位

Twitter MCP Server 是一个用于与 Twitter 进行交互的中间件服务,允许客户端通过 Claude 或其他工具发布和搜索推文。

核心功能

  1. 发布推文:通过 post_tweet 工具发布新的推文。
  2. 搜索推文:通过 search_tweets 工具搜索 Twitter 上的推文。

适用场景

  1. 通过 Claude 或其他客户端自动发布推文。
  2. 通过 Claude 或其他客户端搜索 Twitter 上的相关内容。

工具列表

  1. post_tweet:发布新的推文。
  2. search_tweets:搜索 Twitter 上的推文。

常见问题解答

  1. 日志位置
  2. Windows: %APPDATA%\Claude\logs\mcp-server-twitter.log
  3. macOS: ~/Library/Logs/Claude/mcp-server-twitter.log

使用教程

使用依赖

  1. 创建一个 Twitter 开发者账号并从 Twitter Developer Portal 获取 API 密钥。

安装教程

  1. 将以下配置添加到 Claude Desktop 配置文件中:
  2. Windows: %APPDATA%\Claude\claude_desktop_config.json
  3. 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。

调试方式

  1. 检查日志文件以获取调试信息:
  2. Windows: %APPDATA%\Claude\logs\mcp-server-twitter.log
  3. 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

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。