ET

enescinr/twitter-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

407 stars 58 forks 质量 66 趋势 19MIT

enescinr/twitter-mcp 是从 https://github.com/enescinr/twitter-mcp. 导入的 MCP 服务器候选

概览

enescinr/twitter-mcp 是从 https://github.com/enescinr/twitter-mcp. 导入的 MCP 服务器候选

概述(AI 翻译)

该MCP服务器允许客户端与Twitter交互,从而发布推文和搜索Twitter。

快速启动

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

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

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

  1. 重启 Claude Desktop

就是这样!Claude现在可以通过两个工具与Twitter互动:

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

示例用法

试着问问克劳德:

  • “你能发一条推文说’Claude问好’吗!”
  • “你能搜索关于Claude AI的推文吗?”

故障排除

日志可在以下网站找到:

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

发展

如果你想贡献或直接使用源代码:

  1. 克隆仓库:

  2. 安装依赖:

  3. 构建:

  4. 跑步:

正在进行评估

evals 包加载一个 mcp 客户端,然后运行 index.ts 文件,因此测试之间无需重建。

本页由 AI 翻译,技术细节请以原文为准。

README

Twitter MCP Server

This MCP server allows Clients to interact with Twitter, enabling posting tweets and searching Twitter.

Quick Start

  1. Create a Twitter Developer account and get your API keys from Twitter Developer Portal

  2. Add this configuration to your Claude Desktop config file:

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. Restart Claude Desktop

That’s it! Claude can now interact with Twitter through two tools:

  • post_tweet: Post a new tweet
  • search_tweets: Search for tweets

Example Usage

Try asking Claude:

  • “Can you post a tweet saying ‘Hello from Claude!’”
  • “Can you search for tweets about Claude AI?”

Troubleshooting

Logs can be found at:

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

Development

If you want to contribute or run from source:

  1. Clone the repository:
git clone https://github.com/EnesCinr/twitter-mcp.git
cd twitter-mcp
  1. Install dependencies:
npm install
  1. Build:
npm run build
  1. Run:
npm start

Running evals

The evals package loads an mcp client that then runs the index.ts file, so there is no need to rebuild between tests. You can load environment variables by prefixing the npx command. Full documentation can be found here.

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

License

MIT

在 GitHub 查看完整 README

安装

npx -y @enescinar/twitter-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "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" } } } }