The Playwright MCP server gives an AI client a controllable browser — navigate pages, click, fill forms, scrape content and take snapshots. It is Microsoft's official server and uses the accessibility tree rather than screenshots, so it is fast and reliable. Here is the setup.
Configure the client
The simplest setup needs nothing pre-installed — npx fetches it on demand:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@playwright/mcp@latest"]
}
}
}
Restart Claude Desktop or Cursor. The first run downloads a browser, which can take a minute. See MCP config file location if you need the path.
Useful flags
--headless— run without a visible window (good for servers/CI).--browser chromium|firefox|webkit— pick the engine.--device "iPhone 15"— emulate a device.
Add them inside the args array, e.g. ["-y", "@playwright/mcp@latest", "--headless"].
Verify
Ask: "Open example.com and tell me the page heading." The agent should navigate and report the live <h1>. Try "fill the search box with 'mcp' and submit" to confirm interaction works.
Common problems
browserType.launch: Executable doesn't exist— the browser binary did not download. Runnpx playwright installonce manually.- First call times out — the initial browser download is slow; retry after it finishes.
- Headful window keeps popping up — add
--headless. - No tools in client — Node 18+ required. See Cursor MCP not working.
Safety
A browser-driving agent can navigate anywhere and submit forms. Avoid pointing it at authenticated sessions you care about, and review actions on sensitive sites. More in MCP security best practices.
Going further
Playwright pairs with filesystem and web-search servers for research-and-capture workflows. Browse curated loadouts or the browser automation category. Wondering Playwright vs Puppeteer? That comparison is on our roadmap — meanwhile, submit your own server.