Playwright MCP Server は公式ですか?
はい。Microsoft が `@playwright/mcp` として公開しており、GitHub の microsoft/playwright-mcp リポジトリで管理されています。
@microsoft
基本情報
Playwright MCP サーバー
以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}Close the page
Resize the browser window
Returns all console messages
Handle a dialog
Emulate CSS media features for the page, for example switch between the light and dark color scheme. Omitted parameters are left unchanged; null clears an override.
Evaluate JavaScript expression on page or element
Upload one or multiple files
Drop files or MIME-typed data onto an element, as if dragged from outside the page. At least one of "paths" or "data" must be provided.
Search the accessibility snapshot of the current page for text or a regular expression. Returns matching snapshot nodes with a few lines of surrounding context (like search snippets), each shown under its path from the root of the tree, which is cheaper than capturing the whole snapshot when you only need to locate an element and its ref.
Fill multiple form fields
Press a key on the keyboard
Type text into editable element
Navigate to a URL
Go back to the previous page in the history
Returns a numbered list of network requests since loading the page. Use browser_network_request with the number to get full details.
Returns full details (headers and body) of a single network request, or a single part if `part` is set. Use the number from browser_network_requests.
Run a Playwright code snippet. Unsafe: executes arbitrary JavaScript in the Playwright server process and is RCE-equivalent.
Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.
Capture accessibility snapshot of the current page, this is better than screenshot
Perform click on a web page
Perform drag and drop between two elements
Hover over element on page
Select an option in a dropdown
List, create, close, or select a browser tab.
Wait for text to appear or disappear or a specified time to pass
Playwright MCP Server は、Playwright を使って AI エージェントにブラウザ自動化機能を提供する Microsoft 公式の playwright mcp パッケージ(@playwright/mcp)です。LLM はスクリーンショットではなく構造化されたアクセシビリティスナップショットを通じて Web ページを読み取り操作するため、ビジョンモデルは必要ありません。
このプロジェクトは Apache-2.0 ライセンスのオープンソースで、microsoft/playwright-mcp リポジトリで管理されています。デフォルトでは stdio 経由でローカル実行され、MCP クライアントが URL で接続するスタンドアロンの HTTP サーバーとして起動することもできます。
前提条件:Node.js 18 以降と、Claude Code、Claude Desktop、Cursor、VS Code、Windsurf、Codex、Goose などの MCP クライアント。API キーやアカウントは不要です。
標準設定はほとんどのクライアントで動作します:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}
追加オプションは args リストに加えます。例:"--headless"、"--browser=firefox"、"--isolated"。
claude mcp add playwright npx @playwright/mcp@latest
MCP のインストールガイドに従い、上記の標準設定を Claude Desktop の設定ファイルに貼り付けます。
Cursor Settings -> MCP -> Add new MCP Server を開き、command タイプを選んで npx @playwright/mcp@latest を入力します。README にはワンクリックのインストールボタンもあります。
VS Code の MCP 設定で標準設定を使うか、コマンドラインからインストールします:
code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'
インストール後、VS Code の GitHub Copilot エージェントからサーバーを利用できます。
codex mcp add playwright npx "@playwright/mcp@latest"
または ~/.codex/config.toml に追加します:
[mcp_servers.playwright]
command = "npx"
args = ["@playwright/mcp@latest"]
Windsurf の MCP ドキュメントに従い、上記の標準設定を使います。
playwright mcp server を常駐プロセスとして動かす場合(たとえば IDE がヘッド付きブラウザを開けないマシン)、ポートを指定して起動します:
npx @playwright/mcp@latest --port 8931
続いてクライアントをそのエンドポイントに向けます:
{
"mcpServers": {
"playwright": {
"url": "http://localhost:8931/mcp"
}
}
}
Docker イメージ(mcr.microsoft.com/playwright/mcp)も公開されていますが、現時点ではヘッドレス Chromium のみ対応です。
--browser で chrome、firefox、webkit、msedge を選択でき、--device や --mobile でモバイル端末をエミュレートできます。--isolated によるメモリ内の分離セッション(--storage-state と併用可)、または Playwright ブラウザ拡張機能で起動中の Chrome や Edge のタブを再利用できます。--caps で有効化できます。PLAYWRIGHT_MCP_* 環境変数があり、--config で JSON 設定ファイルも読み込めます。--allowed-origins と --blocked-origins のリスト、HTTP サーバー用の --allowed-hosts。デフォルトのツールセットはコアな自動化をカバーします:
browser_navigate、browser_navigate_back、browser_resize、browser_close、タブの一覧・作成・クローズ・切り替えを行う browser_tabs。browser_snapshot はエージェントが要素を特定するためのアクセシビリティスナップショットを取得します。browser_find はスナップショット内をテキストや正規表現で検索し、完全なスナップショットより低コストです。browser_take_screenshot は画像を保存しますが、操作対象の選択には使えません。browser_click、browser_type、browser_fill_form、browser_select_option、browser_hover、browser_drag、browser_press_key、browser_file_upload、browser_drop、browser_handle_dialog。browser_console_messages、browser_network_requests、ヘッダーと本文を確認する browser_network_request、JavaScript を実行する browser_evaluate、テキストや時間を待つ browser_wait_for。browser_run_code_unsafe はサーバープロセス内で Playwright のコードスニペットを実行します。README では RCE(リモートコード実行)相当と明記されています。オプトインのツール群では browser_pdf_save(--caps=pdf)、browser_mouse_click_xy(--caps=vision)、browser_start_tracing(--caps=devtools)、browser_cookie_list(--caps=storage)、browser_route(--caps=network)、browser_verify_text_visible(--caps=testing)などが追加されます。
--codegen で TypeScript、Python、Java、C# を指定)。--port 8931 を付けて自分でサーバーを起動し、url で接続します。--isolated か別の --user-data-dir で起動します。--caps=pdf のように --caps で有効化します。file:// URL を読めない:ファイルアクセスはデフォルトでワークスペースのルートに制限されています。--allow-unrestricted-file-access で解除できますが、慎重に使ってください。はい。Microsoft が `@playwright/mcp` として公開しており、GitHub の microsoft/playwright-mcp リポジトリで管理されています。
はい。Apache-2.0 のオープンソースで、API キーや有料アカウントは不要です。費用がかかるのは利用する LLM クライアントだけです。
使えます。Claude Code は `claude mcp add playwright npx @playwright/mcp@latest`、VS Code は `code --add-mcp` に対応し、Cursor は MCP 設定に `npx @playwright/mcp@latest` コマンドを登録します。
いいえ。mcp playwright サーバーはデフォルトでアクセシビリティスナップショットを使います。座標ベースのツールは `--caps=vision` を有効にした場合のみ利用できます。
はい。デフォルトの永続プロファイルはセッション間でログイン状態を保持し、Playwright ブラウザ拡張機能(`--extension`)を使えば起動中の Chrome や Edge のタブに接続できます。
`--port` を付けて HTTP サーバーとして実行するか(すべてのインターフェースにバインドするには `--host 0.0.0.0`)、Docker で実行し、クライアントから URL で接続できます。
README はセキュリティ境界ではないと明記しています。オリジンの許可・ブロックリストはリダイレクトを防がず、`browser_run_code_unsafe` は任意のコードを実行できるため、エージェントとアクセス先のサイトを信頼できる環境でのみ使ってください。
`--browser` オプションで Chrome、Firefox、WebKit、Microsoft Edge に対応し、`--device` や `--mobile` でデバイスエミュレーションも可能です。

Model Context Protocol Servers
This MCP server provides browser automation capabilities through Puppeteer, allowing interaction with both new browser instances and existing Chrome windows.
BitBrowser MCP simple to use, no complicated procedures required. Supports a variety of intelligent agent services.
MCP server paired with a browser extension that enables AI agents to control the user's browser.
Playwright Model Context Protocol Server - Tool to automate Browsers and APIs in Claude Desktop, Cline, Cursor IDE and More 🔌
コメント