@playwright/mcp 0.0.58 → 0.0.59-alpha-2026-01-26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -122
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
A Model Context Protocol (MCP) server that provides browser automation capabilities using [Playwright](https://playwright.dev). This server enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models.
|
|
4
4
|
|
|
5
|
+
### Playwright MCP vs Playwright CLI
|
|
6
|
+
|
|
7
|
+
This package provides MCP interface into Playwright. If you are using a **coding agent**, you might benefit from using the [CLI+SKILLS](https://github.com/microsoft/playwright-cli) instead.
|
|
8
|
+
|
|
9
|
+
- **CLI**: Modern **coding agents** increasingly favor CLI–based workflows exposed as SKILLs over MCP because CLI invocations are more token-efficient: they avoid loading large tool schemas and verbose accessibility trees into the model context, allowing agents to act through concise, purpose-built commands. This makes CLI + SKILLs better suited for high-throughput coding agents that must balance browser automation with large codebases, tests, and reasoning within limited context windows.<br>**Learn more about [Playwright CLI with SKILLS](https://github.com/microsoft/playwright-cli)**.
|
|
10
|
+
|
|
11
|
+
- **MCP**: MCP remains relevant for specialized agentic loops that benefit from persistent state, rich introspection, and iterative reasoning over page structure, such as exploratory automation, self-healing tests, or long-running autonomous workflows where maintaining continuous browser context outweighs token cost concerns.
|
|
12
|
+
|
|
5
13
|
### Key Features
|
|
6
14
|
|
|
7
15
|
- **Fast and lightweight**. Uses Playwright's accessibility tree, not pixel-based input.
|
|
@@ -324,127 +332,50 @@ Playwright MCP server supports following arguments. They can be provided in the
|
|
|
324
332
|
|
|
325
333
|
<!--- Options generated by update-readme.js -->
|
|
326
334
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
--console-level <level> level of console messages to return:
|
|
372
|
-
"error", "warning", "info", "debug".
|
|
373
|
-
Each level includes the messages of more
|
|
374
|
-
severe levels.
|
|
375
|
-
--device <device> device to emulate, for example: "iPhone
|
|
376
|
-
15"
|
|
377
|
-
--executable-path <path> path to the browser executable.
|
|
378
|
-
--extension Connect to a running browser instance
|
|
379
|
-
(Edge/Chrome only). Requires the
|
|
380
|
-
"Playwright MCP Bridge" browser
|
|
381
|
-
extension to be installed.
|
|
382
|
-
--grant-permissions <permissions...> List of permissions to grant to the
|
|
383
|
-
browser context, for example
|
|
384
|
-
"geolocation", "clipboard-read",
|
|
385
|
-
"clipboard-write".
|
|
386
|
-
--headless run browser in headless mode, headed by
|
|
387
|
-
default
|
|
388
|
-
--host <host> host to bind server to. Default is
|
|
389
|
-
localhost. Use 0.0.0.0 to bind to all
|
|
390
|
-
interfaces.
|
|
391
|
-
--ignore-https-errors ignore https errors
|
|
392
|
-
--init-page <path...> path to TypeScript file to evaluate on
|
|
393
|
-
Playwright page object
|
|
394
|
-
--init-script <path...> path to JavaScript file to add as an
|
|
395
|
-
initialization script. The script will
|
|
396
|
-
be evaluated in every page before any of
|
|
397
|
-
the page's scripts. Can be specified
|
|
398
|
-
multiple times.
|
|
399
|
-
--isolated keep the browser profile in memory, do
|
|
400
|
-
not save it to disk.
|
|
401
|
-
--image-responses <mode> whether to send image responses to the
|
|
402
|
-
client. Can be "allow" or "omit",
|
|
403
|
-
Defaults to "allow".
|
|
404
|
-
--no-sandbox disable the sandbox for all process
|
|
405
|
-
types that are normally sandboxed.
|
|
406
|
-
--output-dir <path> path to the directory for output files.
|
|
407
|
-
--output-mode <mode> whether to save snapshots, console
|
|
408
|
-
messages, network logs to a file or to
|
|
409
|
-
the standard output. Can be "file" or
|
|
410
|
-
"stdout". Default is "stdout".
|
|
411
|
-
--port <port> port to listen on for SSE transport.
|
|
412
|
-
--proxy-bypass <bypass> comma-separated domains to bypass proxy,
|
|
413
|
-
for example
|
|
414
|
-
".com,chromium.org,.domain.com"
|
|
415
|
-
--proxy-server <proxy> specify proxy server, for example
|
|
416
|
-
"http://myproxy:3128" or
|
|
417
|
-
"socks5://myproxy:8080"
|
|
418
|
-
--save-session Whether to save the Playwright MCP
|
|
419
|
-
session into the output directory.
|
|
420
|
-
--save-trace Whether to save the Playwright Trace of
|
|
421
|
-
the session into the output directory.
|
|
422
|
-
--save-video <size> Whether to save the video of the session
|
|
423
|
-
into the output directory. For example
|
|
424
|
-
"--save-video=800x600"
|
|
425
|
-
--secrets <path> path to a file containing secrets in the
|
|
426
|
-
dotenv format
|
|
427
|
-
--shared-browser-context reuse the same browser context between
|
|
428
|
-
all connected HTTP clients.
|
|
429
|
-
--snapshot-mode <mode> when taking snapshots for responses,
|
|
430
|
-
specifies the mode to use. Can be
|
|
431
|
-
"incremental", "full", or "none".
|
|
432
|
-
Default is incremental.
|
|
433
|
-
--storage-state <path> path to the storage state file for
|
|
434
|
-
isolated sessions.
|
|
435
|
-
--test-id-attribute <attribute> specify the attribute to use for test
|
|
436
|
-
ids, defaults to "data-testid"
|
|
437
|
-
--timeout-action <timeout> specify action timeout in milliseconds,
|
|
438
|
-
defaults to 5000ms
|
|
439
|
-
--timeout-navigation <timeout> specify navigation timeout in
|
|
440
|
-
milliseconds, defaults to 60000ms
|
|
441
|
-
--user-agent <ua string> specify user agent string
|
|
442
|
-
--user-data-dir <path> path to the user data directory. If not
|
|
443
|
-
specified, a temporary directory will be
|
|
444
|
-
created.
|
|
445
|
-
--viewport-size <size> specify browser viewport size in pixels,
|
|
446
|
-
for example "1280x720"
|
|
447
|
-
```
|
|
335
|
+
| Option | Description |
|
|
336
|
+
|--------|-------------|
|
|
337
|
+
| --allowed-hosts <hosts...> | comma-separated list of hosts this server is allowed to serve from. Defaults to the host the server is bound to. Pass '*' to disable the host check.<br>*env* `PLAYWRIGHT_MCP_ALLOWED_HOSTS` |
|
|
338
|
+
| --allowed-origins <origins> | semicolon-separated list of TRUSTED origins to allow the browser to request. Default is to allow all. Important: *does not* serve as a security boundary and *does not* affect redirects.<br>*env* `PLAYWRIGHT_MCP_ALLOWED_ORIGINS` |
|
|
339
|
+
| --allow-unrestricted-file-access | allow access to files outside of the workspace roots. Also allows unrestricted access to file:// URLs. By default access to file system is restricted to workspace root directories (or cwd if no roots are configured) only, and navigation to file:// URLs is blocked.<br>*env* `PLAYWRIGHT_MCP_ALLOW_UNRESTRICTED_FILE_ACCESS` |
|
|
340
|
+
| --blocked-origins <origins> | semicolon-separated list of origins to block the browser from requesting. Blocklist is evaluated before allowlist. If used without the allowlist, requests not matching the blocklist are still allowed. Important: *does not* serve as a security boundary and *does not* affect redirects.<br>*env* `PLAYWRIGHT_MCP_BLOCKED_ORIGINS` |
|
|
341
|
+
| --block-service-workers | block service workers<br>*env* `PLAYWRIGHT_MCP_BLOCK_SERVICE_WORKERS` |
|
|
342
|
+
| --browser <browser> | browser or chrome channel to use, possible values: chrome, firefox, webkit, msedge.<br>*env* `PLAYWRIGHT_MCP_BROWSER` |
|
|
343
|
+
| --caps <caps> | comma-separated list of additional capabilities to enable, possible values: vision, pdf.<br>*env* `PLAYWRIGHT_MCP_CAPS` |
|
|
344
|
+
| --cdp-endpoint <endpoint> | CDP endpoint to connect to.<br>*env* `PLAYWRIGHT_MCP_CDP_ENDPOINT` |
|
|
345
|
+
| --cdp-header <headers...> | CDP headers to send with the connect request, multiple can be specified.<br>*env* `PLAYWRIGHT_MCP_CDP_HEADER` |
|
|
346
|
+
| --codegen <lang> | specify the language to use for code generation, possible values: "typescript", "none". Default is "typescript".<br>*env* `PLAYWRIGHT_MCP_CODEGEN` |
|
|
347
|
+
| --config <path> | path to the configuration file.<br>*env* `PLAYWRIGHT_MCP_CONFIG` |
|
|
348
|
+
| --console-level <level> | level of console messages to return: "error", "warning", "info", "debug". Each level includes the messages of more severe levels.<br>*env* `PLAYWRIGHT_MCP_CONSOLE_LEVEL` |
|
|
349
|
+
| --device <device> | device to emulate, for example: "iPhone 15"<br>*env* `PLAYWRIGHT_MCP_DEVICE` |
|
|
350
|
+
| --executable-path <path> | path to the browser executable.<br>*env* `PLAYWRIGHT_MCP_EXECUTABLE_PATH` |
|
|
351
|
+
| --extension | Connect to a running browser instance (Edge/Chrome only). Requires the "Playwright MCP Bridge" browser extension to be installed.<br>*env* `PLAYWRIGHT_MCP_EXTENSION` |
|
|
352
|
+
| --grant-permissions <permissions...> | List of permissions to grant to the browser context, for example "geolocation", "clipboard-read", "clipboard-write".<br>*env* `PLAYWRIGHT_MCP_GRANT_PERMISSIONS` |
|
|
353
|
+
| --headless | run browser in headless mode, headed by default<br>*env* `PLAYWRIGHT_MCP_HEADLESS` |
|
|
354
|
+
| --host <host> | host to bind server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.<br>*env* `PLAYWRIGHT_MCP_HOST` |
|
|
355
|
+
| --ignore-https-errors | ignore https errors<br>*env* `PLAYWRIGHT_MCP_IGNORE_HTTPS_ERRORS` |
|
|
356
|
+
| --init-page <path...> | path to TypeScript file to evaluate on Playwright page object<br>*env* `PLAYWRIGHT_MCP_INIT_PAGE` |
|
|
357
|
+
| --init-script <path...> | path to JavaScript file to add as an initialization script. The script will be evaluated in every page before any of the page's scripts. Can be specified multiple times.<br>*env* `PLAYWRIGHT_MCP_INIT_SCRIPT` |
|
|
358
|
+
| --isolated | keep the browser profile in memory, do not save it to disk.<br>*env* `PLAYWRIGHT_MCP_ISOLATED` |
|
|
359
|
+
| --image-responses <mode> | whether to send image responses to the client. Can be "allow" or "omit", Defaults to "allow".<br>*env* `PLAYWRIGHT_MCP_IMAGE_RESPONSES` |
|
|
360
|
+
| --no-sandbox | disable the sandbox for all process types that are normally sandboxed.<br>*env* `PLAYWRIGHT_MCP_NO_SANDBOX` |
|
|
361
|
+
| --output-dir <path> | path to the directory for output files.<br>*env* `PLAYWRIGHT_MCP_OUTPUT_DIR` |
|
|
362
|
+
| --output-mode <mode> | whether to save snapshots, console messages, network logs to a file or to the standard output. Can be "file" or "stdout". Default is "stdout".<br>*env* `PLAYWRIGHT_MCP_OUTPUT_MODE` |
|
|
363
|
+
| --port <port> | port to listen on for SSE transport.<br>*env* `PLAYWRIGHT_MCP_PORT` |
|
|
364
|
+
| --proxy-bypass <bypass> | comma-separated domains to bypass proxy, for example ".com,chromium.org,.domain.com"<br>*env* `PLAYWRIGHT_MCP_PROXY_BYPASS` |
|
|
365
|
+
| --proxy-server <proxy> | specify proxy server, for example "http://myproxy:3128" or "socks5://myproxy:8080"<br>*env* `PLAYWRIGHT_MCP_PROXY_SERVER` |
|
|
366
|
+
| --save-session | Whether to save the Playwright MCP session into the output directory.<br>*env* `PLAYWRIGHT_MCP_SAVE_SESSION` |
|
|
367
|
+
| --save-trace | Whether to save the Playwright Trace of the session into the output directory.<br>*env* `PLAYWRIGHT_MCP_SAVE_TRACE` |
|
|
368
|
+
| --save-video <size> | Whether to save the video of the session into the output directory. For example "--save-video=800x600"<br>*env* `PLAYWRIGHT_MCP_SAVE_VIDEO` |
|
|
369
|
+
| --secrets <path> | path to a file containing secrets in the dotenv format<br>*env* `PLAYWRIGHT_MCP_SECRETS` |
|
|
370
|
+
| --shared-browser-context | reuse the same browser context between all connected HTTP clients.<br>*env* `PLAYWRIGHT_MCP_SHARED_BROWSER_CONTEXT` |
|
|
371
|
+
| --snapshot-mode <mode> | when taking snapshots for responses, specifies the mode to use. Can be "incremental", "full", or "none". Default is incremental.<br>*env* `PLAYWRIGHT_MCP_SNAPSHOT_MODE` |
|
|
372
|
+
| --storage-state <path> | path to the storage state file for isolated sessions.<br>*env* `PLAYWRIGHT_MCP_STORAGE_STATE` |
|
|
373
|
+
| --test-id-attribute <attribute> | specify the attribute to use for test ids, defaults to "data-testid"<br>*env* `PLAYWRIGHT_MCP_TEST_ID_ATTRIBUTE` |
|
|
374
|
+
| --timeout-action <timeout> | specify action timeout in milliseconds, defaults to 5000ms<br>*env* `PLAYWRIGHT_MCP_TIMEOUT_ACTION` |
|
|
375
|
+
| --timeout-navigation <timeout> | specify navigation timeout in milliseconds, defaults to 60000ms<br>*env* `PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION` |
|
|
376
|
+
| --user-agent <ua string> | specify user agent string<br>*env* `PLAYWRIGHT_MCP_USER_AGENT` |
|
|
377
|
+
| --user-data-dir <path> | path to the user data directory. If not specified, a temporary directory will be created.<br>*env* `PLAYWRIGHT_MCP_USER_DATA_DIR` |
|
|
378
|
+
| --viewport-size <size> | specify browser viewport size in pixels, for example "1280x720"<br>*env* `PLAYWRIGHT_MCP_VIEWPORT_SIZE` |
|
|
448
379
|
|
|
449
380
|
<!--- End of options generated section -->
|
|
450
381
|
|
|
@@ -492,7 +423,7 @@ state [here](https://playwright.dev/docs/auth).
|
|
|
492
423
|
|
|
493
424
|
**Browser Extension**
|
|
494
425
|
|
|
495
|
-
The Playwright MCP Chrome Extension allows you to connect to existing browser tabs and leverage your logged-in sessions and browser state. See [extension/README.md](extension/README.md) for installation and setup instructions.
|
|
426
|
+
The Playwright MCP Chrome Extension allows you to connect to existing browser tabs and leverage your logged-in sessions and browser state. See [packages/extension/README.md](packages/extension/README.md) for installation and setup instructions.
|
|
496
427
|
|
|
497
428
|
### Initial state
|
|
498
429
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playwright/mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.59-alpha-2026-01-26",
|
|
4
4
|
"description": "Playwright Tools for MCP",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"minimist": "^1.2.5",
|
|
38
|
-
"playwright": "1.59.0-alpha-
|
|
39
|
-
"playwright-core": "1.59.0-alpha-
|
|
38
|
+
"playwright": "1.59.0-alpha-1769364499000",
|
|
39
|
+
"playwright-core": "1.59.0-alpha-1769364499000"
|
|
40
40
|
},
|
|
41
41
|
"bin": {
|
|
42
42
|
"mcp": "cli.js",
|