Skip to main content
Glama

Twitter MCP Server

Twitter MCP サーバー

Twitter API 統合のためのモデル コンテキスト プロトコル サーバーの実装。

設定

  1. リポジトリをクローンする
  2. 依存関係をインストール: npm install
  3. .env.example.envにコピーし、Twitter API の認証情報を入力します。
  4. プロジェクトをビルドします: npm run build
  5. サーバーを起動します: npm start

環境変数

.envに必要な Twitter API 認証情報:

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

利用可能なツール

ツイート操作

  • postTweet : 新しいツイートを投稿する
    { "text": "Your tweet text here" }
  • postTweetWithMedia : メディアを添付したツイートを投稿する
    { "text": "Your tweet text", "mediaPath": "path/to/media/file", "mediaType": "image/jpeg|image/png|image/gif|video/mp4", "altText": "Optional alt text for accessibility" }
  • getTweetById : IDで特定のツイートを取得する
    { "tweetId": "tweet_id", "tweetFields": ["created_at", "public_metrics"] }
  • replyToTweet : 既存のツイートに返信する
    { "tweetId": "tweet_id", "text": "Your reply text" }
  • deleteTweet : ツイートを削除する
    { "tweetId": "tweet_id" }

検索と分析

  • searchTweets : ツイートを検索
    { "query": "search query", "maxResults": 10, "tweetFields": ["created_at", "public_metrics"] }
  • getHashtagAnalytics : ハッシュタグの分析情報を取得する
    { "hashtag": "hashtag", "startTime": "ISO-8601 date", "endTime": "ISO-8601 date" }

ユーザー操作

  • getUserInfo : ユーザー情報を取得する
    { "username": "twitter_username", "fields": ["description", "public_metrics"] }
  • getUserTimeline : ユーザーのツイートを取得する
    { "username": "twitter_username", "maxResults": 10, "tweetFields": ["created_at", "public_metrics"] }
  • getFollowers : ユーザーのフォロワーを取得する
    { "username": "twitter_username", "maxResults": 100, "userFields": ["description", "public_metrics"] }
  • getFollowing : ユーザーがフォローしているアカウントを取得する
    { "username": "twitter_username", "maxResults": 100, "userFields": ["description", "public_metrics"] }

婚約

  • likeTweet : ツイートにいいねする
    { "tweetId": "tweet_id" }
  • ツイートをunlikeTweetしない
    { "tweetId": "tweet_id" }
  • retweet : ツイートをリツイートする
    { "tweetId": "tweet_id" }
  • undoRetweet : リツイートを元に戻す
    { "tweetId": "tweet_id" }
  • getRetweets : ツイートをリツイートしたユーザーを取得する
    { "tweetId": "tweet_id", "maxResults": 100, "userFields": ["description", "public_metrics"] }
  • getLikedTweets : ユーザーが「いいね!」したツイートを取得する
    { "userId": "user_id", "maxResults": 100, "tweetFields": ["created_at", "public_metrics"] }

リスト管理

  • createList : 新しいリストを作成する
    { "name": "List name", "description": "List description", "isPrivate": false }
  • addUserToList : ユーザーをリストに追加する
    { "listId": "list_id", "username": "twitter_username" }
  • removeUserFromList : リストからユーザーを削除する
    { "listId": "list_id", "username": "twitter_username" }
  • getListMembers : リストのメンバーを取得する
    { "listId": "list_id", "maxResults": 100, "userFields": ["description", "public_metrics"] }

エラー処理

すべてのツールは標準化されたエラー応答を返します。

  • 不足しているパラメータ: Missing required parameter: parameter_name
  • APIエラー: Twitter APIからのエラーメッセージ
  • 見つからないエラー: リソースに適切な「見つからない」メッセージ

応答フォーマット

すべての成功した応答は次の形式に従います。

{ "content": [ { "type": "text", "text": "Operation result message" } ] }

発達

  • ビルド: npm run build
  • 開始: npm start
  • ウォッチモード: npm run dev
Here's a comprehensive status report of all Twitter tools: ## Working Tools (✓) 1. postTweet

ステータス: 正常に動作しています レスポンス: ツイートIDを返します 最新のテスト: 成功

2. getTweetById

ステータス: 正常に動作しています レスポンス: 完全なツイートデータを返します 最新のテスト: 成功

3. likeTweet & unlikeTweet

ステータス: 正常に動作しています 応答: アクションの確認 最新のテスト: 成功

4. retweet & undoRetweet

ステータス: 正常に動作しています 応答: アクションの確認 最新のテスト: 成功

5. replyToTweet

ステータス: 正常に動作しています レスポンス: 返信ツイートIDを返します 最新のテスト: 成功

6. getUserInfo

ステータス: 正常に動作しています 応答: ユーザープロファイルデータが完了しました 最新のテスト: 成功

7. followUser & unfollowUser

ステータス: 正常に動作しています 応答: アクションの確認 最新のテスト: 成功

8. createList

ステータス: 正常に動作しています 応答: リスト作成の確認 最新のテスト: 成功

9. getUserLists

ステータス: 正常に動作しています 応答: 所有リストとメンバーリストの両方を返します 最新のテスト: 成功

## Tools with Issues (⚠️) 1. getUserTimeline

ステータス: エラー 400 エラー: 無効なリクエストパラメータ 必要な修正: パラメータ検証

2. searchTweets

ステータス: エラー 400 エラー: 無効なリクエストパラメータ 必要な修正: クエリパラメータのフォーマット

3. getLikedTweets

ステータス: エラー 400 エラー: 無効なリクエストパラメータ 必要な修正: パラメータ検証

## Missing Tools (❌) - getHomeTimeline (not found in available tools) - getFollowers (not available) - getFollowing (not available) - getHashtagAnalytics (not available) ## Priority Fixes Needed 1. Parameter Validation: ```typescript // Implement for getUserTimeline, searchTweets, getLikedTweets interface TwitterParamValidator { validateTimelineParams(params: any): boolean; validateSearchParams(params: any): boolean; validateLikedTweetsParams(params: any): boolean; }
  1. エラー処理:
// Enhance error handling for 400 errors interface TwitterErrorHandler { handle400Error(endpoint: string, params: any): void; logErrorDetails(error: any): void; suggestParameterFixes(params: any): string[]; }
-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

モデル コンテキスト プロトコルを介して Twitter とのやり取りを可能にし、大規模な言語モデルによるツイートの投稿、ツイートの検索、ツイートへの返信を可能にします。

  1. 設定
    1. 環境変数
      1. 利用可能なツール
        1. ツイート操作
        2. 検索と分析
        3. ユーザー操作
        4. 婚約
        5. リスト管理
      2. エラー処理
        1. 応答フォーマット
          1. 発達

            Related MCP Servers

            • -
              security
              F
              license
              -
              quality
              Provides AI agents with comprehensive Twitter functionality through the Model Context Protocol standard, enabling reading tweets, posting content, managing interactions, and accessing timeline data with robust error handling.
              Last updated -
              4
              1
              JavaScript
              • Apple
            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol server that enables AI to interact with Twitter, allowing functions like searching tweets, comparing sentiments across accounts, and retrieving timeline content.
              Last updated -
              MIT License
            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol server that enables AI models and applications to interact directly with Twitter/X, providing capabilities to create posts, reply to tweets, retrieve user data, and manage account actions.
              Last updated -
              87
              4
              TypeScript
              MIT License
            • -
              security
              F
              license
              -
              quality
              A Model Context Protocol server that enables large language models to access the latest trending news headlines and detailed content across various categories including recommended, domestic, technology, and sports news.
              Last updated -
              Python
              • Apple

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/crazyrabbitLTC/mcp-twitter-server'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server