MX

mbelinky/x-mcp-server

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

24 stars 9 forks 품질 65 트렌드 0MIT

X.com에 게시하는 포괄적 인 mcp 서버, oauth v1 및 v2뿐만 아니라 v1.1 및 v2 x API 구현

개요

향상된 모델 Context Protocol (MCP) 서버는 OAuth 2.0 지원, v2 API 미디어 업로드 및 원래 구현에 제한 된 종합 비율을 추가합니다. - : 선택 가능한 미디어 첨부 파일 (이미지, GIF)로 텍스트 트윗 생성 - : 사용자 정의 결과 카운트가있는 검색 X - : tweets programmatically 제거 - : OAuth 1.0a 및 OAuth 2.0에 대한 지원 - : 각 auth 방법의 적절한 API 버전을 사용하여 이미지 - : X의 API 제한을위한 내장 보호 - : Zod 유효성 검사와 전체 유형 스크립트 구현 이 서버는 인증 방법 및 운영을 기반으로 다른 X API 버전을 지능적으로 사용합니다. - : v2 API 엔드포인트 사용 - : v1.1 엔드포인트 사용 (upload.twitter.com) - : v2가 실패했을 때 자동으로 v1.1로 돌아갑니다. - : v2 API 엔드포인트 전용 사용 - : v2 엔드포인트 사용 (api.x.com/2/media/upload) - : 인증 제한으로 인해 v1.1로 돌아갈 수 없습니다. - : Legacy API는 OAuth 1과 함께 작동하지만 여전히 작동합니다.

개요(AI 번역)

향상된 모델 Context Protocol (MCP) 서버는 OAuth 2.0 지원, v2 API 미디어 업로드 및 원래 구현에 제한 된 종합 비율을 추가합니다.

✨ 특징

-Post Tweets: 선택된 미디어 첨부 파일 (images, GIF)로 텍스트 트윗 만들기 -검색 Tweets: customizable 결과 수와 X 검색 -Delete Tweets: tweets를 바로 제거

  • 듀얼 인증: OAuth 1.0a 및 OAuth 2.0 지원
  • 미디어 업로드: 각 auth 메소드에 적합한 API 버전을 사용하여 이미지
  • Rate Limiting: X의 API 제한을 위한 내장 보호
  • Type Safety: Zod 검증을 통한 Full TypeScript 구현

API 버전 처리

이 서버는 인증 방법 및 운영을 기반으로 다른 X API 버전을 지능적으로 사용합니다.

# # # OAuth 1.0a

  • **Tweet 운영 **: v2 API 엔드포인트 사용
  • 미디어 업로드: v1.1 엔드포인트 사용 (upload.twitter.com)
  • **Delete fallback **: v2가 실패할 때 v1.1로 자동적으로 돌아갑니다

오우스 2.0

  • ** 모든 운영 **: v2 API 엔드포인트를 독점적으로 사용합니다.
  • 미디어 업로드: v2 엔드포인트 사용 (api.x.com/2/media/upload)
  • ** v1.1 액세스 없음 ** : v1로 돌아올 수 없습니다.

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

X MCP Server - Enhanced Edition

An enhanced Model Context Protocol (MCP) server for X that adds OAuth 2.0 support, v2 API media uploads, and comprehensive rate limiting to the original implementation.

✨ Features

  • Post Tweets: Create text tweets with optional media attachments (images, GIFs)
  • Search Tweets: Search X with customizable result count
  • Delete Tweets: Remove your tweets programmatically
  • Dual Authentication: Support for both OAuth 1.0a and OAuth 2.0
  • Media Upload: Post images using the appropriate API version for each auth method
  • Rate Limiting: Built-in protection for X’s API limits
  • Type Safety: Full TypeScript implementation with Zod validation

🔄 API Version Handling

This server intelligently uses different X API versions based on authentication method and operation:

OAuth 1.0a

  • Tweet operations: Uses v2 API endpoints
  • Media upload: Uses v1.1 endpoint (upload.twitter.com)
  • Delete fallback: Automatically falls back to v1.1 when v2 fails

OAuth 2.0

  • All operations: Uses v2 API endpoints exclusively
  • Media upload: Uses v2 endpoint (api.x.com/2/media/upload)
  • No v1.1 access: Cannot fall back to v1.1 due to authentication restrictions

Why Different Endpoints?

  • v1.1: Legacy API, being phased out but still works with OAuth 1.0a
  • v2: Modern API with better features but some endpoints have issues
  • Media: OAuth 2.0 tokens cannot access v1.1 media endpoints, must use v2
  • Delete: v2 delete endpoint currently has issues (500 errors), v1.1 works as fallback

📋 Prerequisites

Before you begin, you’ll need:

  1. An X Developer Account (sign up at developer.x.com)
  2. An X App created in the Developer Portal
  3. API credentials (detailed setup below)
  4. Node.js 18+ installed

🔐 Authentication Setup

This server supports two authentication methods. Choose based on your needs:

  • OAuth 1.0a: Simpler setup, works with all features including v1.1 fallbacks
  • OAuth 2.0: Modern authentication, required for some newer features

Setting Up Your X App

  1. Create a Developer Account:

    • Go to developer.x.com
    • Sign in with your Twitter account
    • Apply for developer access if you haven’t already
  2. Create a New App:

    • Navigate to the Twitter Developer Portal
    • Click “Projects & Apps” → “New Project”
    • Give your project a name
    • Select your use case
    • Create a new App within the project
  3. Configure App Permissions:

    • In your app settings, go to “User authentication settings”
    • Click “Set up”
    • Enable OAuth 1.0a and/or OAuth 2.0
    • Set App permissions to “Read and write”
    • Add Callback URLs:
      • For OAuth 1.0a: http://localhost:3000/callback
GitHub에서 전체 README 보기

설치

npx -y @mbelinky/x-mcp-server
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "twitter-mcp": { "command": "npx", "args": ["-y", "@mbelinky/x-mcp-server"], "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" } } } }