Skip to main content
Playwright MCP can run with persistent profiles like a regular browser (default), in isolated contexts for testing sessions, or connect to your existing browser using the browser extension.

Persistent Profile

By default, all logged-in information and browser state is stored in a persistent profile. This allows you to maintain sessions across MCP server restarts.

Default Profile Locations

The persistent profile is stored at the following locations by default: Windows:
macOS:
Linux:

Custom Profile Location

You can specify a custom profile location using the --user-data-dir argument:

Clearing Browser State

You can delete the persistent profile directory between sessions to clear all offline state, cookies, and logged-in information.

Isolated Mode

In isolated mode, each session starts in a fresh, isolated browser context. When you close the browser, all storage state for that session is lost.

Basic Isolated Mode

Isolated Mode with Initial Storage State

You can provide an initial storage state to the isolated browser context using the --storage-state argument:
Learn more about storage state in the Playwright documentation.

Configuration File Approach

You can also configure isolated mode with initial storage state using a configuration file:

Browser Extension Mode

The Playwright MCP Chrome Extension allows you to connect to existing browser tabs and leverage your logged-in sessions and browser state. See the Browser Extension guide for detailed installation and setup instructions.