Playwright MCP
The Playwright MCP server enables automated browser interactions through a Docker environment, supporting headless Chromium, Firefox, and WebKit browsers for various web automation tasks.
Navigate and interact: Visit URLs, navigate history, click elements, type text, select options, drag, hover, and upload files.
Manage browser tabs: Open, switch between, list, and close tabs.
Capture page data: Take screenshots, save PDFs, log network requests, and generate accessibility snapshots.
Handle dialogs: Accept or dismiss browser alerts, prompts, and confirms with custom input.
Wait and monitor: Wait for specific conditions or timeframes, and receive real-time updates via SSE.
Generate and debug: Automatically create Playwright test scripts, enable debugging logs, and save trace files.
Customize and integrate: Configure via environment variables and connect with tools like n8n, VS Code, and Cursor.
Enables browser automation for Firefox, allowing AI agents to interact with web pages through structured accessibility snapshots, perform navigation, clicks, typing, and other browsing actions.
Integrates with GitHub Copilot in VS Code, providing tools for web automation that allow the AI assistant to interact with websites, fill forms, click buttons, and extract data from web pages.
Provides browser automation capabilities built on Node.js, allowing programmatic control of web browsers for navigation, interaction, and data extraction from web pages.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Playwright MCP go to github.com and search for 'playwright automation'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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/healthSSEエンドポイント: 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使用方法⚙️ 設定
環境変数
変数 | デフォルト | 説明 |
| 8931 | 公開ポート |
| - | デバッグログ有効化 |
| false | Trace保存 |
| 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📚 ドキュメント
🔧 トラブルシューティング
よくある問題
ポート競合:
.envでMCP_HOST_PORTを変更起動失敗:
docker-compose logsでエラー確認接続できない: ファイアウォール設定を確認
サポート
問題が発生した場合は、以下を確認してください:
コンテナログ:
docker-compose logs playwright-mcpヘルスチェック:
curl http://localhost:8931/health
📝 ライセンス
このプロジェクトは実験的なものです。商用利用の際は適切なライセンス確認を行ってください。
🤝 貢献
プルリクエストやイシューの報告を歓迎します。
Available Tools
24 toolsbrowser_clickBDestructive
Perform click on a web page
Inputs: element (required), ref (required), button, doubleClick.
browser_closeBRead-only
Close the page
Inputs: no named parameters.
browser_console_messagesARead-only
Returns all console messages
Inputs: no named parameters.
browser_dragBDestructive
Perform drag and drop between two elements
Inputs: endElement (required), endRef (required), startElement (required), startRef (required).
browser_evaluateADestructive
Evaluate JavaScript expression on page or element
Inputs: function (required), element, ref.
browser_file_uploadBDestructive
Upload one or multiple files
Inputs: paths (required).
browser_handle_dialogCDestructive
Handle a dialog
Inputs: accept (required), promptText.
browser_hoverBRead-only
Hover over element on page
Inputs: element (required), ref (required).
browser_installADestructive
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_network_requestsARead-only
Returns all network requests since loading the page
Inputs: no named parameters.
browser_press_keyBDestructive
Press a key on the keyboard
Inputs: key (required).
browser_resizeBRead-only
Resize the browser window
Inputs: height (required), width (required).
browser_select_optionBDestructive
Select an option in a dropdown
Inputs: element (required), ref (required), values (required).
browser_snapshotBRead-only
Capture accessibility snapshot of the current page, this is better than screenshot
Inputs: no named parameters.
browser_tab_closeCDestructive
Close a tab
Inputs: index.
browser_tab_listBRead-only
List browser tabs
Inputs: no named parameters.
browser_tab_newARead-only
Open a new tab
Inputs: url.
browser_tab_selectBRead-only
Select a tab by index
Inputs: index (required).
browser_take_screenshotARead-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_typeADestructive
Type text into editable element
Inputs: element (required), ref (required), text (required), slowly, +1 more.
browser_wait_forBRead-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
Scored across 24 tools
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.
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.
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.
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
Related MCP Connectors
Official Browserless MCP server: browser automation, scraping, screenshots and PDFs for AI agents.
Cloud browser, web extraction, screenshots, and remote CDP tools for AI agents.
Hosted browser for AI agents: screenshots, post-JS DOM, console, WCAG. No install, no API key.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseBqualityDmaintenanceA 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.2210,908,336 npm1Apache 2.0
- AlicenseBqualityDmaintenanceA 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.22Apache 2.0
- AlicenseAqualityDmaintenanceA 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.22Apache 2.0
- AlicenseBqualityDmaintenanceA 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.7Apache 2.0