Playwright MCP: Documentation
Updated:
Connection
npx @playwright/mcp@latest(stdio). Client configs for Claude/Cursor/VS Code are in the repo README.- Docker:
docker run -i --rm mcr.microsoft.com/playwright/mcp. - Standalone HTTP server:
npx @playwright/mcp@latest --port 8931. - Flags:
--browser(chromium/firefox/webkit/msedge),--headless,--viewport-size,--device,--isolated,--proxy-server.
Tools (core set)
browser_navigate,browser_navigate_back,browser_click,browser_type,browser_hover,browser_drag,browser_select_option— navigation and input.browser_fill_form— fill multiple form fields in one call.browser_snapshot— accessibility-tree snapshot of the page (the primary "vision" tool, pixel-free).browser_take_screenshot,browser_pdf_save— visual screenshot and PDF export.browser_console_messages,browser_network_requests,browser_network_request— console output and network requests.browser_tabs,browser_file_upload,browser_handle_dialog,browser_wait_for— tabs, file uploads, dialogs, waiting on conditions.browser_evaluate,browser_run_code_unsafe— run JS/Playwright code on the page.
Optional capability sets (--caps=...)
vision— coordinate-based clicks (browser_mouse_click_xyetc.) instead of the accessibility tree.pdf— save the page as PDF.storage— cookies, localStorage, sessionStorage, session save/restore.network— mock network responses (browser_route), offline mode.devtools— tracing, video recording, on-page annotations.testing— locator generation and visibility/value assertions.
Agent flow
Verifying your own UI, e2e runs, filling forms on sites without an API, scraping interactive pages.
Limits
The server itself is free, but it drives a real local browser (Chromium/Firefox/WebKit/Edge), so it needs CPU/memory on the machine running the MCP client.