Skip to main content
The Config type defines all configuration options for customizing the Playwright MCP server behavior. All fields are optional.

Browser Configuration

object
Browser-related configuration options.

Extension Mode

boolean
Connect to a running browser instance (Edge/Chrome only). If specified, browser config is ignored.Requires the “Playwright MCP Bridge” browser extension to be installed.

Server Configuration

object
HTTP server configuration for SSE or MCP transport.

Capabilities

ToolCapability[]
List of enabled tool capabilities. See Tool Capabilities for details.Possible values:
  • 'config' - Configuration tools
  • 'core' - Core browser automation features
  • 'core-navigation' - Navigation tools
  • 'core-tabs' - Tab management
  • 'core-input' - Input and interaction tools
  • 'core-install' - Browser installation
  • 'network' - Network request inspection
  • 'pdf' - PDF generation
  • 'storage' - Storage management
  • 'testing' - Test assertions and verification
  • 'vision' - Coordinate-based interactions
  • 'devtools' - Developer tools features

Session Recording

boolean
Whether to save the Playwright session into the output directory.
boolean
Whether to save the Playwright trace of the session into the output directory.
object
If specified, saves the Playwright video of the session into the output directory.

Browser Context Sharing

boolean
Reuse the same browser context between all connected HTTP clients.

Secrets Management

Record<string, string>
Secrets are used to prevent LLM from getting sensitive data while automating scenarios such as authentication.Note: Prefer browser.contextOptions.storageState over secrets file as a more secure alternative.

Output Configuration

string
The directory to save output files (screenshots, PDFs, traces, etc.).
'file' | 'stdout'
Whether to save snapshots, console messages, network logs and other session logs to a file or to the standard output. Defaults to 'stdout'.

Console Messages

object
Console message configuration.

Network Configuration

object
Network request filtering configuration.

Test ID Attribute

string
Specify the attribute to use for test ids. Defaults to 'data-testid'.

Timeouts

object
Timeout configuration for actions and navigation.

Image Responses

'allow' | 'omit'
Whether to send image responses to the client. Defaults to 'allow'.

Snapshot Configuration

object
Page snapshot configuration.

File Access

boolean
Whether to allow file uploads from anywhere on the file system. By default (false), file uploads are restricted to paths within the MCP roots only.

Code Generation

'typescript' | 'none'
Specify the language to use for code generation. Defaults to 'typescript'.

Complete Example