From dccba24345fc3b54d387f41189309a25a8efeb10 Mon Sep 17 00:00:00 2001 From: Ryan Malloy Date: Mon, 12 Jan 2026 19:48:17 -0700 Subject: [PATCH] feat: add --no-isolated flag to enable persistent browser profile Adds --no-isolated CLI flag to switch from the default incognito-like isolated mode to a persistent browser profile. This enables features that require non-incognito mode, particularly: - Push API (pushManager.subscribe()) for push notifications - Service worker persistence across sessions - Full browser state retention Usage: npx playwright-mcp --no-isolated PLAYWRIGHT_MCP_ISOLATED=false npx playwright-mcp The default behavior (--isolated) remains unchanged for backward compatibility. --- README.md | 5 ++++- src/program.ts | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eb95071..08df044 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,10 @@ Playwright MCP server supports following arguments. They can be provided in the Use 0.0.0.0 to bind to all interfaces. --ignore-https-errors ignore https errors --isolated keep the browser profile in memory, do not - save it to disk. + save it to disk. This is the default. + --no-isolated use a persistent browser profile. Enables + features like Push API that require + non-incognito mode. --image-responses whether to send image responses to the client. Can be "allow" or "omit", Defaults to "allow". --no-snapshots disable automatic page snapshots after diff --git a/src/program.ts b/src/program.ts index 452d09f..d52ad3c 100644 --- a/src/program.ts +++ b/src/program.ts @@ -44,7 +44,8 @@ program .option('--headless', 'run browser in headless mode, headed by default') .option('--host ', 'host to bind server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.') .option('--ignore-https-errors', 'ignore https errors') - .option('--isolated', 'keep the browser profile in memory, do not save it to disk.') + .option('--isolated', 'keep the browser profile in memory, do not save it to disk. This is the default.') + .option('--no-isolated', 'use a persistent browser profile. Enables features like Push API that require non-incognito mode.') .option('--image-responses ', 'whether to send image responses to the client. Can be "allow" or "omit", Defaults to "allow".') .option('--no-snapshots', 'disable automatic page snapshots after interactive operations like clicks. Use browser_snapshot tool for explicit snapshots.') .option('--max-snapshot-tokens ', 'maximum number of tokens allowed in page snapshots before truncation. Use 0 to disable truncation. Default is 10000.', parseInt)