
This playbook is part of our MCP playbooks, within The MCP Guide. Want help setting it up for your team? Request a free MCP readiness review.
Browser testing is the work of clicking through a site the way a customer would and catching what breaks: a form that won't submit, a console error, a slow page. QA staff and developers do it before releases and after bug reports. With MCP (Model Context Protocol), a coding agent can drive a real browser through the Playwright MCP server or the Chrome DevTools MCP server, then report what it saw.
This playbook covers exploratory checks, not a replacement for your test suite. It works best before a release, after a bug report, or when a page changes and nobody has written tests for it yet. It uses tool names from each project's documentation as of October 2026. The agent explores and reports. A person decides what counts as a bug and what gets fixed.
Key Takeaways
- Playwright MCP works from "structured accessibility snapshots, bypassing the need for screenshots," according to Microsoft's README.
- Chrome DevTools MCP's tool reference lists 60 tools, including
list_console_messages,list_network_requests,performance_start_traceandlighthouse_audit. - Microsoft says "Playwright MCP is not a security boundary," and Google warns DevTools MCP "exposes content of the browser instance to the MCP clients."
- Use staging sites and test accounts. Never let the agent log in with a real customer or admin account.
- Turn every confirmed bug into a permanent automated test, so the fix stays fixed.
What you need
- Playwright MCP server for user flows across Chromium, Firefox and WebKit. See our Playwright MCP server profile.
- Chrome DevTools MCP server for console, network, performance and Lighthouse checks in Chrome. See our Chrome DevTools MCP server profile.
- A coding agent. Setup guides: Claude Code to Playwright and VS Code to Chrome DevTools.
- A staging URL and test accounts, plus a written list of flows to check (sign-up, checkout, contact form).
Microsoft's Playwright MCP README also notes that coding agents "might benefit from using the CLI+SKILLS instead," because CLI workflows are more token-efficient. MCP suits persistent, exploratory sessions, which is what this playbook is.
The workflow
- Open the page. With Playwright,
browser_navigateloads the URL. With DevTools,navigate_pageornew_page. - Read the page structure. Playwright's
browser_snapshotreturns the accessibility snapshot the agent uses to find buttons and fields. DevTools hastake_snapshot. - Walk the flow. Playwright's
browser_click,browser_typeandbrowser_fill_formcomplete a sign-up or checkout with test data.browser_wait_forwaits for text or time. DevTools offersclick,fill,fill_formandwait_for. - Assert what should be true. With
--caps=testing, Playwright adds opt-in assertion tools such asbrowser_verify_text_visible,browser_verify_element_visibleandbrowser_verify_value. - Check the console and network. Playwright's
browser_console_messagesandbrowser_network_requests, or DevTools'list_console_messagesandlist_network_requests, show JavaScript errors and failed requests during the flow.get_network_requestopens one request. - Check mobile layout. DevTools'
emulateandresize_pagechange the device or viewport. - Run an audit. DevTools' tool reference says
lighthouse_auditcovers accessibility, SEO, best practices and agentic browsing, but not performance. For performance, useperformance_start_trace,performance_stop_traceandperformance_analyze_insight. - Capture evidence.
browser_take_screenshot(Playwright) ortake_screenshot(DevTools) saves what the agent saw. - Report and convert. The agent writes a bug list with steps, console errors and screenshots. A developer confirms each one, then asks the agent to write a Playwright test file that reproduces it for your normal test suite.
Example prompts
- "Open https://staging.example.com, go through sign-up with the test email in TEST_USER, and tell me where the flow fails."
- "Fill the contact form with test data, submit it, and list any console errors and failed network requests during the submit."
- "Emulate an iPhone-size viewport and check that the main menu opens and every link in it loads."
- "Run a Lighthouse audit on the pricing page for accessibility and SEO and summarize the failed checks."
- "Record a performance trace of the home page load and explain the biggest insight."
Guardrails
- Know the limits. Microsoft states "Playwright MCP is not a security boundary," and its
--allowed-originsoption, which allows all origins by default, is not one either. Treat both servers as powerful tools, not sandboxes. - Keep file access tight. Playwright limits file access to workspace roots by default and blocks
file://navigation unless you set--allow-unrestricted-file-access. Leave that off. - Use isolated profiles. Playwright's
--isolatedkeeps the browser profile in memory, so storage is lost when the session closes. That keeps real cookies out of the agent's browser. - Avoid the unsafe tools unless needed. Playwright's
browser_evaluateandbrowser_run_code_unsafe, and DevTools'evaluate_script, run code in the page. Require approval for each call. - Protect what's on screen. Google's Chrome DevTools MCP README says the server "exposes content of the browser instance to the MCP clients." Don't browse to email, banking or admin consoles in that browser.
- Check telemetry settings. DevTools MCP collects usage statistics by default; opt out with
--no-usage-statistics. Its performance tools may send trace URLs to Google's CrUX API unless you pass--no-performance-crux. - Page text is untrusted. A page can carry instructions aimed at the agent. Read prompt injection through MCP and the MCP Security Center.
What to measure
- Bugs found per exploratory session that a person confirms as real.
- False alarms: reported issues that turn out to be expected behavior.
- Bugs converted into automated tests, as a share of confirmed bugs.
- Escaped defects: bugs found in production in flows the agent checked.
- Session cost, in tool calls or tokens, from your client's logs.
Compare release to release with your own numbers. No outside benchmark fits your site.
Next step
More workflows are in the MCP playbooks hub. If you want agent-driven browser checks set up next to your existing tests, our Claude Code consulting team can help plan it.
Frequently asked questions
Should I use Playwright MCP or Chrome DevTools MCP?
Use Playwright for user flows, especially if you need Firefox or WebKit. Use DevTools for Chrome-specific debugging such as performance traces, Lighthouse audits and memory snapshots. Many teams connect both.
Can the agent write Playwright tests?
It can write test files with your coding agent's normal file tools once it has walked a flow. A developer should review and run those tests in your suite, because the MCP session itself is not your test run.
Does Playwright MCP use screenshots?
Not by default. Microsoft says it works from accessibility snapshots instead. Screenshots are available through browser_take_screenshot, and the --caps=vision option adds coordinate-based tools.
Can it test pages behind a login?
Yes, if the agent signs in with test credentials during the session. Use a dedicated test account with no real data, and an isolated browser profile so nothing persists after the session.











