CM

crazyrabbitltc/mcp-twitter-server

开发工具

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

25 stars 9 forks 质量 66 趋势 0MIT

用于访问推特的模型上下文协议服务器

概览

一个全面的模型上下文协议服务器实现,适用于X(Twitter)API集成,具备专业工作流程自动化、增强的错误处理和实时文档。 - - 33个Twitter API + 20个增强版SocialData.tools研究功能 - - 线程分析、网络映射、情感分析、病毒式追踪 - - 增强研究工具无需专业级要求即可使用 - - 清晰的升级指导和优雅的API密钥处理 - - 预建自动化模板 - - 实时API文档和状态 - - 工具、提示和资源支持 - 节点。

概述(AI 翻译)

一个全面的模型上下文协议服务器实现,适用于X(Twitter)API集成,具备专业工作流程自动化、增强的错误处理和实时文档。

🚀 特色

  • 53 Total Tools- 33 个 Twitter API + 20 个增强版 SocialData.tools 研究功能
  • 高级分析 - 线程分析、网络映射、情感分析、病毒式追踪
  • 绕过API限制 - 增强型研究工具无需专业级要求即可使用
  • 专业错误处理 - 明确的升级指导和优雅的API密钥处理
  • 5 工作流程提示 - 预构建自动化模板
  • 6 动态资源 - 实时API文档和状态
  • 完全符合MCP标准 - 工具、提示和资源支持

📋 快速启动

先决条件

  • Node.js 18+
  • NPM或纱线
  • X(Twitter)API 凭证(基础级最低要求 - 每月 200 美元)

本地安装

  1. 克隆并安装

  2. 环境设置

必备环境变量:

  1. 建造并运行

  2. 测试服务器

🔑 X(Twitter)API 设置

所需资历

将这些添加到你的 .env 文件中:

API 访问级别

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

README

以下为原文 README 节选,完整内容请查看原文。

X (Twitter) MCP Server

A comprehensive Model Context Protocol server implementation for X (Twitter) API integration with professional workflow automation, enhanced error handling, and real-time documentation.

🚀 Features

  • 53 Total Tools - 33 Twitter API + 20 enhanced SocialData.tools research capabilities
  • Advanced Analytics - Thread analysis, network mapping, sentiment analysis, viral tracking
  • Bypasses API Restrictions - Enhanced research tools work without Pro tier requirements
  • Professional Error Handling - Clear upgrade guidance and graceful API key handling
  • 5 Workflow Prompts - Pre-built automation templates
  • 6 Dynamic Resources - Real-time API documentation and status
  • Full MCP Compliance - Tools, prompts, and resources support

📋 Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • X (Twitter) API credentials (Basic tier minimum - $200/month)

Local Installation

  1. Clone and Install

    git clone 
    cd twitter-server
    npm install
    
  2. Environment Setup

    cp .env.example .env
    # Edit .env with your credentials
    

    Required Environment Variables:

    # Twitter API credentials (Required)
    X_API_KEY=your_api_key_here
    X_API_SECRET=your_api_secret_here  
    X_ACCESS_TOKEN=your_access_token_here
    X_ACCESS_TOKEN_SECRET=your_access_token_secret_here
    
    # SocialData.tools API key (Optional - enables enhanced research tools)
    SOCIALDATA_API_KEY=your_socialdata_api_key_here
    SOCIALDATA_BASE_URL=https://api.socialdata.tools  # Optional, uses default if not set
    
  3. Build and Run

    npm run build
    npm start
    
  4. Test the Server

    # Test with JSON-RPC calls
    source .env && echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | node dist/index.js
    
    # Test specific tool
    source .env && echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "getUserInfo", "arguments": {"username": "elonmusk"}}}' | node dist/index.js
    

🔑 X (Twitter) API Setup

Required Credentials

Add these to your .env file:

X_API_KEY=your_api_key_here
X_API_SECRET=your_api_secret_here  
X_ACCESS_TOKEN=your_access_token_here
X_ACCESS_TOKEN_SECRET=your_access_token_secret_here

API Access Levels

Tier Cost Working Tools Limited Tools
Basic $200/month 18/22 tools searchTweets, getHashtagAnalytics
Pro $5,000/month All 22 tools None

🛠️ Available Tools (53 Total)

🐦 Twitter API Tools (33 tools)

✅ Tweet Operations (All Working)

  • postTweet - Post new tweets
  • getTweetById - Retrieve specific tweets
  • replyToTweet - Reply to tweets
  • deleteTweet - Delete your tweets

✅ Engagement (All Working)

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "x-twitter": { "command": "node", "args": ["/path/to/twitter-server/dist/index.js"], "env": { "X_API_KEY": "your_api_key", "X_API_SECRET": "your_api_secret", "X_ACCESS_TOKEN": "your_access_token", "X_ACCESS_TOKEN_SECRET": "your_access_token_secret" } } } }