name: playwright-mcp
description: |
Browser automation via the official Playwright MCP servers. Use for Firefox,
WebKit/Safari-class, Microsoft Edge, cross-browser comparison, Playwright
trace/video capture, browser-side network mocking, or Playwright TypeScript
test generation when Chromium-only automation is not enough. Triggers include
requests to "use playwright-mcp", "reproduce this bug in Firefox",
"compare this flow across Firefox, WebKit, and Edge and tell me where it
behaves differently", "record a Playwright trace and video", or "turn this
exploratory browser flow into generated Playwright TypeScript test code". DO NOT use for:
routine Chrome/Chromium automation, one-off screenshots or scraping
that agent-browser already handles well, or live Chrome DevTools debugging
in the user's current Chrome session (use chrome-devtools-mcp instead).
Note: "WebKit/Safari-class" here = the Playwright WebKit binary, not a
Tauri or Electron embedded WKWebView. For Tauri 2.0 webviews, use
tauri-plugin-mcp instead.
compatibility: "OpenCode, Codex CLI, GitHub Copilot, Kiro. Requires Playwright MCP servers configured by setup.sh or client-native MCP config."
Playwright MCP
Use the official Playwright MCP servers when browser-engine coverage or Playwright-specific test features matter more than lightweight Chromium automation.
Use This Skill or Another One?
| Testing job | Use this skill? | Why |
|---|---|---|
| Firefox-only bug | Yes | Repo-managed Playwright provides a dedicated Firefox server |
| WebKit / Safari-class repro | Yes | WebKit coverage is a Playwright-specific differentiator |
| Edge-specific behavior | Yes | Repo-managed Playwright provides a dedicated Edge server |
| Cross-engine compare across Firefox / WebKit / Edge | Yes | This skill is the repo's cross-engine front door |
| Mobile emulation, network mocking, generated Playwright code, trace/video artifacts | Yes | These are Playwright-specific workflows, not generic browser driving |
| Routine Chrome/Chromium form flow, screenshots, scraping | No — use agent-browser |
Faster and simpler for routine Chromium automation |
| Live Chrome session, DevTools-selected element, console/network/Lighthouse/performance in current Chrome | No — use chrome-devtools-mcp |
Those are Chrome DevTools workflows, not Playwright workflows |
Prerequisite
Install the MCP servers via the repo-managed setup:
./setup.sh opencode --with-playwright-mcp
./setup.sh codex --with-playwright-mcp
./setup.sh copilot --with-playwright-mcp
./setup.sh kiro --with-playwright-mcp
Repo-managed defaults:
| Mode | Setup flag | Availability | Result |
|---|---|---|---|
| Default | --with-playwright-mcp |
Repo-managed default | Firefox / WebKit / Edge servers with --headless --caps=testing |
| Visible browser | --playwright-headed |
Repo-managed opt-in | Removes --headless |
| Trace / video helpers | --playwright-caps-devtools |
Repo-managed opt-in | Adds --caps=devtools |
| Storage helpers | --playwright-caps-storage |
Repo-managed opt-in | Adds --caps=storage |
| Network mocking | --playwright-caps-network |
Repo-managed opt-in | Adds --caps=network |
| Isolated profile | --playwright-isolated |
Repo-managed opt-in | Adds --isolated |
| Predictable artifacts | --playwright-output-dir PATH |
Repo-managed opt-in | Adds --output-dir=PATH |
If Playwright MCP is not configured for the current harness, do not improvise a replacement workflow. Tell the user the integration is not installed yet.
Server Names
| Browser target | MCP server name |
|---|---|
| Firefox | playwright-firefox |
| WebKit / Safari-class | playwright-webkit |
| Microsoft Edge | playwright-msedge |
One Playwright MCP server instance maps to one browser engine. For cross-engine checks, use more than one configured Playwright MCP server instead of trying to switch engines mid-session.
Decision Flow
- If the ask is Firefox, WebKit/Safari-class, Edge, or a cross-engine comparison, use the matching Playwright MCP server or multiple Playwright MCP servers.
- If the ask is mobile emulation, network mocking, trace/video evidence, or generated Playwright code, use this skill if the required capability is repo-managed or explicitly configured.
- If the ask is just open the page, fill the form, click through, take a screenshot, or similar routine Chromium automation, stop and use
agent-browser. - If the ask is about the user's current Chrome session, DevTools context, console/network investigation, Lighthouse, or performance in Chrome, stop and use
chrome-devtools-mcp.
60-Second Quickstart
Fast single-engine verification (4 calls)
Use this when one non-Chromium engine is the main question.
browser_navigatebrowser_snapshotbrowser_clickorbrowser_fill_formbrowser_verify_text_visible,browser_verify_element_visible, orbrowser_run_code_unsafe
Cross-engine fan-out (5 calls total per engine group)
Use this when the user wants Firefox / WebKit / Edge comparison, not a Chrome workflow.
- Start with one Playwright MCP server per target engine
browser_navigateon each enginebrowser_snapshoton each enginebrowser_run_code_unsafeorbrowser_verify_*on each engine- Report only the engine-specific differences
Keep the verification logic identical across engines so the diff is meaningful.
Operational Rules
- Prefer
browser_fill_formover repeatedbrowser_typeloops for forms. - Prefer
browser_run_code_unsafefor compact deterministic assertions when you can express the whole check in one scripted step. - Prefer
browser_snapshotoverbrowser_take_screenshotfor actions. Use screenshots when the user explicitly needs image evidence. - Use the repo-managed default
verify_*tools first for cross-engine confirmation. They are available because the repo enables--caps=testingby default. - Do not assume gated tools exist.
browser_route*, trace/video helpers, and storage helpers only exist when the corresponding repo-managed opt-in cap was configured. - Treat mobile emulation and extension/CDP attachment as capability-specific workflows, not as the default mode of this skill.
- Do not imply Chromium coverage through Playwright in this repo. The repo does not configure a Playwright Chromium server.
Workflow Boundaries
Cross-engine verification workflow
- Pick the exact Playwright MCP server(s) for Firefox, WebKit, or Edge.
- Navigate directly to the page under test.
- Interact once with
browser_fill_form,browser_click, or a compactbrowser_run_code_unsafe. - Confirm with
browser_verify_*or one deterministic script assertion. - Report only the differences between engines.
QA artifact workflow
- Use
--playwright-caps-devtoolsonly when the user explicitly needs Playwright trace/video artifacts. - If artifact files need a predictable location, also use
--playwright-output-dir PATH. - Keep trace/video collection opt-in; it is heavier than the default verification path.
Network mocking workflow
- Use
--playwright-caps-networkwhen the ask requiresbrowser_route,browser_route_list,browser_unroute, or offline simulation. - If network mocking is not enabled, say so instead of pretending the tools exist.
Capability Availability
- Repo-managed default:
--headless,--caps=testing - Repo-managed opt-in:
--playwright-caps-devtools,--playwright-caps-storage,--playwright-caps-network,--playwright-isolated,--playwright-output-dir - Upstream/manual-only unless the user configured them separately:
--device,--storage-state,--init-page,--init-script,--extension,--cdp-endpoint,--save-session,--shared-browser-context
Read the references before depending on a capability that is not repo-managed by default.
Deep-Dive References
| Reference | When to Read It |
|---|---|
| references/tool-inventory.md | Tool categories, core vs gated tools, and preferred tool choices |
| references/cross-browser-recipes.md | Compact Playwright-only recipes for WebKit, Edge, fan-out, mocking, and codegen |
| references/capabilities-and-flags.md | Repo-managed defaults, opt-in caps, and upstream/manual-only flags |
| references/emulation-and-state.md | Device emulation, viewport/state setup, isolated mode, and storage state |
| references/cdp-and-extension.md | Playwright extension/CDP attachment and the boundary with chrome-devtools-mcp |
| references/troubleshooting.md | Missing browsers, headed-mode issues, profile conflicts, sandbox, and missing capability tools |
Notes
- This skill is MCP-first. Do not switch to a generic browser CLI unless the task no longer needs Playwright-specific value.
- WebKit is the closest Safari-class engine available here, but it is not identical to every Safari environment detail.
- Keep routine Chromium automation with
agent-browser, and keep live Chrome DevTools workflows withchrome-devtools-mcp.