playwright-mcp icon

playwright-mcp

Inspect and control a browser through structured page snapshots.
DownloadActiveSelect a version to download a specific release.
playwright-mcp icon

About playwright-mcpv0.0.85

Last updated on

Playwright MCP connects an AI assistant to a browser through the Model Context Protocol. It shows the assistant a structured snapshot of a page’s elements, roles, and text. The assistant can then navigate, click, fill forms, and inspect what changed. For developers on Linux, this offers a way to investigate a live interface while working on the code behind it.

What can Playwright MCP do?

Its core browser tools cover navigation, form entry, tabs, screenshots, console messages, and network requests. An assistant could follow a checkout flow, check whether a settings form saved correctly, or inspect a page after an error. Accessibility snapshots make controls available as text references; screenshots help when layout or visual state matters.

Playwright MCP is most useful for tasks that develop as the assistant explores. It can inspect the current page, take an action, and use the next result to decide where to go. That flexibility comes with a cost: large page snapshots can take up considerable room in an agent’s context.

Using Playwright MCP on Linux

Add @playwright/mcp to an MCP-capable client such as Codex, Claude Code, or VS Code. In the standard setup, your MCP client starts Playwright MCP with npx and opens a visible browser. Add --headless to run it without a window.

When should I use Playwright MCP rather than Playwright CLI and skills?

Choose MCP when the assistant benefits from inspecting page structure and working through an open-ended browser session. Microsoft’s separate Playwright CLI and skills give coding agents concise browser commands and keep page data out of the model context unless needed. The CLI can also retain browser state during a session; the distinction is its command-based workflow, not an inability to maintain one.

For a different task, Chrome DevTools MCP focuses on Chrome debugging and performance traces. If you need an authored test suite with assertions that runs in CI, Playwright Test is the dedicated framework.

How do browser-session settings affect repeatable automation?

Playwright MCP saves cookies and login state in a persistent profile by default. That helps with continued work, but an earlier login can change how a later run behaves. Use --isolated for a fresh session, or load a known storage-state file when a task needs a specific authenticated starting point. Keep the browser, viewport, and starting state consistent when comparing runs.

Supported platforms

Latest version

v0.0.85Latest
  • https://api.github.com/repos/microsoft/playwright-mcp/tarball/v0.0.85
  • https://api.github.com/repos/microsoft/playwright-mcp/zipball/v0.0.85
  • ## ✨ Highlights
  • - **🌙 Keep the browser in the background** ([microsoft/playwright#42973](https://github.com/microsoft/playwright/issues/42973)) — connecting through the extension activated the tab and focused the browser window, taking the screen from the app you were working in. Pass `--background` alongside `--extension` (config `background: true`, env `PLAYWRIGHT_MCP_BACKGROUND=1`) to leave the connected tab inactive and its window unfocused, and to open the client's new tabs in the background. With `PLAYWRIGHT_MCP_EXTENSION_TOKEN` set, the connect page opens in the background too (Chrome 158.0.8127.2 or later, with the browser already running). Requires extension 0.5.0 or later. Chrome throttles timers and animation frames in background tabs. ([microsoft/playwright#43864](https://github.com/microsoft/playwright/pull/43864))
  • - **🗂️ Leave tabs out of the Playwright tab group** ([microsoft/playwright#43038](https://github.com/microsoft/playwright/issues/43038)) — the extension always moved the tabs a client controls into its own tab group. Pass `--no-tab-group` alongside `--extension` (config `tabGroup: false`, env `PLAYWRIGHT_MCP_NO_TAB_GROUP=1`) to keep the selected tab and the tabs the client opens in their existing groups, if any. Connection approval is unchanged, each controlled tab still belongs to one client, and the extension's status page lists the controlled tabs. Requires extension 0.5.0 or later. ([microsoft/playwright#43814](https://github.com/microsoft/playwright/pull/43814))
  • - **👁️ Match only visible elements** ([microsoft/playwright#43855](https://github.com/microsoft/playwright/issues/43855)) — a locator could resolve to a hidden element, or fail because a hidden duplicate matched as well. Set `browser.contextOptions.locateOnlyVisible: true` in the config file to restrict locators to visible elements, both in the `target` of element tools such as `browser_click` and in `browser_run_code_unsafe`, as if `.filter({ visible: true })` ended each of them. A locator that ends with its own visibility filter keeps it. Off by default. ([microsoft/playwright#43903](https://github.com/microsoft/playwright/pull/43903))
  • - **🏷️ Keep container names in snapshots** ([microsoft/playwright#43809](https://github.com/microsoft/playwright/issues/43809)) — dialogs, landmarks and tables could appear unnamed even when their heading or caption was visible. `browser_snapshot` now retains identifying names on containers and table headers when the text supplying the name also appears among their children. ([microsoft/playwright#43810](https://github.com/microsoft/playwright/pull/43810))
  • - **🎯 Find custom form controls by label** ([microsoft/playwright#43898](https://github.com/microsoft/playwright/issues/43898)) — native `<label>` associations were ignored for form-associated custom elements. Element tools now recognize these controls through targets such as `getByLabel('City')`, and accessible names use the associated labels too. Both `for` attributes and nested labels are supported. ([microsoft/playwright#43900](https://github.com/microsoft/playwright/pull/43900))
  • ## 🐛 Fixes
  • - `fix(aria): restore snapshot visibility rules for inert and modal content` — the filtering announced in v0.0.84 is reverted: `browser_snapshot` no longer hides content solely because it is inert or outside a modal dialog. Click, fill and select actions still wait for explicitly inert targets to become non-inert ([microsoft/playwright#43792](https://github.com/microsoft/playwright/issues/43792)). ([microsoft/playwright#43850](https://github.com/microsoft/playwright/pull/43850), [microsoft/playwright#43851](https://github.com/microsoft/playwright/pull/43851))
  • - `fix(mcp): preserve non-JSON evaluation results` — `browser_evaluate` returns readable representations of values such as BigInt, `NaN`, `Infinity`, `undefined` and circular objects instead of losing values or failing JSON serialization. JSON-compatible results keep their existing format ([#1838](https://github.com/microsoft/playwright-mcp/issues/1838)). ([microsoft/playwright#43973](https://github.com/microsoft/playwright/pull/43973))
  • - `fix(mcp): resolve config file paths relative to their source` — profile, executable, storage-state, output and other file paths in a config resolve against that file's directory, or its target's directory for a symlink. CLI and environment paths remain relative to the working directory. Extension connections also honor the merged executable-path configuration ([#1836](https://github.com/microsoft/playwright-mcp/issues/1836)). ([microsoft/playwright#43970](https://github.com/microsoft/playwright/pull/43970))
  • - `fix(extension): report lost tab instead of crashing` — tool responses report when a page closes before its snapshot can be captured. Extension connections also explain that Chrome may have detached the debugger because of an unsupported frame, rather than crashing response rendering ([microsoft/playwright#43230](https://github.com/microsoft/playwright/issues/43230)). ([microsoft/playwright#43863](https://github.com/microsoft/playwright/pull/43863))
  • - `fix(mcp): bound settle waits when page timers cannot run` — tool calls no longer hang during their settling delay when page timers are throttled, paused or otherwise unable to run ([microsoft/playwright#43752](https://github.com/microsoft/playwright/issues/43752)). ([microsoft/playwright#43767](https://github.com/microsoft/playwright/pull/43767))
  • - `fix(mcp): report event listener exceptions as console errors` — exceptions from page and context listeners installed through `browser_run_code_unsafe` appear in tool responses and `browser_console_messages` instead of escaping as unhandled errors ([microsoft/playwright#43770](https://github.com/microsoft/playwright/issues/43770)). ([microsoft/playwright#43686](https://github.com/microsoft/playwright/pull/43686))
  • - `fix(mcp): validate device names and preserve device descriptors` — unknown `--device` values produce an explicit error, and per-client overrides no longer mutate shared device presets ([#1834](https://github.com/microsoft/playwright-mcp/issues/1834)). ([microsoft/playwright#43971](https://github.com/microsoft/playwright/pull/43971))
  • - `fix(mcp): report one-based console source lines` — source locations in `browser_console_messages` and console entries in tool responses now use editor-style line numbers starting at 1 ([#1839](https://github.com/microsoft/playwright-mcp/issues/1839)). ([microsoft/playwright#43975](https://github.com/microsoft/playwright/pull/43975))
  • - `fix(mcp): clarify screenshot actions with vision tools` — the `browser_take_screenshot` description no longer rules out acting on a screenshot. `browser_snapshot` stays the default for actions; with `--caps=vision`, the description points to the coordinate-based mouse tools for elements that the snapshot does not expose, such as canvas content ([#1816](https://github.com/microsoft/playwright-mcp/issues/1816)). ([microsoft/playwright#43857](https://github.com/microsoft/playwright/pull/43857))
  • - `fix(aria): match mixed-case selected options in accessible names` — snapshots and role locators include the selected option's text when a custom listbox uses a mixed-case value such as `aria-selected="TRUE"` ([microsoft/playwright#43785](https://github.com/microsoft/playwright/issues/43785)). ([microsoft/playwright#43787](https://github.com/microsoft/playwright/pull/43787))
  • - `fix(chromium): preserve fonts when connecting with noDefaults` — extension connections no longer overwrite the existing browser's font settings, avoiding unexpected changes to page rendering ([microsoft/playwright#43715](https://github.com/microsoft/playwright/issues/43715)). ([microsoft/playwright#43773](https://github.com/microsoft/playwright/pull/43773))
  • - `fix(chromium): honor Linux config directories for channel connections` — extension profile lookup respects `CHROME_USER_DATA_DIR`, `CHROME_CONFIG_HOME` and `XDG_CONFIG_HOME`. Channel-based `--cdp-endpoint` connections also use the WebSocket path advertised in `DevToolsActivePort` ([microsoft/playwright#43880](https://github.com/microsoft/playwright/issues/43880)). ([microsoft/playwright#43884](https://github.com/microsoft/playwright/pull/43884))
  • - `fix(chromium): preserve HTTP navigations across HTTPS upgrade modes` — in browsers launched by the server, `browser_navigate` keeps HTTP URLs on HTTP instead of Chrome automatically upgrading them to HTTPS ([microsoft/playwright#43871](https://github.com/microsoft/playwright/issues/43871)). ([microsoft/playwright#43877](https://github.com/microsoft/playwright/pull/43877))
  • - `fix(chromium): account for tabs and toolbar in the new headless mode` — with `--headless`, Chrome and Edge now size their window to fit the viewport below the tab strip and toolbar, so videos from `browser_start_video` (opt-in via `--caps=devtools`) no longer lose the bottom of the page. ([microsoft/playwright#43904](https://github.com/microsoft/playwright/pull/43904))
  • - `fix(screenshot): support full-page SVG documents` — `browser_take_screenshot` with `fullPage: true` works on standalone SVG documents instead of waiting for a nonexistent HTML body ([microsoft/playwright#43962](https://github.com/microsoft/playwright/issues/43962)). ([microsoft/playwright#43972](https://github.com/microsoft/playwright/pull/43972))

Requirements

  • - Node.js 18 or newer
  • - VS Code
  • Cursor
  • Windsurf
  • Claude Desktop
  • Goose
  • Grok
  • Junie or any other MCP client

Rate this app

No ratings yet

No comment yet

Be the first to share your thoughts.

Comments appear after an editor approves them.

License

Apache-2.0

Latest version

v0.0.85
Report incorrect information

Recently updated software