Twitter MCP Server
クイックインストール
まず、https://6551.io/mcp にアクセスしてAPIトークンを取得してください。
Claude Code
claude mcp add twitter \
-e TWITTER_TOKEN=<your-token> \
-- uv --directory /path/to/twitter-mcp run twitter-mcp
/path/to/twitter-mcpをローカルのプロジェクトパスに、<your-token>をあなたのトークンに置き換えてください。
OpenClaw
export TWITTER_TOKEN="<your-token>"
cp -r openclaw-skill/opentwitter ~/.openclaw/skills/AIによるレビューとインストール
このMCPが安全かどうか不安ですか?以下のプロンプトをAIアシスタントに貼り付けてください。AIがまずソースコードをレビューし、安全であればインストールを行います:
このプロンプトをコピーしてAIアシスタントに送信してください(
<project-path>と<your-token>は実際の値に置き換えてください):
Please review and install the twitter-mcp MCP server for me. The project is at <project-path>.
Steps:
1. Review these files for security:
- src/twitter_mcp/api_client.py — Confirm it only connects to ai.6551.io, no data sent elsewhere
- src/twitter_mcp/config.py — Confirm token is only read from local config.json or env vars, no hardcoded secrets or leaks
- src/twitter_mcp/tools.py — Confirm all tools only perform API queries, no file writes, command execution, or dangerous operations
- pyproject.toml — Confirm dependencies are only mcp, httpx, no suspicious packages
2. Tell me your conclusion: safe / risky / problematic, with specific reasons
3. If safe, run the install (get Token from https://6551.io/mcp):
claude mcp add twitter -e TWITTER_TOKEN=<your-token> -- uv --directory <project-path> run twitter-mcp何ができるのか?
接続後、AIアシスタントに以下のように話しかけてください:
あなたの言葉 | AIの動作 |
"@elonmuskのTwitterプロフィールを表示して" | ユーザープロフィール情報の取得 |
"@VitalikButerinの最近のツイートは何?" | ユーザーの最近のツイートを取得 |
"Bitcoin関連のツイートを検索して" | キーワード検索 |
"#cryptoハッシュタグのツイートを見つけて" | ハッシュタグ検索 |
"ETHに関する1000いいね以上の人気ツイート" | エンゲージメントフィルター付き検索 |
"@elonmuskをフォロワー追跡で監視して" | オプション付きで監視リストにユーザーを追加 |
"このツイートを引用したのは誰?" | 特定ツイートの引用ツイートを取得 |
"このツイートをリツイートしたのは誰?" | 特定ツイートのリツイートユーザーを取得 |
"最近@elonmuskをフォローしたのは誰?" | 新規フォロワーイベントの取得 |
"@elonmuskのフォローを解除したのは誰?" | フォロー解除イベントの取得 |
"@elonmuskが削除したツイートは何?" | 削除されたツイートの取得 |
"@elonmuskをフォローしているKOLは誰?" | KOLフォロワーの取得 |
利用可能なツール
ツール | 説明 |
| ユーザー名でプロフィールを取得 |
| 数値IDでプロフィールを取得 |
| ユーザーの最近のツイートを取得 |
| 基本フィルターでツイートを検索 |
| 複数フィルターによる高度な検索 |
| フォロー/フォロー解除イベントを取得 |
| ユーザーの削除済みツイートを取得 |
| KOL(キーオピニオンリーダー)フォロワーを取得 |
| IDでTwitter記事を取得 |
| 返信/引用ツイートを含むIDでツイートを取得 |
| 特定ツイートを引用したツイートを取得 |
| 特定ツイートをリツイートしたユーザーを取得 |
| すべてのTwitter監視対象ユーザーを取得 |
| 監視リストにTwitterユーザーを追加(イベントタイプオプション付き) |
| 監視リストからTwitterユーザーを削除 |
設定
APIトークンの取得
https://6551.io/mcp にアクセスしてAPIトークンを取得してください。
環境変数を設定します:
# macOS / Linux
export TWITTER_TOKEN="<your-token>"
# Windows PowerShell
$env:TWITTER_TOKEN = "<your-token>"変数 | 必須 | 説明 |
| はい | 6551 API Bearerトークン (https://6551.io/mcp から取得) |
| いいえ | REST API URLの上書き |
| いいえ | クエリあたりの最大結果数 (デフォルト: 100) |
プロジェクトルートの config.json もサポートしています(環境変数が優先されます):
{
"api_base_url": "https://ai.6551.io",
"api_token": "<your-token>",
"max_rows": 100
}WebSocketリアルタイムサブスクリプション
エンドポイント: wss://ai.6551.io/open/twitter_wss?token=YOUR_TOKEN
監視対象のTwitterアカウントからのリアルタイムイベントを購読します。
Twitterイベントの購読
{
"jsonrpc": "2.0",
"id": 1,
"method": "twitter.subscribe"
}レスポンス:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"success": true
}
}購読解除
{
"jsonrpc": "2.0",
"id": 2,
"method": "twitter.unsubscribe"
}サーバープッシュ - Twitterイベント
監視対象アカウントにアクティビティが発生すると、サーバーがプッシュします:
{
"jsonrpc": "2.0",
"method": "twitter.event",
"params": {
"id": 123456,
"twAccount": "elonmusk",
"twUserName": "Elon Musk",
"profileUrl": "https://twitter.com/elonmusk",
"eventType": "NEW_TWEET",
"content": "...",
"ca": "0x1234...",
"remark": "Custom note",
"createdAt": "2026-03-06T10:00:00Z"
}
}注意: content フィールドの構造はイベントタイプによって異なります(下記参照)。
**Event Types and Content Structure**:
#### Tweet Events
- `NEW_TWEET` - New tweet posted
- `NEW_TWEET_REPLY` - New reply tweet
- `NEW_TWEET_QUOTE` - New quote tweet
- `NEW_RETWEET` - Retweeted
- `CA` - Tweet with CA address
Content structure for tweet events:
```json
{
"id": "1234567890",
"text": "Tweet content...",
"createdAt": "2026-03-06T10:00:00Z",
"language": "en",
"retweetCount": 100,
"favoriteCount": 500,
"replyCount": 20,
"quoteCount": 10,
"viewCount": 10000,
"userScreenName": "elonmusk",
"userName": "Elon Musk",
"userIdStr": "44196397",
"userFollowers": 170000000,
"userVerified": true,
"conversationId": "1234567890",
"isReply": false,
"isQuote": false,
"hashtags": ["crypto", "bitcoin"],
"media": [
{
"type": "photo",
"url": "https://...",
"thumbUrl": "https://..."
}
],
"urls": [
{
"url": "https://...",
"expandedUrl": "https://...",
"displayUrl": "example.com"
}
],
"mentions": [
{
"username": "VitalikButerin",
"name": "Vitalik Buterin"
}
]
}フォロワーイベント
NEW_FOLLOWER- 新規フォロワーNEW_UNFOLLOWER- フォロー解除イベント
フォロワーイベントのコンテンツ構造(配列):
[
{
"id": 123,
"twId": 44196397,
"twAccount": "elonmusk",
"twUserName": "Elon Musk",
"twUserLabel": "Verified",
"description": "User bio...",
"profileUrl": "https://...",
"bannerUrl": "https://...",
"followerCount": 170000000,
"friendCount": 500,
"createdAt": "2026-03-06T10:00:00Z"
}
]プロフィール更新イベント
UPDATE_NAME- ユーザー名変更 (content: 新しい名前の文字列)UPDATE_DESCRIPTION- 自己紹介更新 (content: 新しい説明の文字列)UPDATE_AVATAR- プロフィール画像変更 (content: 新しいアバターURLの文字列)UPDATE_BANNER- バナー画像変更 (content: 新しいバナーURLの文字列)
その他のイベント
TWEET_TOPPING- ツイート固定DELETE- ツイート削除SYSTEM- システムイベントTRANSLATE- ツイート翻訳CA_CREATE- CAトークン作成
データ構造
Twitterユーザー
{
"userId": "44196397",
"screenName": "elonmusk",
"name": "Elon Musk",
"description": "...",
"followersCount": 170000000,
"friendsCount": 500,
"statusesCount": 30000,
"verified": true
}ツイート
{
"id": "1234567890",
"text": "Tweet content...",
"createdAt": "2024-02-20T12:00:00Z",
"retweetCount": 1000,
"favoriteCount": 5000,
"replyCount": 200,
"userScreenName": "elonmusk",
"hashtags": ["crypto", "bitcoin"],
"urls": [{"url": "https://..."}]
}以下のすべての設定において、
/path/to/twitter-mcpを実際のローカルプロジェクトパスに、<your-token>を https://6551.io/mcp で取得したトークンに置き換えてください。
Claude Desktop
設定を編集 (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"twitter": {
"command": "uv",
"args": ["--directory", "/path/to/twitter-mcp", "run", "twitter-mcp"],
"env": {
"TWITTER_TOKEN": "<your-token>"
}
}
}
}Cursor
~/.cursor/mcp.json または 設定 > MCPサーバー:
{
"mcpServers": {
"twitter": {
"command": "uv",
"args": ["--directory", "/path/to/twitter-mcp", "run", "twitter-mcp"],
"env": {
"TWITTER_TOKEN": "<your-token>"
}
}
}
}Windsurf
~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"twitter": {
"command": "uv",
"args": ["--directory", "/path/to/twitter-mcp", "run", "twitter-mcp"],
"env": {
"TWITTER_TOKEN": "<your-token>"
}
}
}
}Cline
VS Codeサイドバー > Cline > MCPサーバー > 設定, cline_mcp_settings.json を編集:
{
"mcpServers": {
"twitter": {
"command": "uv",
"args": ["--directory", "/path/to/twitter-mcp", "run", "twitter-mcp"],
"env": {
"TWITTER_TOKEN": "<your-token>"
},
"disabled": false,
"autoApprove": []
}
}
}Continue.dev
~/.continue/config.yaml:
mcpServers:
- name: twitter
command: uv
args:
- --directory
- /path/to/twitter-mcp
- run
- twitter-mcp
env:
TWITTER_TOKEN: <your-token>Cherry Studio
設定 > MCPサーバー > 追加 > stdioタイプ: コマンド uv, 引数 --directory /path/to/twitter-mcp run twitter-mcp, 環境変数 TWITTER_TOKEN。
Zed Editor
~/.config/zed/settings.json:
{
"context_servers": {
"twitter": {
"command": {
"path": "uv",
"args": ["--directory", "/path/to/twitter-mcp", "run", "twitter-mcp"],
"env": {
"TWITTER_TOKEN": "<your-token>"
}
}
}
}
}stdio MCPクライアント全般
TWITTER_TOKEN=<your-token> \
uv --directory /path/to/twitter-mcp run twitter-mcp互換性
クライアント | インストール方法 | ステータス |
Claude Code |
| ワンライナー |
OpenClaw | スキルディレクトリをコピー | ワンライナー |
Claude Desktop | JSON設定 | サポート |
Cursor | JSON設定 | サポート |
Windsurf | JSON設定 | サポート |
Cline | JSON設定 | サポート |
Continue.dev | YAML / JSON | サポート |
Cherry Studio | GUI | サポート |
Zed | JSON設定 | サポート |
開発
cd /path/to/twitter-mcp
uv sync
uv run twitter-mcp# MCP Inspector
npx @modelcontextprotocol/inspector uv --directory /path/to/twitter-mcp run twitter-mcpプロジェクト構造
├── README.md
├── docs/
│ ├── README_JA.md # 日本語
│ └── README_KO.md # 한국어
├── openclaw-skill/opentwitter/ # OpenClaw Skill
├── pyproject.toml
├── config.json
└── src/twitter_mcp/
├── server.py # Entry point
├── app.py # FastMCP instance
├── config.py # Config loader
├── api_client.py # HTTP client
└── tools.py # 8 toolsライセンス
MIT
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/6551Team/opentwitter-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server