Back to MCP directory
publicPublicdnsLocal runtime

Twitter MCP Server

一个MCP服务器项目,允许客户端通过Claude与Twitter进行交互,支持发推和搜索功能。

article

README

🚀 Twitter MCP 服务器

此MCP服务器允许客户端与Twitter交互,支持发布推文和搜索Twitter,为用户提供便捷的Twitter操作体验。

smithery badge

🚀 快速开始

  1. Twitter Developer Portal创建一个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

📄 许可证

MIT

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client