x-mcp-playwright
x-mcp-playwright
patchright(ステルス版 Playwright フォーク)と永続的な Chrome ユーザープロファイルを利用した Twitter/X MCP サーバーです。
9 つのグループ化されたツール — 33 アクションを維持、失われる機能はゼロ。
1. インストール
git clone <this-repo> x-mcp-playwright
cd x-mcp-playwright
python -m venv .venv
# Windows:
.venv\Scripts\activate
# macOS/Linux:
source .venv/bin/activate
pip install -e .
patchright install chromium初回ログイン
x-mcp-login
# or: python login.py実際のブラウザウィンドウが開きます。通常どおり X にログインしてから、ウィンドウを閉じます。セッションは ~/.x-mcp-playwright/profile/ に保存されます。
Related MCP server: X MCP Server
2. MCP クライアントに登録
Claude Code
claude mcp add --scope user x-twitter x-mcp-serverClaude Desktop
{
"mcpServers": {
"x-twitter": {
"command": "x-mcp-server",
"env": { "X_MCP_HEADLESS": "1" }
}
}
}x-mcp-server が PATH にない場合は、次を使用してください:
{
"mcpServers": {
"x-twitter": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["-m", "x_mcp_server"]
}
}
}Docker(ヘッドレス VPS)
docker build -t x-mcp-playwright .
docker run -i --rm \
-v ~/.x-mcp-playwright/profile:/root/.x-mcp-playwright/profile \
x-mcp-playwright3. ツールカタログ(9 ツール、33 アクション)
x_post — ツイートの投稿(6 アクション)
アクション | 必須引数 | 説明 |
|
| 単一のツイートを投稿 |
|
| 連続したスレッドを投稿 |
|
| 画像 4 枚まで、または動画 1 本 |
|
| ツイートに返信 |
|
| コメント付きで引用ツイート |
|
| 自分のツイートを削除 |
x_engage — ツイートへの操作(4 アクション)
アクション | 必須引数 |
|
|
|
|
|
|
|
|
|
|
|
|
|
x_user — ユーザー操作(6 アクション)
アクション | 必須引数 | オプション |
|
| — |
|
|
|
|
|
|
|
|
|
|
| — |
|
| — |
x_search — ツイート検索(シンプル + 詳細)
引数 | デフォルト | 説明 |
| — | 検索するキーワード |
|
|
|
| — | 投稿者で絞り込み |
| — | 返信先で絞り込み |
| — | 日付範囲(YYYY-MM-DD) |
| 0 | 最小いいね数 |
| 0 | 最小リツイート数 |
| — | 言語コード |
| 10 | 最大件数 |
x_feed — フィードの閲覧(4 アクション)
アクション | 説明 |
| ホームタイムライン。オプション: |
| 保存したブックマーク |
| メンション、いいね、フォロー |
| 話題のトピック |
x_tweet — ツイート詳細(4 アクション)
アクション | 必須引数 | 説明 |
|
| メトリクス付きの完全なツイート |
|
| ツイートへの返信 |
|
| インプレッション/エンゲージメント(自分のツイート) |
|
| いいね/リツイートしたユーザー( |
x_list — リスト
シナリオ | 引数 |
自分のリスト | 引数なし |
ユーザーのリスト |
|
リストのツイート |
|
x_dm — ダイレクトメッセージ(3 アクション)
アクション | 必須引数 | 説明 |
|
| DM を送信 |
| — | 最近の DM スレッドを一覧表示 |
|
| ユーザーとのメッセージを読む |
x_session — セッション管理(2 アクション)
アクション | 説明 |
|
|
| 任意の X ページをキャプチャ。オプション: |
4. 環境変数
変数 | デフォルト | 説明 |
|
|
|
|
| Playwright のデフォルトタイムアウト(ms) |
|
| デバッグ用スクリーンショット |
|
|
|
5. 安全性
レートリミッター: 書き込みアクション(post、delete、DM、reply)は毎分 1 回まで。エンゲージアクション(like、RT、follow)は毎分 2 回まで。読み取りアクションは無制限。
セッションキープアライブ: バックグラウンドタスクが 30 分ごとに X に ping を送信します。セッションが失効した場合は警告をログに記録します。
自分の実際のアカウントに固定されています。 LLM が行うことはすべて、あなたが行ったことになります。
6. MCP リソース
x://session/status— ログイン状態x://version— サーバーバージョンx://tools/list— 全ツールx://tools/categories— グループ化された分類
7. MCP プロンプト
analyze_tweet(tweet_url)— ツイートを取得して分析(感情、エンゲージメント、返信のトーン)draft_reply(tweet_url, intent)— 280 文字以内の返信候補を 3 件作成
7. 開発
make install # deps + chromium
make login # interactive X login
make test # unit tests (no browser)
make smoke # live search test
make server # run MCP server
make lint # compile-check
make clean # remove pycache, screenshots8. 安全性
自分の実際のアカウントに固定されています。 LLM が行うことはすべて、あなたが行ったことになります。
上限: 投稿/返信アクションは毎分 1〜2 回まで。
破壊的ツール(
delete、block、send_dm)は VPS 上で人間の承認を必須とします。
ライセンス
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted X (Twitter) MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Twitter/X read-only MCP server — 12 tools: search, users, tweets, followers, timelines, trends.
Official twitterapi.io hosted MCP: Twitter/X tweets, users, followers, trends. OAuth or API key.
- UniPostOAuthai.unipost
Hosted MCP server for AI agents to post to LinkedIn profiles and X and upload to YouTube.
Related MCP Servers
FlicenseNot gradedqualityFmaintenanceA local MCP server that exposes the X API (formerly Twitter API) as tools, enabling operations like posting, searching, user management, and more via natural language commands.865-- AlicenseBqualityDmaintenanceMCP server for interacting with the X platform (Twitter) via MCP clients like Claude, Cursor AI, and Windsurf AI.205 npm6MIT
- AlicenseNot gradedqualityDmaintenanceProvides programmatic X (Twitter) engagement via MCP, offering 24 tools for search, timelines, notifications, bookmarks, profiles, and tweet actions through a headless browser.MIT
- AlicenseAqualityAmaintenanceMCP server for the Twitter/X API, enabling search, user profiles, tweets, followers, and more via natural language.94286 npm4MIT