Playwright MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PLAYWRIGHT_MCP_CAPS | No | Comma-separated list of additional capabilities to enable. Possible values: vision, pdf, devtools. | |
| PLAYWRIGHT_MCP_HOST | No | Host to bind server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces. | |
| PLAYWRIGHT_MCP_PORT | No | Port to listen on for SSE transport. | |
| PLAYWRIGHT_MCP_CONFIG | No | Path to the configuration file. | |
| PLAYWRIGHT_MCP_DEVICE | No | Device to emulate, for example: 'iPhone 15'. | |
| PLAYWRIGHT_MCP_MOBILE | No | Set to 'true' to emulate a generic mobile device. Cannot be combined with --device. | |
| PLAYWRIGHT_MCP_BROWSER | No | Browser or chrome channel to use. Possible values: chrome, firefox, webkit, msedge. | |
| PLAYWRIGHT_MCP_CODEGEN | No | Language to use for code generation. Possible values: typescript, python, java, csharp, none. Defaults to typescript. | |
| PLAYWRIGHT_MCP_SANDBOX | No | Set to 'true' to enable the sandbox for all process types that are normally not sandboxed. | |
| PLAYWRIGHT_MCP_ENDPOINT | No | Bound browser endpoint to connect to. | |
| PLAYWRIGHT_MCP_HEADLESS | No | Set to 'true' to run browser in headless mode. | |
| PLAYWRIGHT_MCP_ISOLATED | No | Set to 'true' to keep the browser profile in memory. | |
| PLAYWRIGHT_MCP_EXTENSION | No | Set to 'true' to connect to a running browser instance (Edge/Chrome only). Requires the Playwright Extension. | |
| PLAYWRIGHT_MCP_INIT_PAGE | No | Path to a TypeScript file to evaluate on Playwright page object. | |
| PLAYWRIGHT_MCP_NO_SANDBOX | No | Set to 'true' to disable sandbox for all process types that are normally sandboxed. | |
| PLAYWRIGHT_MCP_OUTPUT_DIR | No | Path to the directory for output files. | |
| PLAYWRIGHT_MCP_USER_AGENT | No | Specify user agent string. | |
| PLAYWRIGHT_MCP_CDP_HEADERS | No | CDP headers to send with the connect request. Multiple can be specified. | |
| PLAYWRIGHT_MCP_CDP_TIMEOUT | No | Timeout in milliseconds for connecting to CDP endpoint. Defaults to 30000ms. | |
| PLAYWRIGHT_MCP_INIT_SCRIPT | No | Path to a JavaScript file to add as an initialization script. Can be specified multiple times. | |
| PLAYWRIGHT_MCP_CDP_ENDPOINT | No | CDP endpoint to connect to. | |
| PLAYWRIGHT_MCP_PROXY_BYPASS | No | Comma-separated domains to bypass proxy, for example '.com,chromium.org,.domain.com'. | |
| PLAYWRIGHT_MCP_PROXY_SERVER | No | Specify proxy server, e.g. 'http://myproxy:3128' or 'socks5://myproxy:8080'. | |
| PLAYWRIGHT_MCP_SAVE_SESSION | No | Set to 'true' to save the Playwright MCP session into the output directory. | |
| PLAYWRIGHT_MCP_SECRETS_FILE | No | Path to a file containing secrets in the dotenv format. | |
| PLAYWRIGHT_MCP_ALLOWED_HOSTS | No | 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. | |
| PLAYWRIGHT_MCP_CONSOLE_LEVEL | No | Level of console messages to return: error, warning, info, debug. | |
| PLAYWRIGHT_MCP_SNAPSHOT_MODE | No | When taking snapshots for responses, specifies the mode to use. Can be 'full' or 'none'. Default is 'full'. | |
| PLAYWRIGHT_MCP_STORAGE_STATE | No | Path to the storage state file for isolated sessions. | |
| PLAYWRIGHT_MCP_USER_DATA_DIR | No | Path to the user data directory. If not specified, a temporary directory will be created. | |
| PLAYWRIGHT_MCP_VIEWPORT_SIZE | No | Browser viewport size in pixels, for example '1280x720'. | |
| PLAYWRIGHT_MCP_SNAPSHOT_BOXES | No | Set to 'true' to include each element's bounding box in snapshots. | |
| PLAYWRIGHT_MCP_TIMEOUT_ACTION | No | Action timeout in milliseconds. Defaults to 5000ms. | |
| PLAYWRIGHT_MCP_TIMEOUT_SETTLE | No | How long to wait after each action for triggered work to settle, in milliseconds. Defaults to 500ms. | |
| PLAYWRIGHT_MCP_ALLOWED_ORIGINS | No | Semicolon-separated list of trusted origins to allow the browser to request. Default is to allow all. | |
| PLAYWRIGHT_MCP_BLOCKED_ORIGINS | No | Semicolon-separated list of origins to block the browser from requesting. | |
| PLAYWRIGHT_MCP_EXECUTABLE_PATH | No | Path to the browser executable. | |
| PLAYWRIGHT_MCP_IMAGE_RESPONSES | No | Whether to send image responses to the client. Can be 'allow' or 'omit'. Defaults to 'allow'. | |
| PLAYWRIGHT_MCP_OUTPUT_MAX_SIZE | No | Threshold for evicting old output files, in bytes. | |
| PLAYWRIGHT_MCP_GRANT_PERMISSIONS | No | List of permissions to grant to the browser context, for example 'geolocation', 'clipboard-read', 'clipboard-write'. | |
| PLAYWRIGHT_MCP_TEST_ID_ATTRIBUTE | No | Attribute to use for test ids. Defaults to 'data-testid'. | |
| PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION | No | Navigation timeout in milliseconds. Defaults to 60000ms. | |
| PLAYWRIGHT_MCP_IGNORE_HTTPS_ERRORS | No | Set to 'true' to ignore HTTPS errors. | |
| PLAYWRIGHT_MCP_BLOCK_SERVICE_WORKERS | No | Set to 'true' to block service workers. | |
| PLAYWRIGHT_MCP_SHARED_BROWSER_CONTEXT | No | Set to 'true' to reuse the same browser context between all connected HTTP clients. | |
| PLAYWRIGHT_MCP_ALLOW_UNRESTRICTED_FILE_ACCESS | No | Set to 'true' to allow access to files outside workspace roots and file:// URLs. |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| browser_closeA | Close the page |
| browser_resizeA | Resize the browser window |
| browser_console_messagesC | Returns all console messages |
| browser_handle_dialogC | Handle a dialog |
| browser_evaluateC | Evaluate JavaScript expression on page or element |
| browser_file_uploadC | Upload one or multiple files |
| browser_dropA | Drop files or MIME-typed data onto an element, as if dragged from outside the page. At least one of "paths" or "data" must be provided. |
| browser_findA | Search the accessibility snapshot of the current page for text or a regular expression. Returns matching snapshot nodes with a few lines of surrounding context (like search snippets), each shown under its path from the root of the tree, which is cheaper than capturing the whole snapshot when you only need to locate an element and its ref. |
| browser_fill_formB | Fill multiple form fields |
| browser_press_keyB | Press a key on the keyboard |
| browser_typeC | Type text into editable element |
| browser_navigateC | Navigate to a URL |
| browser_navigate_backA | Go back to the previous page in the history |
| browser_network_requestsA | Returns a numbered list of network requests since loading the page. Use browser_network_request with the number to get full details. |
| browser_network_requestA | Returns full details (headers and body) of a single network request, or a single part if |
| browser_run_code_unsafeA | Run a Playwright code snippet. Unsafe: executes arbitrary JavaScript in the Playwright server process and is RCE-equivalent. |
| browser_take_screenshotA | Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions. |
| browser_snapshotB | Capture accessibility snapshot of the current page, this is better than screenshot |
| browser_clickB | Perform click on a web page |
| browser_dragA | Perform drag and drop between two elements |
| browser_hoverB | Hover over element on page |
| browser_select_optionB | Select an option in a dropdown |
| browser_tabsB | List, create, close, or select a browser tab. |
| browser_wait_forA | Wait for text to appear or disappear or a specified time to pass |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/J0from/playwright-mcp-oss'
If you have feedback or need assistance with the MCP directory API, please join our Discord server