Skip to main content
Glama
Playwright MCP

Playwright MCP

by furugen

Playwright MCP Docker Environment

Docker環境でPlaywright MCPサーバーを実行し、外部ツールから自動ブラウザ操作を可能にするプロジェクトです。

🚀 クイックスタート

# 1. リポジトリをクローン
git clone <repository-url>
cd playwright-replan

# 2. Docker Composeで起動
docker-compose up -d

# 3. 動作確認
curl http://localhost:8931/health

SSEエンドポイント: http://localhost:8931/sse

Related MCP server: Playwright MCP

📋 機能

  • ヘッドレスブラウザ操作: Chromium/Firefox/WebKitでの自動操作

  • SSE通信: リアルタイムなブラウザ操作結果の取得

  • 外部ツール連携: n8n、VS Code、Cursorなどとの統合

  • 出力ファイル管理: スクリーンショット、PDF、Traceファイルの保存

  • 設定可能: 環境変数による柔軟な設定変更

🛠️ 構成

playwright-replan/
├── Dockerfile                 # MCPサーバー用コンテナ
├── docker-compose.yml        # サービス定義
├── .env                      # 環境設定
├── scripts/
│   ├── entrypoint.sh         # 起動スクリプト
│   └── health-check.sh       # ヘルスチェック
├── config/
│   └── mcp-server.json       # MCP設定
├── output/                   # 出力ファイル
└── docs/
    ├── SETUP.md             # 詳細セットアップ
    └── API_USAGE.md         # API使用方法

⚙️ 設定

環境変数

変数

デフォルト

説明

MCP_HOST_PORT

8931

公開ポート

DEBUG

-

デバッグログ有効化

SAVE_TRACE

false

Trace保存

VISION_MODE

false

スクリーンショットモード

デバッグ有効化

echo "DEBUG=pw:api" >> .env
docker-compose restart

🔗 外部ツール連携

n8n

{
  "mcpServers": {
    "playwright": {
      "url": "http://localhost:8931/sse"
    }
  }
}

VS Code/Cursor

{
  "mcpServers": {
    "playwright": {
      "url": "http://localhost:8931/sse"
    }
  }
}

📊 監視

# ログ確認
docker-compose logs -f

# ヘルスチェック
curl http://localhost:8931/health

# コンテナ状態
docker-compose ps

📚 ドキュメント

🔧 トラブルシューティング

よくある問題

  1. ポート競合: .envでMCP_HOST_PORTを変更

  2. 起動失敗: docker-compose logsでエラー確認

  3. 接続できない: ファイアウォール設定を確認

サポート

問題が発生した場合は、以下を確認してください:

📝 ライセンス

このプロジェクトは実験的なものです。商用利用の際は適切なライセンス確認を行ってください。

🤝 貢献

プルリクエストやイシューの報告を歓迎します。

Available Tools

24 tools
browser_clickB
Destructive

Perform click on a web page

Inputs: element (required), ref (required), button, doubleClick.

browser_closeB
Read-only

Close the page

Inputs: no named parameters.

browser_console_messagesA
Read-only

Returns all console messages

Inputs: no named parameters.

browser_dragB
Destructive

Perform drag and drop between two elements

Inputs: endElement (required), endRef (required), startElement (required), startRef (required).

browser_evaluateA
Destructive

Evaluate JavaScript expression on page or element

Inputs: function (required), element, ref.

browser_file_uploadB
Destructive

Upload one or multiple files

Inputs: paths (required).

browser_handle_dialogC
Destructive

Handle a dialog

Inputs: accept (required), promptText.

browser_hoverB
Read-only

Hover over element on page

Inputs: element (required), ref (required).

browser_installA
Destructive

Install the browser specified in the config. Call this if you get an error about the browser not being installed.

Inputs: no named parameters.

browser_navigateB
Destructive

Navigate to a URL

Inputs: url (required).

browser_navigate_backA
Read-only

Go back to the previous page

Inputs: no named parameters.

browser_navigate_forwardB
Read-only

Go forward to the next page

Inputs: no named parameters.

browser_network_requestsA
Read-only

Returns all network requests since loading the page

Inputs: no named parameters.

browser_press_keyB
Destructive

Press a key on the keyboard

Inputs: key (required).

browser_resizeB
Read-only

Resize the browser window

Inputs: height (required), width (required).

browser_select_optionB
Destructive

Select an option in a dropdown

Inputs: element (required), ref (required), values (required).

browser_snapshotB
Read-only

Capture accessibility snapshot of the current page, this is better than screenshot

Inputs: no named parameters.

browser_tab_closeC
Destructive

Close a tab

Inputs: index.

browser_tab_listB
Read-only

List browser tabs

Inputs: no named parameters.

browser_tab_newA
Read-only

Open a new tab

Inputs: url.

browser_tab_selectB
Read-only

Select a tab by index

Inputs: index (required).

browser_take_screenshotA
Read-only

Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.

Inputs: element, filename, fullPage, ref, +1 more.

browser_typeA
Destructive

Type text into editable element

Inputs: element (required), ref (required), text (required), slowly, +1 more.

browser_wait_forB
Read-only

Wait for text to appear or disappear or a specified time to pass

Inputs: text, textGone, time.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 24 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes focused on specific browser interactions (e.g., click, type, navigate, screenshot), though some potential overlap exists between browser_snapshot and browser_take_screenshot where descriptions help clarify their different use cases. The tool set avoids major ambiguity with well-defined scopes for each action.

    Naming Consistency5/5

    All tools follow a consistent 'browser_verb_noun' or 'browser_noun_verb' pattern with snake_case throughout, making them predictable and easy to parse. This uniformity enhances usability and reduces cognitive load when selecting tools.

    Tool Count3/5

    With 24 tools, the count is borderline high for a browser automation server, potentially overwhelming but still manageable given the comprehensive coverage of web interactions. It feels slightly heavy compared to typical well-scoped servers (3-15 tools), but not extreme.

    Completeness5/5

    The tool set provides complete coverage for browser automation, including navigation, interaction (click, type, hover), file handling, dialog management, tab control, and debugging (console, network, screenshots). No obvious gaps exist for core web testing or scraping workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that provides browser automation capabilities using Playwright, enabling LLMs to interact with web pages through structured accessibility snapshots without requiring screenshots or vision models.
      22
      10,908,336 npm
      1
      Apache 2.0
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that provides browser automation capabilities using Playwright, enabling LLMs to interact with web pages through structured accessibility snapshots without needing screenshots or visually-tuned models.
      22
      Apache 2.0
    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol server that provides browser automation capabilities using Playwright, enabling LLMs to interact with web pages through structured accessibility snapshots without requiring screenshots or visually-tuned models.
      22
      Apache 2.0
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots, providing browser automation capabilities without requiring screenshots or visually tuned models.
      7
      Apache 2.0