Skip to content

Releases: microsoft/playwright-mcp

v0.0.68

14 Feb 23:17
066e54b

Choose a tag to compare

Quick follow-up bug fix

  • Revert --no-sandbox--no-chromium-sandbox rename.
    The CLI flag name is restored to --no-sandbox.

v0.0.67

14 Feb 02:36
bd1428d

Choose a tag to compare

Extension

Bug Fixes

  • Rename --[no-]sandbox to --[no-]chromium-sandbox for clarity and to avoid ambiguity with other browsers.

v0.0.64

06 Feb 01:15
e39e83b

Choose a tag to compare

🕶️ Incognito by default

Browser profiles are now in-memory by default — every session starts clean with no leftover state.

Use --persistent to opt into a persistent profile, or --profile=<path> to specify a custom profile directory:

> playwright-cli open example.com                       # incognito, clean slate
> playwright-cli open example.com --persistent          # persistent profile
> playwright-cli open example.com --profile=./my-data   # custom profile directory

🔀 Simplified session management

The --session flag has been replaced with the shorter -s=. Session lifecycle is simplified — there is no longer a "stopped" state; sessions are either running or gone.

> playwright-cli -s=myapp open example.com
> playwright-cli -s=myapp click e5
> playwright-cli -s=myapp close
> playwright-cli -s=myapp delete-data

New session management commands replace the old session-* family:

> playwright-cli list        # list all sessions
> playwright-cli close-all   # close all browsers
> playwright-cli kill-all    # forcefully kill all browser processes

🏗️ Workspace-scoped daemon

Each workspace now gets its own daemon process, preventing cross-project interference and enabling direct daemon startup for faster, more reliable operation.

v0.0.63

04 Feb 00:02
de6776f

Choose a tag to compare

🗄️ Browser storage & authentication state control

Full introspection and manipulation of browser storage, enabling reproducible auth flows, debugging, and stateful automation.

> playwright-cli state-save auth.json
> playwright-cli state-load auth.json

Inspect and manage cookies:

> playwright-cli cookie-list
> playwright-cli cookie-get session_id
> playwright-cli cookie-set session_id abc123 --domain=example.com
> playwright-cli cookie-delete session_id
> playwright-cli cookie-clear

Work directly with Web Storage APIs:

# LocalStorage
> playwright-cli localstorage-list
> playwright-cli localstorage-get theme
> playwright-cli localstorage-set theme dark
> playwright-cli localstorage-clear

# SessionStorage
> playwright-cli sessionstorage-list
> playwright-cli sessionstorage-set wizardStep 3
> playwright-cli sessionstorage-clear

Perfect for:

  • Persisting login sessions
  • Debugging auth and feature flags
  • Sharing reproducible browser state across runs

🌐 Powerful network & API request mocking

Intercept, mock, modify, or block network requests directly from the CLI — no test harness required.

Simple CLI-based request mocking

Mock responses by URL pattern with custom status codes, bodies, headers, or request mutations.

# Mock with custom status
> playwright-cli route "**/*.jpg" --status=404

# Mock with JSON body
> playwright-cli route "**/api/users" \
    --body='[{"id":1,"name":"Alice"}]' \
    --content-type=application/json

# Mock with custom headers
> playwright-cli route "**/api/data" \
    --body='{"ok":true}' \
    --header="X-Custom: value"

# Strip sensitive headers from outgoing requests
> playwright-cli route "**/*" --remove-header=cookie,authorization

Manage active routes:

> playwright-cli route-list
> playwright-cli unroute "**/*.jpg"
> playwright-cli unroute

Use cases:

  • Frontend development without a backend
  • Offline and error-state testing
  • Snapshot stability and deterministic rendering

Flexible URL pattern matching

Routes support glob-style patterns for precise targeting:

**/api/users           Exact path match
**/api/*/details       Wildcards within paths
**/*.{png,jpg,jpeg}    File extension matching
**/search?q=*          Query parameter matching

🧠 Advanced request handling with run-code

For conditional logic, request inspection, response mutation, or timing control, drop down to raw Playwright routing via run-code.

Conditional responses based on request data

> playwright-cli run-code "async page => {
  await page.route('**/api/login', route => {
    const body = route.request().postDataJSON();
    if (body.username === 'admin') {
      route.fulfill({ body: JSON.stringify({ token: 'mock-token' }) });
    } else {
      route.fulfill({ status: 401, body: JSON.stringify({ error: 'Invalid' }) });
    }
  });
}"

Modify real backend responses

> playwright-cli run-code "async page => {
  await page.route('**/api/user', async route => {
    const response = await route.fetch();
    const json = await response.json();
    json.isPremium = true;
    await route.fulfill({ response, json });
  });
}"

Simulate network failures

> playwright-cli run-code "async page => {
  await page.route('**/api/offline', route =>
    route.abort('internetdisconnected')
  );
}"

🧠 SKILLS

Local SKILLS installation

> playwright-cli install-skills

Other

Browser installation (renamed)

> playwright-cli install-browser

Ephemeral browser contexts (renamed)

> playwright-cli config --in-memory

Renamed from --isolated to better reflect behavior:

  • Browser profile lives only in memory
  • Nothing persisted to disk
  • Clean state on every run

v0.0.62

31 Jan 01:37
d246fff

Choose a tag to compare

Infrastructure for Playwright CLI is in, so we are ready to cook the features and skills!

⚡ Lightning fast Playwright CLI executable (http://github.com/microsoft/playwright-cli)

> playwright-cli open example.com
> time playwright-cli snapshot
0.03s user 0.01s system cpu 0.055 total

🎥 On-demand video recording

> playwright-cli video-start
> playwright-cli open playwright.dev
> playwright-cli video-stop
### Result
- [Video](.playwright-cli/video-2026-01-31T00-49-47-976Z.webm)

Also available with the --caps=devtools flag in Playwright MCP.

🔧 Persistent session configuration

> playwright-cli config --headed --config=config.json
> playwright-cli open playwright.dev

Countless configuration options

☁️ Isolated (ephemeral) browser context, non-chromium browser shortcuts

> playwright-cli install --browser=firefox
> playwright-cli config --isolated --browser=firefox --headed
> playwright-cli open playwright.dev 

🔌 Playwright Chrome extension + Playwright CLI = ❤️

> playwright-cli --session=real-browser snapshot --extension

Share the tab and have fun!

v0.0.61

26 Jan 22:55
cd9819d

Choose a tag to compare

  • Internal: release the "mcp" binary and scope it to playwright in NPX world

v0.0.60

26 Jan 18:35
9e176c4

Choose a tag to compare

Bugfixes

  • Fixing the Windows CLI

v0.0.59

25 Jan 19:24
f531b2c

Choose a tag to compare

Full Playwright CLI configuration:

📣 Playwright CLI

We are adding a new token-efficient CLI mode of operation to Playwright with the skills located at playwright-cli. This brings the long-awaited official SKILL-focused CLI mode to our story and makes it more coding agent-friendly.

It is the first snapshot with the essential command set (which is already larger than the original MCP!), but we expect it to grow rapidly. Unlike the token use, that one we expect to go down since snapshots are no longer forced into the LLM!

Installation

npm install -g @playwright/mcp@latest
playwright-cli --help

Demo

Your agent will be running those, but it does not mean you can't play with it:

playwright-cli open https://demo.playwright.dev/todomvc/ --headed
playwright-cli type "Buy groceries"
playwright-cli press Enter
playwright-cli type "Water flowers"
playwright-cli press Enter
playwright-cli check e21
playwright-cli check e35
playwright-cli press screenshot

Skills-less operation

Point your agent at the CLI and let it cook. It'll read the skill off playwright-cli --help on its own:

Test the "add todo" flow on https://demo.playwright.dev/todomvc using playwright-cli.
Check playwright-cli --help for available commands.

Installing skills

Claude Code, GitHub copilot and others will let you install the Playwright skills into the agentic loop.

plugin (recommended)

/plugin marketplace add microsoft/playwright-cli
/plugin install playwright-cli

manual

mkdir -p .claude/skills/playwright-cli
curl -o .claude/skills/playwright-cli/SKILL.md \
  https://raw.githubusercontent.com/microsoft/playwright-cli/main/skills/playwright-cli/SKILL.md

Headed operation

Playwright CLI is headless by default. If you'd like to see the browser, pass --headed to open:

playwright-cli open https://playwright.dev --headed

Sessions

Playwright CLI will use a dedicated persistent profile by default. It means that
your cookies and other storage state will be preserved between the calls. You can use different
instances of the browser for different projects with sessions.

Following will result in two browsers with separate profiles being available. Pass --session to
the invocation to talk to a specific browser.

playwright-cli open https://playwright.dev
playwright-cli --session=example open https://example.com
playwright-cli session-list

You can run your coding agent with the PLAYWRIGHT_CLI_SESSION environment variable:

PLAYWRIGHT_CLI_SESSION=todo-app claude .

Or instruct it to prepend --session to the calls.

Manage your sessions as follows:

playwright-cli session-list             # list all sessions
playwright-cli session-stop [name]      # stop session
playwright-cli session-stop-all         # stop all sessions
playwright-cli session-delete [name]    # delete session data along with the profiles

Commands

Core

playwright-cli open <url>               # open url
playwright-cli close                    # close the page
playwright-cli type <text>              # type text into editable element
playwright-cli click <ref> [button]     # perform click on a web page
playwright-cli dblclick <ref> [button]  # perform double click on a web page
playwright-cli fill <ref> <text>        # fill text into editable element
playwright-cli drag <startRef> <endRef> # perform drag and drop between two elements
playwright-cli hover <ref>              # hover over element on page
playwright-cli select <ref> <val>       # select an option in a dropdown
playwright-cli upload <file>            # upload one or multiple files
playwright-cli check <ref>              # check a checkbox or radio button
playwright-cli uncheck <ref>            # uncheck a checkbox or radio button
playwright-cli snapshot                 # capture page snapshot to obtain element ref
playwright-cli eval <func> [ref]        # evaluate javascript expression on page or element
playwright-cli dialog-accept [prompt]   # accept a dialog
playwright-cli dialog-dismiss           # dismiss a dialog
playwright-cli resize <w> <h>           # resize the browser window

Navigation

playwright-cli go-back                  # go back to the previous page
playwright-cli go-forward               # go forward to the next page
playwright-cli reload                   # reload the current page

Keyboard

playwright-cli press <key>              # press a key on the keyboard, `a`, `arrowleft`
playwright-cli keydown <key>            # press a key down on the keyboard
playwright-cli keyup <key>              # press a key up on the keyboard

Mouse

playwright-cli mousemove <x> <y>        # move mouse to a given position
playwright-cli mousedown [button]       # press mouse down
playwright-cli mouseup [button]         # press mouse up
playwright-cli mousewheel <dx> <dy>     # scroll mouse wheel

Save as

playwright-cli screenshot [ref]         # screenshot of the current page or element
playwright-cli pdf                      # save page as pdf

Tabs

playwright-cli tab-list                 # list all tabs
playwright-cli tab-new [url]            # create a new tab
playwright-cli tab-close [index]        # close a browser tab
playwright-cli tab-select <index>       # select a browser tab

DevTools

playwright-cli console [min-level]      # list console messages
playwright-cli network                  # list all network requests since loading the page
playwright-cli run-code <code>          # run playwright code snippet
playwright-cli tracing-start            # start trace recording
playwright-cli tracing-stop             # stop trace recording

v0.0.58

24 Jan 01:19
7911136

Choose a tag to compare

📣 Playwright CLI

We are adding a new token-efficient CLI mode of operation to Playwright with the skills located at playwright-cli. This brings the long-awaited official SKILL-focused CLI mode to our story and makes it more coding agent-friendly.

It is the first snapshot with the essential command set (which is already larger than the original MCP!), but we expect it to grow rapidly. Unlike the token use, that one we expect to go down since snapshots are no longer forced into the LLM!

Installation

npm install -g @playwright/mcp@latest
playwright-cli --help

Demo

Your agent will be running those, but it does not mean you can't play with it:

playwright-cli open https://demo.playwright.dev/todomvc/ --headed
playwright-cli type "Buy groceries"
playwright-cli press Enter
playwright-cli type "Water flowers"
playwright-cli press Enter
playwright-cli check e21
playwright-cli check e35
playwright-cli press screenshot

Skills-less operation

Point your agent at the CLI and let it cook. It'll read the skill off playwright-cli --help on its own:

Test the "add todo" flow on https://demo.playwright.dev/todomvc using playwright-cli.
Check playwright-cli --help for available commands.

Installing skills

Claude Code, GitHub copilot and others will let you install the Playwright skills into the agentic loop.

plugin (recommended)

/plugin marketplace add microsoft/playwright-cli
/plugin install playwright-cli

manual

mkdir -p .claude/skills/playwright-cli
curl -o .claude/skills/playwright-cli/SKILL.md \
  https://raw.githubusercontent.com/microsoft/playwright-cli/main/skills/playwright-cli/SKILL.md

Headed operation

Playwright CLI is headless by default. If you'd like to see the browser, pass --headed to open:

playwright-cli open https://playwright.dev --headed

Sessions

Playwright CLI will use a dedicated persistent profile by default. It means that
your cookies and other storage state will be preserved between the calls. You can use different
instances of the browser for different projects with sessions.

Following will result in two browsers with separate profiles being available. Pass --session to
the invocation to talk to a specific browser.

playwright-cli open https://playwright.dev
playwright-cli --session=example open https://example.com
playwright-cli session-list

You can run your coding agent with the PLAYWRIGHT_CLI_SESSION environment variable:

PLAYWRIGHT_CLI_SESSION=todo-app claude .

Or instruct it to prepend --session to the calls.

Manage your sessions as follows:

playwright-cli session-list             # list all sessions
playwright-cli session-stop [name]      # stop session
playwright-cli session-stop-all         # stop all sessions
playwright-cli session-delete [name]    # delete session data along with the profiles

Commands

Core

playwright-cli open <url>               # open url
playwright-cli close                    # close the page
playwright-cli type <text>              # type text into editable element
playwright-cli click <ref> [button]     # perform click on a web page
playwright-cli dblclick <ref> [button]  # perform double click on a web page
playwright-cli fill <ref> <text>        # fill text into editable element
playwright-cli drag <startRef> <endRef> # perform drag and drop between two elements
playwright-cli hover <ref>              # hover over element on page
playwright-cli select <ref> <val>       # select an option in a dropdown
playwright-cli upload <file>            # upload one or multiple files
playwright-cli check <ref>              # check a checkbox or radio button
playwright-cli uncheck <ref>            # uncheck a checkbox or radio button
playwright-cli snapshot                 # capture page snapshot to obtain element ref
playwright-cli eval <func> [ref]        # evaluate javascript expression on page or element
playwright-cli dialog-accept [prompt]   # accept a dialog
playwright-cli dialog-dismiss           # dismiss a dialog
playwright-cli resize <w> <h>           # resize the browser window

Navigation

playwright-cli go-back                  # go back to the previous page
playwright-cli go-forward               # go forward to the next page
playwright-cli reload                   # reload the current page

Keyboard

playwright-cli press <key>              # press a key on the keyboard, `a`, `arrowleft`
playwright-cli keydown <key>            # press a key down on the keyboard
playwright-cli keyup <key>              # press a key up on the keyboard

Mouse

playwright-cli mousemove <x> <y>        # move mouse to a given position
playwright-cli mousedown [button]       # press mouse down
playwright-cli mouseup [button]         # press mouse up
playwright-cli mousewheel <dx> <dy>     # scroll mouse wheel

Save as

playwright-cli screenshot [ref]         # screenshot of the current page or element
playwright-cli pdf                      # save page as pdf

Tabs

playwright-cli tab-list                 # list all tabs
playwright-cli tab-new [url]            # create a new tab
playwright-cli tab-close [index]        # close a browser tab
playwright-cli tab-select <index>       # select a browser tab

DevTools

playwright-cli console [min-level]      # list console messages
playwright-cli network                  # list all network requests since loading the page
playwright-cli run-code <code>          # run playwright code snippet
playwright-cli tracing-start            # start trace recording
playwright-cli tracing-stop             # stop trace recording

v0.0.57

24 Jan 00:10
956b79a

Choose a tag to compare

Prep for v0.0.58