npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

twitter-follower-mcp

v1.0.0

Published

MCP server for fetching Twitter followers and following data

Readme

Twitter Follower/Following MCP Server

このMCP (Model Control Protocol) サーバーは、クッキーベースの認証を使用してTwitterのフォロワーとフォローデータを取得することができます。

機能

  • ブラウザクッキーを使ったTwitter認証
  • 任意のTwitterユーザーのフォロワーリスト取得
  • 任意のTwitterユーザーのフォローリスト取得
  • 一回のリクエストでフォロワーとフォローの両方を取得
  • 認証状態の確認

インストール

NPMパッケージとして使用

npm install -g twitter-follower-mcp

ローカルでインストール

  1. リポジトリをクローン
  2. 依存関係をインストール:
    npm install
  3. サーバーを起動:
    npm start

使用方法

Claude Desktop設定での使用方法

claude_desktop_config.jsonファイルに以下のエントリを追加します:

"twitter-follower-mcp": {
  "command": "npx",
  "args": [
    "twitter-follower-mcp",
    "--cookies='{\"auth_token\":\"YOUR_AUTH_TOKEN\",\"ct0\":\"YOUR_CT0_TOKEN\",\"twid\":\"YOUR_TWID_TOKEN\"}'"
  ]
}

または、クッキーファイルを指定する場合:

"twitter-follower-mcp": {
  "command": "npx",
  "args": [
    "twitter-follower-mcp",
    "--cookie-file=/path/to/twitter-cookies.json"
  ]
}

コマンドラインでの使用方法

クッキーをJSON文字列として直接指定:

twitter-follower-mcp --cookies='{"auth_token":"YOUR_AUTH_TOKEN","ct0":"YOUR_CT0_TOKEN"}'

クッキーファイルを指定:

twitter-follower-mcp --cookie-file=./twitter-cookies.json

ポートを指定:

twitter-follower-mcp --cookie-file=./twitter-cookies.json --port=3001

MCPプロトコルでの使用

サーバーはJSONメッセージをMCPプロトコル経由で受け取ります。以下のような操作がサポートされています:

1. 認証クッキーの設定

まず、Twitter認証用のクッキーを提供する必要があります:

{
  "cookies": {
    "auth_token": "your_auth_token",
    "ct0": "your_ct0_token",
    ... (その他必要なTwitterクッキー)
  }
}

2. 認証の確認

認証が機能するかを確認:

{
  "action": "verify_auth"
}

3. フォロワーの取得

特定のユーザーのフォロワーを取得:

{
  "action": "get_followers",
  "username": "twitterのユーザー名",
  "limit": 100
}

4. フォローの取得

ユーザーがフォローしているアカウントを取得:

{
  "action": "get_following",
  "username": "twitterのユーザー名",
  "limit": 100
}

5. フォロワーとフォローの両方を取得

一回のリクエストで両方を取得:

{
  "action": "get_both",
  "username": "twitterのユーザー名",
  "limit": 100
}

レスポンス形式

サーバーは以下の構造を持つJSONレスポンスを返します:

{
  "status": "success",
  "data": [...],  // ユーザーオブジェクトの配列
  "type": "followers",  // または "following"
  "username": "twitterのユーザー名",
  "count": 100
}

各ユーザーオブジェクトには以下の情報が含まれます:

{
  "id": "12345678901234567",
  "username": "user",
  "name": "User Name",
  "description": "User bio...",
  "created_at": "2020-01-01T00:00:00.000Z",
  "followers_count": 1000,
  "following_count": 500,
  "tweet_count": 5000,
  "profile_image_url": "https://...",
  "profile_url": "https://twitter.com/user",
  "type": "follower",  // または "following"
  "related_to": "twitterのユーザー名"
}

Twitterクッキーの取得方法

  1. ブラウザでTwitterにログイン
  2. Developer Tools(F12または右クリック > 検証)を開く
  3. Applicationタブ > Storage > Cookies > https://twitter.comに移動
  4. 最低限以下のクッキーを探す:
    • auth_token
    • ct0
    • twid
  5. これらの値をMCPサーバーで使用する

注意事項

  • このサーバーには有効なTwitter認証クッキーが必要です
  • レート制限はTwitter APIクライアントによって自動的に処理されます
  • 大きなアカウントの場合は、ページネーションや適切な制限を使用してタイムアウトを回避してください