| --allowed-hosts <hosts...> | comma-separated list of hosts this server is allowed to serve from. Defaults to localhost, loopback IPs and the host passed via --host; other hosts must be listed explicitly. Pass '*' to disable the host check. env PLAYWRIGHT_MCP_ALLOWED_HOSTS |
| --allowed-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. env PLAYWRIGHT_MCP_ALLOWED_ORIGINS |
| --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. env PLAYWRIGHT_MCP_ALLOW_UNRESTRICTED_FILE_ACCESS |
| --blocked-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. env PLAYWRIGHT_MCP_BLOCKED_ORIGINS |
| --block-service-workers | block service workers env PLAYWRIGHT_MCP_BLOCK_SERVICE_WORKERS |
| --browser | browser or chrome channel to use, possible values: chrome, firefox, webkit, msedge. env PLAYWRIGHT_MCP_BROWSER |
| --caps | comma-separated list of additional capabilities to enable, possible values: vision, pdf, devtools. env PLAYWRIGHT_MCP_CAPS |
| --cdp-endpoint | CDP endpoint to connect to. env PLAYWRIGHT_MCP_CDP_ENDPOINT |
| --cdp-header <headers...> | CDP headers to send with the connect request, multiple can be specified. env PLAYWRIGHT_MCP_CDP_HEADERS |
| --cdp-timeout | timeout in milliseconds for connecting to CDP endpoint, defaults to 30000ms env PLAYWRIGHT_MCP_CDP_TIMEOUT |
| --codegen | specify the language to use for code generation, possible values: "typescript", "python", "java", "csharp", "none". Default is "typescript". env PLAYWRIGHT_MCP_CODEGEN |
| --config | path to the configuration file. env PLAYWRIGHT_MCP_CONFIG |
| --console-level | level of console messages to return: "error", "warning", "info", "debug". Each level includes the messages of more severe levels. env PLAYWRIGHT_MCP_CONSOLE_LEVEL |
| --device | device to emulate, for example: "iPhone 15" env PLAYWRIGHT_MCP_DEVICE |
| --mobile | emulate a generic mobile device (Pixel 10 for Chromium, iPhone 17 for WebKit). Mobile pages are usually lighter, which saves tokens. Cannot be combined with --device. env PLAYWRIGHT_MCP_MOBILE |
| --executable-path | path to the browser executable. env PLAYWRIGHT_MCP_EXECUTABLE_PATH |
| --extension | Connect to a running browser instance (Edge/Chrome only). Requires the "Playwright Extension" to be installed. env PLAYWRIGHT_MCP_EXTENSION |
| --endpoint | Bound browser endpoint to connect to. env PLAYWRIGHT_MCP_ENDPOINT |
| --file-paths | how file paths are rendered in tool results, "relative" to the workspace root or "absolute". Default is "relative". env PLAYWRIGHT_MCP_FILE_PATHS |
| --grant-permissions <permissions...> | List of permissions to grant to the browser context, for example "geolocation", "clipboard-read", "clipboard-write". env PLAYWRIGHT_MCP_GRANT_PERMISSIONS |
| --headless | run browser in headless mode, headed by default env PLAYWRIGHT_MCP_HEADLESS |
| --host | host to bind server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces. env PLAYWRIGHT_MCP_HOST |
| --idle-timeout | close the browser after this many milliseconds without a completed tool call, the next tool call relaunches it. Defaults to one hour for headless browsers, never for headed ones, 0 disables. env PLAYWRIGHT_MCP_IDLE_TIMEOUT |
| --ignore-https-errors | ignore https errors env PLAYWRIGHT_MCP_IGNORE_HTTPS_ERRORS |
| --ignore-roots | do not ask the client for its workspace roots, use the current working directory as the workspace root instead. Use this with clients that advertise roots, but can not answer the roots request. env PLAYWRIGHT_MCP_IGNORE_ROOTS |
| --init-page <path...> | path to TypeScript file to evaluate on Playwright page object env PLAYWRIGHT_MCP_INIT_PAGE |
| --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. env PLAYWRIGHT_MCP_INIT_SCRIPT |
| --isolated | keep the browser profile in memory, do not save it to disk. env PLAYWRIGHT_MCP_ISOLATED |
| --image-responses | whether to send image responses to the client. Can be "allow", "omit" or "only". With "only", a response that carries an image consists of the image parts alone, without the text part. Defaults to "allow". env PLAYWRIGHT_MCP_IMAGE_RESPONSES |
| --no-sandbox | disable the sandbox for all process types that are normally sandboxed. env PLAYWRIGHT_MCP_NO_SANDBOX |
| --background | do not activate controlled tabs or focus the browser window when using --extension. env PLAYWRIGHT_MCP_BACKGROUND |
| --no-tab-group | do not group controlled tabs when using --extension. env PLAYWRIGHT_MCP_NO_TAB_GROUP |
| --no-webmcp | do not collect or expose the tools that a page registers through the WebMCP API. env PLAYWRIGHT_MCP_WEBMCP=false |
| --output-dir | path to the directory for automatically named output files, for example a screenshot taken without an explicit file name. Files with an explicit name are resolved against the workspace root instead and are not affected by this option. env PLAYWRIGHT_MCP_OUTPUT_DIR |
| --output-max-size | Threshold for evicting old output files, in bytes. env PLAYWRIGHT_MCP_OUTPUT_MAX_SIZE |
| --port | port to listen on for SSE transport. env PLAYWRIGHT_MCP_PORT |
| --profile-dir-name | name of the profile directory in the user data dir to connect to with --extension, for example "Profile 1". Defaults to the last used profile that has the extension installed. env PLAYWRIGHT_MCP_PROFILE_DIR_NAME |
| --proxy-bypass | comma-separated domains to bypass proxy, for example ".com,chromium.org,.domain.com" env PLAYWRIGHT_MCP_PROXY_BYPASS |
| --proxy-server | specify proxy server, for example "http://myproxy:3128", "http://user:password@myproxy:3128" or "socks5://myproxy:8080" env PLAYWRIGHT_MCP_PROXY_SERVER |
| --redact-url-params | comma-separated list of URL query and fragment parameter names, for example "access_token,code", whose values are replaced with in the tool responses. env PLAYWRIGHT_MCP_REDACT_URL_PARAMS |
| --sandbox | enable the sandbox for all process types that are normally not sandboxed. env PLAYWRIGHT_MCP_SANDBOX |
| --save-session | Whether to save the Playwright MCP session into the output directory. env PLAYWRIGHT_MCP_SAVE_SESSION |
| --secrets | path to a file containing secrets in the dotenv format env PLAYWRIGHT_MCP_SECRETS_FILE |
| --shared-browser-context | reuse the same browser context between all connected HTTP clients. env PLAYWRIGHT_MCP_SHARED_BROWSER_CONTEXT |
| --snapshot-boxes | include each element's bounding box as [box=x,y,width,height] in snapshots. Coordinates are viewport-relative, in CSS pixels. env PLAYWRIGHT_MCP_SNAPSHOT_BOXES |
| --snapshot-mode | when taking snapshots for responses, specifies the mode to use. Can be "full" or "none". Default is "full". env PLAYWRIGHT_MCP_SNAPSHOT_MODE |
| --storage-state | path to the storage state file for isolated sessions. env PLAYWRIGHT_MCP_STORAGE_STATE |
| --test-id-attribute | specify the attribute to use for test ids, defaults to "data-testid" env PLAYWRIGHT_MCP_TEST_ID_ATTRIBUTE |
| --timeout-action | specify action timeout in milliseconds, defaults to 5000ms env PLAYWRIGHT_MCP_TIMEOUT_ACTION |
| --timeout-navigation | specify navigation timeout in milliseconds, defaults to 60000ms env PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION |
| --timeout-settle | how long to wait after each action for triggered work to settle, in milliseconds, defaults to 500ms env PLAYWRIGHT_MCP_TIMEOUT_SETTLE |
| --user-agent | specify user agent string env PLAYWRIGHT_MCP_USER_AGENT |
| --user-data-dir | path to the user data directory. If not specified, a temporary directory will be created. env PLAYWRIGHT_MCP_USER_DATA_DIR |
| --viewport-size | specify browser viewport size in pixels, for example "1280x720" env PLAYWRIGHT_MCP_VIEWPORT_SIZE |