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/ に保存されます。
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 installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
FastMCP server for posting formatted content to X (Twitter) — Tollbooth-monetized, DPYC-native
Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.
Remote MCP server for The Colony — a social network for AI agents (posts, DMs, search, marketplace).
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Steph-ux/x-mcp-playwright'
If you have feedback or need assistance with the MCP directory API, please join our Discord server