Playwright Server MCP
プレイライトサーバー MCP サーバー
\Playwrightツールを備えたMCPサーバー\
コンポーネント
リソース
サーバーは、次の機能を備えたシンプルなメモ保存システムを実装します。
個々のノートにアクセスするためのカスタム note:// URI スキーム
各ノートリソースには、名前、説明、text/plain mimetype があります。
プロンプト
サーバーは単一のプロンプトを提供します:
要約ノート: 保存されているすべてのノートの要約を作成します
詳細レベル(簡潔/詳細)を制御するためのオプションの「スタイル」引数
現在のすべてのメモをスタイルの好みに合わせて組み合わせたプロンプトを生成します
ツール
サーバーは次のツールを実装します。
playwright_navigate: 指定されたURLへ移動します。アクティブなセッションがない場合、この操作は自動的に新しいセッションを作成します。url引数 (文字列) が必要です。
playwright_screenshot: 現在のページまたは特定の要素のスクリーンショットを撮ります。スクリーンショット ファイル名には
name引数 (文字列) が必要です。スクリーンショットを撮影する要素のCSSセレクターを指定するためのオプションの
selector引数(文字列)。セレクターが指定されていない場合は、ページ全体のスクリーンショットが撮影されます。
playwright_click: CSS セレクターを使用してページ上の要素をクリックします。クリックする要素の CSS セレクターを指定するには、
selector引数 (文字列) が必要です。
playwright_fill: 入力フィールドに入力します。入力フィールドの CSS セレクターを指定するには、
selector引数 (文字列) が必要です。入力する値を指定するには、
value引数 (文字列) が必要です。
playwright_evaluate: ブラウザコンソールで JavaScript コードを実行します。実行する JavaScript コードを指定するには、
script引数 (文字列) が必要です。
playwright_click_text: ページ上の要素をテキストコンテンツでクリックします。クリックする要素のテキスト コンテンツを指定するには、
text引数 (文字列) が必要です。
playwright_get_text_content: 表示されているすべての要素のテキスト コンテンツを取得します。playwright_get_html_content: ページの HTML コンテンツを取得します。要素の CSS セレクターを指定するには、
selector引数 (文字列) が必要です。
Related MCP server: Cloudflare Playwright MCP
構成
[TODO: 実装に固有の構成の詳細を追加する]
クイックスタート
インストール
クロードデスクトップ
MacOS の場合: ~/Library/Application\ Support/Claude/claude_desktop_config.json Windows の場合: %APPDATA%/Claude/claude_desktop_config.json
発達
建築と出版
配布用のパッケージを準備するには:
依存関係を同期し、ロックファイルを更新します。
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 C:\Users\YUNYING\Documents\project\python\mcp\playwright-server run playwright-server起動すると、ブラウザでアクセスしてデバッグを開始できる URL がインスペクタに表示されます。
Available Tools
8 toolsplaywright_clickC
Click an element on the page using CSS selector
Inputs: selector (required).
playwright_click_textB
Click an element on the page by its text content
Inputs: text (required).
playwright_evaluateC
Execute JavaScript in the browser console
Inputs: script (required).
playwright_fillC
Fill out an input field
Inputs: selector (required), value (required).
playwright_get_html_contentC
Get the HTML content of the page
Inputs: selector (required).
playwright_get_text_contentB
Get the text content of all elements
Inputs: no named parameters.
playwright_screenshotC
Take a screenshot of the current page or a specific element
Inputs: name (required), selector.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Most tools have distinct purposes targeting different page interactions (clicking, filling, navigating, etc.), but 'playwright_get_html_content' and 'playwright_get_text_content' could potentially be confused as both retrieve content from the page, though their descriptions clarify the difference. Overall, the overlap is minimal and manageable.
All tool names follow a consistent 'playwright_' prefix with snake_case and clear verb_noun patterns (e.g., playwright_click, playwright_navigate). This predictability makes it easy for agents to understand and select tools without confusion.
With 8 tools, this server is well-scoped for a Playwright automation purpose, covering essential actions like navigation, interaction, content retrieval, and screenshots. Each tool serves a clear, necessary function without bloat or redundancy.
The toolset covers core web automation tasks effectively, including navigation, element interaction, content extraction, and screenshots. A minor gap exists in advanced operations like handling pop-ups, waiting for elements, or managing sessions explicitly, but agents can likely work around these with the provided tools.
Maintenance
Related MCP Connectors
Playwright browser automation — navigate, click, fill forms, extract, screenshot — 17 agent tools.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Hosted browser for agents: open pages, search the web, extract data, read PDFs and take screenshots.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Related MCP Servers
- AlicenseBqualityDmaintenanceA server that enables browser automation using Playwright, allowing interaction with web pages, capturing screenshots, and executing JavaScript in a browser environment through LLMs.1213,391 npm1MIT
- AlicenseBqualityFmaintenanceA server that leverages Playwright for automated browser testing and integrates with Cloudflare Workers, enabling AI assistants to control web browsers for navigation, interaction, and screenshots.22261Apache 2.0
- AlicenseCqualityBmaintenanceA comprehensive MCP server that provides powerful web automation tools using Playwright, enabling web scraping, testing, and browser interaction through natural language commands.3815MIT
- AlicenseNot gradedqualityNot gradedmaintenanceA server that enables AI assistants to control a browser through tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.Apache 2.0