Skip to main content
Glama

X (Twitter) MCP Server

by Dishant27

X (Twitter) MCP サーバー

この MCP サーバーにより、クライアントは X (旧 Twitter) と対話できるようになり、ツイートの投稿、コンテンツの検索、アカウントの管理、リストの整理などの包括的なプラットフォーム操作が可能になります。

クイックスタート

  1. X 開発者アカウントを作成し、 X 開発者ポータルから API キーを取得します。
  2. 必要なAPIキーをすべて環境変数に設定する
  3. このリポジトリをクローンします: git clone https://github.com/Dishant27/twitter-mcp.git
  4. 依存関係をインストール: npm install
  5. サーバーを実行します。
  • 環境変数を使用する場合:
TWITTER_API_KEY=your_api_key \ TWITTER_API_SECRET=your_api_secret \ TWITTER_ACCESS_TOKEN=your_access_token \ TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret \ npm start
  • .envファイルの使用:
# Create a .env file with your X API keys echo "TWITTER_API_KEY=your_api_key TWITTER_API_SECRET=your_api_secret TWITTER_ACCESS_TOKEN=your_access_token TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret" > .env # Start the server npm start
  1. Claude などの MCP クライアントで使用します。

クロード・コンフィグレーション

このサーバーをClaudeで使用するには、MCP設定を行う必要があります。設定例を以下に示します。

{ "name": "x", "display_name": "X", "description": "X MCP allows Claude to interact with X (formerly Twitter)", "path": "path/to/twitter-mcp/dist/index.js", "startup": { "env": { "TWITTER_API_KEY": "your_api_key", "TWITTER_API_SECRET": "your_api_secret", "TWITTER_ACCESS_TOKEN": "your_access_token", "TWITTER_ACCESS_TOKEN_SECRET": "your_access_token_secret" } }, "transport": "stdio" }

この構成を、通常次の場所にある Claude MCP 構成ディレクトリに保存します。

  • Windows: %APPDATA%\AnthropicClaude\mcp-servers
  • macOS: ~/Library/Application Support/AnthropicClaude/mcp-servers
  • Linux: ~/.config/AnthropicClaude/mcp-servers

特徴

ポストオペレーション

  • 投稿内容(最大280文字)
  • カスタマイズ可能な結果件数でクエリによる投稿を検索

アカウント管理

  • 任意のユーザーまたは認証されたアカウントのプロフィール情報を取得する
  • プロフィールの詳細(名前、経歴、所在地、ウェブサイトの URL)を更新します
  • ユーザーのフォローとフォロー解除
  • 任意のユーザーまたは認証されたアカウントのフォロワーを一覧表示します
  • ユーザーがフォローしているアカウントを一覧表示する

リスト管理

  • 新しいリストを作成する(公開または非公開)
  • 特定のリストに関する情報を取得する
  • 認証されたユーザーが所有するすべてのリストを取得する

利用可能なMCPツール

ツール名説明
post_tweetXに新しいコンテンツを投稿する
search_tweetsXでコンテンツを検索
get_profileユーザーまたは認証されたアカウントのプロフィール情報を取得する
update_profile認証されたユーザーのプロフィールを更新する
follow_userユーザーをフォローする
unfollow_userユーザーのフォローを解除する
list_followersユーザーまたは認証されたアカウントのフォロワーを一覧表示する
list_followingユーザーまたは認証されたアカウントがフォローしているアカウントを一覧表示する
create_list新しいリストを作成する
get_list_infoリストに関する情報を取得する
get_user_lists認証されたユーザーが所有するすべてのリストを取得する

要件

  • Node.js 18.x 以上
  • X APIキー付き開発者アカウント
  • API v1およびv2アクセス

環境変数

変数説明
TWITTER_API_KEYAPIキー
TWITTER_API_SECRETAPIシークレット
TWITTER_ACCESS_TOKENアクセストークン
TWITTER_ACCESS_TOKEN_SECRETアクセストークンシークレット

リポジトリ構造

twitter-mcp/ ├── .github/ │ └── workflows/ │ ├── publish.yml │ └── release.yml ├── code/ │ ├── account_management.py # Sample Python code for account management │ ├── post_tweet.py # Sample Python code for posting content │ └── retrieve_tweets.py # Sample Python code for retrieving content ├── src/ │ ├── index.ts # Main entry point │ ├── twitter-api.ts # X API client │ ├── formatter.ts # Response formatter │ └── types.ts # Type definitions ├── .env.example ├── .gitignore ├── Dockerfile ├── LICENSE ├── package.json ├── README.md └── tsconfig.json

ライセンス

マサチューセッツ工科大学

-
security - not tested
-
license - not tested
-
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.

X (旧 Twitter) とのやり取りを可能にし、ツイートの投稿、コンテンツの検索、アカウントの管理、リストの整理が可能になります。

  1. クイックスタート
    1. クロード・コンフィグレーション
      1. 特徴
        1. ポストオペレーション
        2. アカウント管理
        3. リスト管理
      2. 利用可能なMCPツール
        1. 要件
          1. 環境変数
            1. リポジトリ構造
              1. ライセンス

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  Server for X (Twitter) integration that provides tools for reading your timeline and engaging with tweets. Designed for use with Claude desktop.
                  Last updated -
                  3
                  8
                  9
                  JavaScript
                  MIT License
                • A
                  security
                  A
                  license
                  A
                  quality
                  A Model Context Protocol (MCP) server for managing social media posts, currently supporting X (formerly Twitter).
                  Last updated -
                  3
                  7
                  JavaScript
                  MIT License
                • -
                  security
                  A
                  license
                  -
                  quality
                  Enables interaction with Twitter through a Model Context Protocol, allowing large language models to post tweets, search for tweets, and reply to tweets.
                  Last updated -
                  25
                  212
                  15
                  TypeScript
                  MIT License
                  • Apple
                • A
                  security
                  A
                  license
                  A
                  quality
                  An MCP server that allows Claude to create, manage and publish X/Twitter posts directly through the chat interface.
                  Last updated -
                  5
                  35
                  Python
                  MIT License
                  • 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/Dishant27/twitter-mcp'

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