mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2026-01-30 06:22:03 +00:00
Compare commits
4 Commits
79111366a9
...
f531b2c9cb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f531b2c9cb | ||
|
|
4b62f68979 | ||
|
|
5b497bcca8 | ||
|
|
00b9c54515 |
167
README.md
167
README.md
@@ -324,127 +324,50 @@ Playwright MCP server supports following arguments. They can be provided in the
|
|||||||
|
|
||||||
<!--- Options generated by update-readme.js -->
|
<!--- Options generated by update-readme.js -->
|
||||||
|
|
||||||
```
|
| Option | Description |
|
||||||
> npx @playwright/mcp@latest --help
|
|--------|-------------|
|
||||||
--allowed-hosts <hosts...> comma-separated list of hosts this
|
| --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` |
|
||||||
server is allowed to serve from.
|
| --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` |
|
||||||
Defaults to the host the server is bound
|
| --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` |
|
||||||
to. Pass '*' to disable the host check.
|
| --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` |
|
||||||
--allowed-origins <origins> semicolon-separated list of TRUSTED
|
| --block-service-workers | block service workers<br>*env* `PLAYWRIGHT_MCP_BLOCK_SERVICE_WORKERS` |
|
||||||
origins to allow the browser to request.
|
| --browser <browser> | browser or chrome channel to use, possible values: chrome, firefox, webkit, msedge.<br>*env* `PLAYWRIGHT_MCP_BROWSER` |
|
||||||
Default is to allow all.
|
| --caps <caps> | comma-separated list of additional capabilities to enable, possible values: vision, pdf.<br>*env* `PLAYWRIGHT_MCP_CAPS` |
|
||||||
Important: *does not* serve as a
|
| --cdp-endpoint <endpoint> | CDP endpoint to connect to.<br>*env* `PLAYWRIGHT_MCP_CDP_ENDPOINT` |
|
||||||
security boundary and *does not* affect
|
| --cdp-header <headers...> | CDP headers to send with the connect request, multiple can be specified.<br>*env* `PLAYWRIGHT_MCP_CDP_HEADER` |
|
||||||
redirects.
|
| --codegen <lang> | specify the language to use for code generation, possible values: "typescript", "none". Default is "typescript".<br>*env* `PLAYWRIGHT_MCP_CODEGEN` |
|
||||||
--allow-unrestricted-file-access allow access to files outside of the
|
| --config <path> | path to the configuration file.<br>*env* `PLAYWRIGHT_MCP_CONFIG` |
|
||||||
workspace roots. Also allows
|
| --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` |
|
||||||
unrestricted access to file:// URLs. By
|
| --device <device> | device to emulate, for example: "iPhone 15"<br>*env* `PLAYWRIGHT_MCP_DEVICE` |
|
||||||
default access to file system is
|
| --executable-path <path> | path to the browser executable.<br>*env* `PLAYWRIGHT_MCP_EXECUTABLE_PATH` |
|
||||||
restricted to workspace root directories
|
| --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` |
|
||||||
(or cwd if no roots are configured)
|
| --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` |
|
||||||
only, and navigation to file:// URLs is
|
| --headless | run browser in headless mode, headed by default<br>*env* `PLAYWRIGHT_MCP_HEADLESS` |
|
||||||
blocked.
|
| --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` |
|
||||||
--blocked-origins <origins> semicolon-separated list of origins to
|
| --ignore-https-errors | ignore https errors<br>*env* `PLAYWRIGHT_MCP_IGNORE_HTTPS_ERRORS` |
|
||||||
block the browser from requesting.
|
| --init-page <path...> | path to TypeScript file to evaluate on Playwright page object<br>*env* `PLAYWRIGHT_MCP_INIT_PAGE` |
|
||||||
Blocklist is evaluated before allowlist.
|
| --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` |
|
||||||
If used without the allowlist, requests
|
| --isolated | keep the browser profile in memory, do not save it to disk.<br>*env* `PLAYWRIGHT_MCP_ISOLATED` |
|
||||||
not matching the blocklist are still
|
| --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` |
|
||||||
allowed.
|
| --no-sandbox | disable the sandbox for all process types that are normally sandboxed.<br>*env* `PLAYWRIGHT_MCP_NO_SANDBOX` |
|
||||||
Important: *does not* serve as a
|
| --output-dir <path> | path to the directory for output files.<br>*env* `PLAYWRIGHT_MCP_OUTPUT_DIR` |
|
||||||
security boundary and *does not* affect
|
| --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` |
|
||||||
redirects.
|
| --port <port> | port to listen on for SSE transport.<br>*env* `PLAYWRIGHT_MCP_PORT` |
|
||||||
--block-service-workers block service workers
|
| --proxy-bypass <bypass> | comma-separated domains to bypass proxy, for example ".com,chromium.org,.domain.com"<br>*env* `PLAYWRIGHT_MCP_PROXY_BYPASS` |
|
||||||
--browser <browser> browser or chrome channel to use,
|
| --proxy-server <proxy> | specify proxy server, for example "http://myproxy:3128" or "socks5://myproxy:8080"<br>*env* `PLAYWRIGHT_MCP_PROXY_SERVER` |
|
||||||
possible values: chrome, firefox,
|
| --save-session | Whether to save the Playwright MCP session into the output directory.<br>*env* `PLAYWRIGHT_MCP_SAVE_SESSION` |
|
||||||
webkit, msedge.
|
| --save-trace | Whether to save the Playwright Trace of the session into the output directory.<br>*env* `PLAYWRIGHT_MCP_SAVE_TRACE` |
|
||||||
--caps <caps> comma-separated list of additional
|
| --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` |
|
||||||
capabilities to enable, possible values:
|
| --secrets <path> | path to a file containing secrets in the dotenv format<br>*env* `PLAYWRIGHT_MCP_SECRETS` |
|
||||||
vision, pdf.
|
| --shared-browser-context | reuse the same browser context between all connected HTTP clients.<br>*env* `PLAYWRIGHT_MCP_SHARED_BROWSER_CONTEXT` |
|
||||||
--cdp-endpoint <endpoint> CDP endpoint to connect to.
|
| --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` |
|
||||||
--cdp-header <headers...> CDP headers to send with the connect
|
| --storage-state <path> | path to the storage state file for isolated sessions.<br>*env* `PLAYWRIGHT_MCP_STORAGE_STATE` |
|
||||||
request, multiple can be specified.
|
| --test-id-attribute <attribute> | specify the attribute to use for test ids, defaults to "data-testid"<br>*env* `PLAYWRIGHT_MCP_TEST_ID_ATTRIBUTE` |
|
||||||
--codegen <lang> specify the language to use for code
|
| --timeout-action <timeout> | specify action timeout in milliseconds, defaults to 5000ms<br>*env* `PLAYWRIGHT_MCP_TIMEOUT_ACTION` |
|
||||||
generation, possible values:
|
| --timeout-navigation <timeout> | specify navigation timeout in milliseconds, defaults to 60000ms<br>*env* `PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION` |
|
||||||
"typescript", "none". Default is
|
| --user-agent <ua string> | specify user agent string<br>*env* `PLAYWRIGHT_MCP_USER_AGENT` |
|
||||||
"typescript".
|
| --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` |
|
||||||
--config <path> path to the configuration file.
|
| --viewport-size <size> | specify browser viewport size in pixels, for example "1280x720"<br>*env* `PLAYWRIGHT_MCP_VIEWPORT_SIZE` |
|
||||||
--console-level <level> level of console messages to return:
|
|
||||||
"error", "warning", "info", "debug".
|
|
||||||
Each level includes the messages of more
|
|
||||||
severe levels.
|
|
||||||
--device <device> device to emulate, for example: "iPhone
|
|
||||||
15"
|
|
||||||
--executable-path <path> path to the browser executable.
|
|
||||||
--extension Connect to a running browser instance
|
|
||||||
(Edge/Chrome only). Requires the
|
|
||||||
"Playwright MCP Bridge" browser
|
|
||||||
extension to be installed.
|
|
||||||
--grant-permissions <permissions...> List of permissions to grant to the
|
|
||||||
browser context, for example
|
|
||||||
"geolocation", "clipboard-read",
|
|
||||||
"clipboard-write".
|
|
||||||
--headless run browser in headless mode, headed by
|
|
||||||
default
|
|
||||||
--host <host> host to bind server to. Default is
|
|
||||||
localhost. Use 0.0.0.0 to bind to all
|
|
||||||
interfaces.
|
|
||||||
--ignore-https-errors ignore https errors
|
|
||||||
--init-page <path...> path to TypeScript file to evaluate on
|
|
||||||
Playwright page object
|
|
||||||
--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.
|
|
||||||
--isolated keep the browser profile in memory, do
|
|
||||||
not save it to disk.
|
|
||||||
--image-responses <mode> whether to send image responses to the
|
|
||||||
client. Can be "allow" or "omit",
|
|
||||||
Defaults to "allow".
|
|
||||||
--no-sandbox disable the sandbox for all process
|
|
||||||
types that are normally sandboxed.
|
|
||||||
--output-dir <path> path to the directory for output files.
|
|
||||||
--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".
|
|
||||||
--port <port> port to listen on for SSE transport.
|
|
||||||
--proxy-bypass <bypass> comma-separated domains to bypass proxy,
|
|
||||||
for example
|
|
||||||
".com,chromium.org,.domain.com"
|
|
||||||
--proxy-server <proxy> specify proxy server, for example
|
|
||||||
"http://myproxy:3128" or
|
|
||||||
"socks5://myproxy:8080"
|
|
||||||
--save-session Whether to save the Playwright MCP
|
|
||||||
session into the output directory.
|
|
||||||
--save-trace Whether to save the Playwright Trace of
|
|
||||||
the session into the output directory.
|
|
||||||
--save-video <size> Whether to save the video of the session
|
|
||||||
into the output directory. For example
|
|
||||||
"--save-video=800x600"
|
|
||||||
--secrets <path> path to a file containing secrets in the
|
|
||||||
dotenv format
|
|
||||||
--shared-browser-context reuse the same browser context between
|
|
||||||
all connected HTTP clients.
|
|
||||||
--snapshot-mode <mode> when taking snapshots for responses,
|
|
||||||
specifies the mode to use. Can be
|
|
||||||
"incremental", "full", or "none".
|
|
||||||
Default is incremental.
|
|
||||||
--storage-state <path> path to the storage state file for
|
|
||||||
isolated sessions.
|
|
||||||
--test-id-attribute <attribute> specify the attribute to use for test
|
|
||||||
ids, defaults to "data-testid"
|
|
||||||
--timeout-action <timeout> specify action timeout in milliseconds,
|
|
||||||
defaults to 5000ms
|
|
||||||
--timeout-navigation <timeout> specify navigation timeout in
|
|
||||||
milliseconds, defaults to 60000ms
|
|
||||||
--user-agent <ua string> specify user agent string
|
|
||||||
--user-data-dir <path> path to the user data directory. If not
|
|
||||||
specified, a temporary directory will be
|
|
||||||
created.
|
|
||||||
--viewport-size <size> specify browser viewport size in pixels,
|
|
||||||
for example "1280x720"
|
|
||||||
```
|
|
||||||
|
|
||||||
<!--- End of options generated section -->
|
<!--- End of options generated section -->
|
||||||
|
|
||||||
@@ -492,7 +415,7 @@ state [here](https://playwright.dev/docs/auth).
|
|||||||
|
|
||||||
**Browser Extension**
|
**Browser Extension**
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
### Initial state
|
### Initial state
|
||||||
|
|
||||||
|
|||||||
36
package-lock.json
generated
36
package-lock.json
generated
@@ -1,19 +1,19 @@
|
|||||||
{
|
{
|
||||||
"name": "playwright-mcp-internal",
|
"name": "playwright-mcp-internal",
|
||||||
"version": "0.0.58",
|
"version": "0.0.59",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playwright-mcp-internal",
|
"name": "playwright-mcp-internal",
|
||||||
"version": "0.0.58",
|
"version": "0.0.59",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.25.2",
|
"@modelcontextprotocol/sdk": "^1.25.2",
|
||||||
"@playwright/test": "1.59.0-alpha-1769217009000",
|
"@playwright/test": "1.59.0-alpha-1769364499000",
|
||||||
"@types/node": "^24.3.0"
|
"@types/node": "^24.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -411,13 +411,13 @@
|
|||||||
"link": true
|
"link": true
|
||||||
},
|
},
|
||||||
"node_modules/@playwright/test": {
|
"node_modules/@playwright/test": {
|
||||||
"version": "1.59.0-alpha-1769217009000",
|
"version": "1.59.0-alpha-1769364499000",
|
||||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.59.0-alpha-1769217009000.tgz",
|
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.59.0-alpha-1769364499000.tgz",
|
||||||
"integrity": "sha512-6w4Cc5mBxPYPTWR7u7ZKUbpysycKwlLOuKKkzaVpeUGBYi5UVUWFwA0kiHH0sLLfpLoasY9KLUG2uiqNfmi8Aw==",
|
"integrity": "sha512-ZJdUgf2B76ph/EML8o4vKmrEIKHHz4Gziqdko7Wfvi69DW3QBXYEs4q3OfwjzK087OQgg961NJeLNV5JMDjZIQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"playwright": "1.59.0-alpha-1769217009000"
|
"playwright": "1.59.0-alpha-1769364499000"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"playwright": "cli.js"
|
"playwright": "cli.js"
|
||||||
@@ -2120,12 +2120,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/playwright": {
|
"node_modules/playwright": {
|
||||||
"version": "1.59.0-alpha-1769217009000",
|
"version": "1.59.0-alpha-1769364499000",
|
||||||
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.59.0-alpha-1769217009000.tgz",
|
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.59.0-alpha-1769364499000.tgz",
|
||||||
"integrity": "sha512-A3TJU5XFNGH7urDr7o170352oCVmlLeo5kJSNeLGtzxcejgIdpBWA2WGP01Fw2WhRk1OrXroAEWD7iA8cMrahg==",
|
"integrity": "sha512-b2VEOW/15RnMinGu2Pya3IZIqvhvXv0umx8e+CSpmPeDgA5++MZUNP3glxD+KmeRXY7d8xCktL12P4DTr0PgHA==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"playwright-core": "1.59.0-alpha-1769217009000"
|
"playwright-core": "1.59.0-alpha-1769364499000"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"playwright": "cli.js"
|
"playwright": "cli.js"
|
||||||
@@ -2138,9 +2138,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/playwright-core": {
|
"node_modules/playwright-core": {
|
||||||
"version": "1.59.0-alpha-1769217009000",
|
"version": "1.59.0-alpha-1769364499000",
|
||||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.59.0-alpha-1769217009000.tgz",
|
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.59.0-alpha-1769364499000.tgz",
|
||||||
"integrity": "sha512-SgO5N9ekEmHnLZh8aTgYt8oA0kaX5aoTbWopLdgJRYYoFPYudcT2a+7yYaVV/hykfVRUXWf+e2lOmr+wl9m8eg==",
|
"integrity": "sha512-rztGMf7lfwzVReQrmSXxYhGB3Lnn0b7+YS0O2eR1xnu/KGIJmzy+0ikWO94DbTmG5NtyQNDWhgXbW72VWhc1vg==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"bin": {
|
"bin": {
|
||||||
"playwright-core": "cli.js"
|
"playwright-core": "cli.js"
|
||||||
@@ -3320,7 +3320,7 @@
|
|||||||
},
|
},
|
||||||
"packages/extension": {
|
"packages/extension": {
|
||||||
"name": "@playwright/mcp-extension",
|
"name": "@playwright/mcp-extension",
|
||||||
"version": "0.0.58",
|
"version": "0.0.59",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/chrome": "^0.0.315",
|
"@types/chrome": "^0.0.315",
|
||||||
@@ -3356,12 +3356,12 @@
|
|||||||
},
|
},
|
||||||
"packages/playwright-mcp": {
|
"packages/playwright-mcp": {
|
||||||
"name": "@playwright/mcp",
|
"name": "@playwright/mcp",
|
||||||
"version": "0.0.58",
|
"version": "0.0.59",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": "^1.2.5",
|
"minimist": "^1.2.5",
|
||||||
"playwright": "1.59.0-alpha-1769217009000",
|
"playwright": "1.59.0-alpha-1769364499000",
|
||||||
"playwright-core": "1.59.0-alpha-1769217009000"
|
"playwright-core": "1.59.0-alpha-1769364499000"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"mcp": "cli.js",
|
"mcp": "cli.js",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playwright-mcp-internal",
|
"name": "playwright-mcp-internal",
|
||||||
"version": "0.0.58",
|
"version": "0.0.59",
|
||||||
"private": true,
|
"private": true,
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.25.2",
|
"@modelcontextprotocol/sdk": "^1.25.2",
|
||||||
"@playwright/test": "1.59.0-alpha-1769217009000",
|
"@playwright/test": "1.59.0-alpha-1769364499000",
|
||||||
"@types/node": "^24.3.0"
|
"@types/node": "^24.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "Playwright MCP Bridge",
|
"name": "Playwright MCP Bridge",
|
||||||
"version": "0.0.58",
|
"version": "0.0.59",
|
||||||
"description": "Share browser tabs with Playwright MCP server",
|
"description": "Share browser tabs with Playwright MCP server",
|
||||||
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9nMS2b0WCohjVHPGb8D9qAdkbIngDqoAjTeSccHJijgcONejge+OJxOQOMLu7b0ovt1c9BiEJa5JcpM+EHFVGL1vluBxK71zmBy1m2f9vZF3HG0LSCp7YRkum9rAIEthDwbkxx6XTvpmAY5rjFa/NON6b9Hlbo+8peUSkoOK7HTwYnnI36asZ9eUTiveIf+DMPLojW2UX33vDWG2UKvMVDewzclb4+uLxAYshY7Mx8we/b44xu+Anb/EBLKjOPk9Yh541xJ5Ozc8EiP/5yxOp9c/lRiYUHaRW+4r0HKZyFt0eZ52ti2iM4Nfk7jRXR7an3JPsUIf5deC/1cVM/+1ZQIDAQAB",
|
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9nMS2b0WCohjVHPGb8D9qAdkbIngDqoAjTeSccHJijgcONejge+OJxOQOMLu7b0ovt1c9BiEJa5JcpM+EHFVGL1vluBxK71zmBy1m2f9vZF3HG0LSCp7YRkum9rAIEthDwbkxx6XTvpmAY5rjFa/NON6b9Hlbo+8peUSkoOK7HTwYnnI36asZ9eUTiveIf+DMPLojW2UX33vDWG2UKvMVDewzclb4+uLxAYshY7Mx8we/b44xu+Anb/EBLKjOPk9Yh541xJ5Ozc8EiP/5yxOp9c/lRiYUHaRW+4r0HKZyFt0eZ52ti2iM4Nfk7jRXR7an3JPsUIf5deC/1cVM/+1ZQIDAQAB",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@playwright/mcp-extension",
|
"name": "@playwright/mcp-extension",
|
||||||
"version": "0.0.58",
|
"version": "0.0.59",
|
||||||
"description": "Playwright MCP Browser Extension",
|
"description": "Playwright MCP Browser Extension",
|
||||||
"private": true,
|
"private": true,
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@playwright/mcp",
|
"name": "@playwright/mcp",
|
||||||
"version": "0.0.58",
|
"version": "0.0.59",
|
||||||
"description": "Playwright Tools for MCP",
|
"description": "Playwright Tools for MCP",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -35,8 +35,8 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": "^1.2.5",
|
"minimist": "^1.2.5",
|
||||||
"playwright": "1.59.0-alpha-1769217009000",
|
"playwright": "1.59.0-alpha-1769364499000",
|
||||||
"playwright-core": "1.59.0-alpha-1769217009000"
|
"playwright-core": "1.59.0-alpha-1769364499000"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"mcp": "cli.js",
|
"mcp": "cli.js",
|
||||||
|
|||||||
@@ -128,20 +128,56 @@ async function updateTools(content) {
|
|||||||
*/
|
*/
|
||||||
async function updateOptions(content) {
|
async function updateOptions(content) {
|
||||||
console.log('Listing options...');
|
console.log('Listing options...');
|
||||||
const output = execSync('node cli.js --help');
|
execSync('node cli.js --help > help.txt');
|
||||||
|
const output = fs.readFileSync('help.txt');
|
||||||
|
fs.unlinkSync('help.txt');
|
||||||
const lines = output.toString().split('\n');
|
const lines = output.toString().split('\n');
|
||||||
const firstLine = lines.findIndex(line => line.includes('--version'));
|
const firstLine = lines.findIndex(line => line.includes('--version'));
|
||||||
lines.splice(0, firstLine + 1);
|
lines.splice(0, firstLine + 1);
|
||||||
const lastLine = lines.findIndex(line => line.includes('--help'));
|
const lastLine = lines.findIndex(line => line.includes('--help'));
|
||||||
lines.splice(lastLine);
|
lines.splice(lastLine);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {{ name: string, value: string }[]}
|
||||||
|
*/
|
||||||
|
const options = [];
|
||||||
|
for (let line of lines) {
|
||||||
|
if (line.startsWith(' --')) {
|
||||||
|
const l = line.substring(' --'.length);
|
||||||
|
const gapIndex = l.indexOf(' ');
|
||||||
|
const name = l.substring(0, gapIndex).trim();
|
||||||
|
const value = l.substring(gapIndex).trim();
|
||||||
|
options.push({ name, value });
|
||||||
|
} else {
|
||||||
|
const value = line.trim();
|
||||||
|
options[options.length - 1].value += ' ' + value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const table = [];
|
||||||
|
table.push(`| Option | Description |`);
|
||||||
|
table.push(`|--------|-------------|`);
|
||||||
|
for (const option of options) {
|
||||||
|
const prefix = option.name.split(' ')[0];
|
||||||
|
const envName = `PLAYWRIGHT_MCP_` + prefix.toUpperCase().replace(/-/g, '_');
|
||||||
|
table.push(`| --${option.name} | ${option.value}<br>*env* \`${envName}\` |`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.env.PRINT_ENV) {
|
||||||
|
const envTable = [];
|
||||||
|
envTable.push(`| Environment |`);
|
||||||
|
envTable.push(`|-------------|`);
|
||||||
|
for (const option of options) {
|
||||||
|
const prefix = option.name.split(' ')[0];
|
||||||
|
const envName = `PLAYWRIGHT_MCP_` + prefix.toUpperCase().replace(/-/g, '_');
|
||||||
|
envTable.push(`| \`${envName}\` ${option.value} |`);
|
||||||
|
}
|
||||||
|
console.log(envTable.join('\n'));
|
||||||
|
}
|
||||||
|
|
||||||
const startMarker = `<!--- Options generated by ${path.basename(__filename)} -->`;
|
const startMarker = `<!--- Options generated by ${path.basename(__filename)} -->`;
|
||||||
const endMarker = `<!--- End of options generated section -->`;
|
const endMarker = `<!--- End of options generated section -->`;
|
||||||
return updateSection(content, startMarker, endMarker, [
|
return updateSection(content, startMarker, endMarker, table);
|
||||||
'```',
|
|
||||||
'> npx @playwright/mcp@latest --help',
|
|
||||||
...lines,
|
|
||||||
'```',
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user