Skip to main content
Glama
Steph-ux

x-mcp-playwright

by Steph-ux

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-server

Claude 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-playwright

3. ツールカタログ(9 ツール、33 アクション)

x_post — ツイートの投稿(6 アクション)

アクション

必須引数

説明

post

text

単一のツイートを投稿

thread

tweets(改行区切り)

連続したスレッドを投稿

post_media

text, media_paths(カンマ区切り)

画像 4 枚まで、または動画 1 本

reply

tweet_url, reply_text

ツイートに返信

quote

tweet_url, comment

コメント付きで引用ツイート

delete

tweet_url

自分のツイートを削除

x_engage — ツイートへの操作(4 アクション)

アクション

必須引数

on パラメータ

like

tweet_url

on=True でいいね、False でいいね解除

retweet

tweet_url

on=True でリツイート、False で取り消し

bookmark

tweet_url

on=True で保存、False で解除

pin

tweet_url

on=True で固定、False で固定解除

x_user — ユーザー操作(6 アクション)

アクション

必須引数

オプション

profile

handle

timeline

handle

tab="tweets"|"likes"|"media", limit

connections

handle

kind="followers"|"following", limit

follow

handle

on=True でフォロー、False でフォロー解除

block

handle

mute

handle

引数

デフォルト

説明

query

検索するキーワード

filter

"top"

"latest", "people", "media"

from_user

投稿者で絞り込み

to_user

返信先で絞り込み

since / until

日付範囲(YYYY-MM-DD)

min_likes

0

最小いいね数

min_retweets

0

最小リツイート数

lang

言語コード

limit

10

最大件数

x_feed — フィードの閲覧(4 アクション)

アクション

説明

home

ホームタイムライン。オプション: tab="for_you"|"following"

bookmarks

保存したブックマーク

notifications

メンション、いいね、フォロー

trending

話題のトピック

x_tweet — ツイート詳細(4 アクション)

アクション

必須引数

説明

details

tweet_url

メトリクス付きの完全なツイート

replies

tweet_url

ツイートへの返信

analytics

tweet_url

インプレッション/エンゲージメント(自分のツイート)

engagers

tweet_url

いいね/リツイートしたユーザー(kind="likes"|"retweets"

x_list — リスト

シナリオ

引数

自分のリスト

引数なし

ユーザーのリスト

handle

リストのツイート

list_id

x_dm — ダイレクトメッセージ(3 アクション)

アクション

必須引数

説明

send

handle, message

DM を送信

conversations

最近の DM スレッドを一覧表示

messages

handle

ユーザーとのメッセージを読む

x_session — セッション管理(2 アクション)

アクション

説明

check

{logged_in, current_url, user_handle} を返す

screenshot

任意の X ページをキャプチャ。オプション: url, full_page


4. 環境変数

変数

デフォルト

説明

X_MCP_HEADLESS

1

0 でブラウザウィンドウを表示

X_MCP_TIMEOUT_MS

20000

Playwright のデフォルトタイムアウト(ms)

X_MCP_SCREENSHOT_DIR

~/.x-mcp-playwright/screenshots

デバッグ用スクリーンショット

X_MCP_USE_SYSTEM_CHROME

0

1 でシステムの Chrome を使用


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, screenshots

8. 安全性

  • 自分の実際のアカウントに固定されています。 LLM が行うことはすべて、あなたが行ったことになります

  • 上限: 投稿/返信アクションは毎分 1〜2 回まで。

  • 破壊的ツール(deleteblocksend_dm)は VPS 上で人間の承認を必須とします。


ライセンス

MIT

-
license - not tested
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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).

View all MCP Connectors

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/Steph-ux/x-mcp-playwright'

If you have feedback or need assistance with the MCP directory API, please join our Discord server