Twitter MCP Server

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.

Integrations

  • Uses .ENV files to manage Twitter credentials and API keys securely

  • Enables server functionality on the Node.js runtime environment

  • Integrates with npm packages, specifically the agent-twitter-client library for Twitter interactions

Twitter MCP サーバー

agent-twitter-client ライブラリを使用して Twitter と対話するためのツールを提供する MCP (Model Context Protocol) サーバー。

特徴

  • getTweet : IDでツイートを取得する
  • sendTweet : Twitterに新しいツイートを投稿する

前提条件

  • Node.js (v14以上)
  • npmまたはyarn
  • Twitterアカウントの認証情報

インストール

  1. このリポジトリをクローンする
  2. 依存関係をインストールします:
npm install # or yarn install
  1. ルート ディレクトリに Twitter の認証情報を含む.envファイルを作成します。
TWITTER_USERNAME=your_twitter_username TWITTER_PASSWORD=your_twitter_password TWITTER_EMAIL=your_email@example.com (optional) TWITTER_2FA_SECRET=your_2fa_secret (optional) # Optional API credentials (used as fallback) TWITTER_API_KEY=your_api_key TWITTER_API_SECRET_KEY=your_api_secret_key TWITTER_ACCESS_TOKEN=your_access_token TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret

使用法

サーバーの実行

FastMCP CLI ツールを使用してサーバーを実行できます。

# For development and testing in the terminal npx fastmcp dev # For visual inspection with the MCP Inspector npx fastmcp inspect

ツールの使用

ツイートを取得

ID でツイートを取得します。

パラメータ:

  • tweetId (文字列): 取得するツイートのID

例:

getTweet({"tweetId": "1734609533274853865"})

ツイートを送信

Twitter に新しいツイートを投稿します。

パラメータ:

  • text (文字列): 送信するツイートのテキストコンテンツ

例:

sendTweet({"text": "Hello World from MCP!"})

発達

このサーバーは以下を使用して構築されています:

  • FastMCP - MCP サーバーを構築するための TypeScript フレームワーク
  • agent-twitter-client - Twitterクライアントライブラリ

TypeScript コードをビルドするには:

npx tsc

ライセンス

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

-
security - not tested
F
license - not found
-
quality - not tested

Twitter と対話して ID でツイートを取得したり、agent-twitter-client ライブラリを使用して新しいツイートを投稿したりするためのツールを提供します。

  1. Features
    1. Prerequisites
      1. Installation
        1. Usage
          1. Running the Server
          2. Using the Tools
        2. Development
          1. License
            ID: xhfrmc0bnf