Scrape dynamic pages, verify sign-in flows, audit a landing page — the AI pilots a real Chrome.
Use case: scrape a dynamic (JS) page, fill a form, take screenshots, verify a user flow works — the AI drives a real Chrome.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@playwright/mcp@latest"]
}
}
}
First run:
npxinstalls the package. Add"--headless"to the args for an invisible run; without it you watch the browser act — perfect for a demo.⚠️ The server drives your installed Chrome. On a machine without Chrome, the first navigation fails and the AI just answers "I'm unable to access the page due to a browser error". Fix it without leaving the note — the server ships a tool for exactly this:
```ai tools=playwright.browser_install Install the browser. ```(or run
npx playwright install chromein a terminal.)
Exposed tools: browser_navigate, browser_click, browser_type,
browser_snapshot (accessibility), browser_take_screenshot,
browser_fill_form, browser_evaluate…
Go to https://news.ycombinator.com, grab the first 10 titles with their
scores, and render them as a markdown table sorted by score.
Open https://app.example.com, click "Sign in", enter
demo@example.com / demo1234, and tell me whether the dashboard loads.
Describe what you see at every step.
Load https://example.com, list the broken links in the menu and the
footer, and check that the download buttons point to URLs that respond.
When a browser tool fails, the model tends to summarize ("a browser error occurred") instead of showing the cause. Ask for the raw error — this works for any MCP server, not just Playwright:
Navigate to https://example.com and if it fails, show me the EXACT
raw error message from the tool, verbatim, without rephrasing.
A message like Chromium distribution 'chrome' is not found means the
browser is missing → run the browser_install block above.