Playwright MCP
劇作家-MCP
MCP(モデルコンテキストプロトコル)用のPlaywrightラッパー。このサーバーにより、LLM対応クライアントはブラウザを制御でき、自動化タスクを実行できます。
コンポーネント
リソース
サーバーはブラウザのスクリーンショットにアクセスするためのリソースを公開します。
スクリーンショットリソースURI:
screenshot://{page_id}スクリーンショットリソースは、開いているすべてのページで自動的に利用可能になります。
プロンプト
サーバーは、クライアントが Web ページを解釈できるようにプロンプトを提供します。
interpret-page: 現在のウェブページのコンテンツと構造を分析します解釈するページを選択するためのオプションの
page_id引数特定の側面(フル、フォーム、ナビゲーション、テキスト)に焦点を当てるためのオプションの
focus引数テキスト分析とページのスクリーンショットの両方を返します
ツール
サーバーは包括的なブラウザ自動化ツールのセットを実装します。
ブラウザナビゲーション
navigate: 特定のURLに移動するnew_page: 特定のIDで新しいブラウザページを作成するswitch_page: 別のブラウザページに切り替えるget_pages: 利用可能なすべてのブラウザページを一覧表示する
ページインタラクション
click: CSSセレクターを使用して要素をクリックするtype: 入力要素にテキストを入力するwait_for_selector: 要素がページに表示されるまで待つ
コンテンツ抽出
get_text: 要素からテキストコンテンツを取得するget_page_content: ページ全体のHTMLを取得するtake_screenshot: ページまたは要素の視覚的な状態をキャプチャします
Related MCP server: mcp-browser-automation
構成
依存関係をインストールする
uv add playwright
playwright install chromiumクイックスタート
インストール
クロードデスクトップ
MacOSの場合: ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows の場合: %APPDATA%/Claude/claude_desktop_config.json
"mcpServers": {
"playwright-mcp": {
"command": "uv",
"args": [
"--directory",
"/Users/shannon/Workspace/artivus/playwright-mcp",
"run",
"playwright-mcp"
]
}
}"mcpServers": {
"playwright-mcp": {
"command": "uvx",
"args": [
"playwright-mcp"
]
}
}発達
建築と出版
配布用のパッケージを準備するには:
依存関係を同期し、ロックファイルを更新します。
uv syncパッケージディストリビューションをビルドします。
uv buildこれにより、 dist/ディレクトリにソースとホイールのディストリビューションが作成されます。
PyPI に公開:
uv publish注: 環境変数またはコマンド フラグを使用して PyPI 資格情報を設定する必要があります。
トークン:
--tokenまたはUV_PUBLISH_TOKENまたはユーザー名/パスワード:
--username/UV_PUBLISH_USERNAMEおよび--password/UV_PUBLISH_PASSWORD
デバッグ
MCPサーバーはstdio経由で実行されるため、デバッグが困難になる場合があります。最適なデバッグ環境を実現するには、 MCP Inspectorの使用を強くお勧めします。
次のコマンドを使用して、 npm経由で MCP Inspector を起動できます。
npx @modelcontextprotocol/inspector uv --directory /Users/shannon/Workspace/artivus/playwright-mcp run playwright-mcp起動すると、ブラウザでアクセスしてデバッグを開始できる URL がインスペクタに表示されます。
Available Tools
10 toolsclickC
Click on an element by selector
Inputs: selector (required), page_id.
get_page_contentC
Get the current page HTML content
Inputs: page_id.
get_pagesB
List all available browser pages
Inputs: no named parameters.
get_textC
Get text content from an element
Inputs: selector (required), page_id.
new_pageC
Create a new browser page
Inputs: page_id (required).
switch_pageC
Switch to a different browser page
Inputs: page_id (required).
take_screenshotC
Take a screenshot of the current page
Inputs: page_id, selector.
typeC
Type text into an input element
Inputs: selector (required), text (required), page_id.
wait_for_selectorC
Wait for an element to be visible on the page
Inputs: selector (required), page_id, timeout.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a clearly distinct purpose with no ambiguity. For example, 'click' is for interacting with elements, 'navigate' is for URL changes, and 'take_screenshot' is for capturing visual output. The descriptions make it easy to differentiate between element interaction tools like 'click', 'type', and 'get_text'.
The naming follows a consistent verb-based pattern with clear actions like 'click', 'navigate', and 'type'. There are minor deviations with 'get_page_content' and 'get_text' using 'get_' prefix while others use simple verbs, but overall the naming is highly readable and predictable.
With 10 tools, this is well-scoped for a Playwright automation server. Each tool earns its place by covering essential browser automation tasks like navigation, page management, element interaction, and content retrieval without being overwhelming or redundant.
The toolset provides complete coverage for core browser automation workflows. It includes navigation, page management, element interaction, content retrieval, and screenshot capabilities. There are no obvious gaps—agents can perform full automation sequences from start to finish.
Related MCP Connectors
Web scraping, browser automation, screenshots and AI data extraction for AI agents via MCP.
Official Browserless MCP server: browser automation, scraping, screenshots and PDFs for AI agents.
Unofficial Browserless MCP — wraps the Browserless headless-Chromium REST API (browserless.io)
Unofficial Hyperbrowser MCP — wraps the Hyperbrowser AI-agent browsing API (hyperbrowser.ai).…
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceExposes Playwright browser automation as MCP tools, enabling AI assistants to control a real browser tab-by-tab for form filling, navigation, and more, while preserving the user's active session.-
- AlicenseBqualityDmaintenanceAn MCP server for generic browser automation using Playwright. Enables MCP clients to navigate pages, inspect elements, execute JavaScript, capture screenshots, and monitor console logs and network traffic via a headless Chromium instance.7ISC
- AlicenseAqualityDmaintenanceEnables MCP clients to automate a real Chrome browser via Playwright, supporting session sharing and tools for navigation, clicking, typing, and more.11108 npm2MIT
- AlicenseCqualityDmaintenanceExposes a remote browser as MCP tools via Playwright, enabling AI agents to navigate and interact with web pages through DOM snapshots, clicks, typing, and form operations.4014 npm14Apache 2.0