← Back to microsoft/playwright
microsoft / playwright · Issue No. 41838
The Playwright Extension (packages/extension) is designed to let an MCP client (e.g. an AI
coding agent) drive an existing Chrome browser through the extension's relay. In practice, only
one such connection is supported at a time.
Opening a second --extension connection while a first one is still active disconnects the first
connection and takes over the browser, instead of the two coexisting. This makes it impossible to
run more than one MCP client against the same browser profile at once — for example, two separate
agent instances (Claude Code, or any other MCP client) each trying to drive their own tabs in the
same browser.
Concretely, today: connection B arriving silently kicks out connection A mid-task, with no
indication to A's client that anything happened beyond its browser tools suddenly failing.
--extension --browser chrome (client A), connect it to a tab.I have a working fix (extension-side, packages/extension/src/background.ts andconnectedTabGroup.ts, plus the status page) that:
Playwright · <clientName>, with a (2), (3)No protocol version bump needed, no change to packages/playwright-core's server-side MCP tools.
Covered by a new test file (tests/extension/multi-connection.spec.ts), which passes locally.
I have this ready as a small, self-contained diff (extension-side only) and would like to open a
PR with it, per the contribution guidelines asking to check in here first. Happy to adjust the
approach based on feedback — let me know if this is a direction the team wants, or if a different
approach to multi-connection support is preferred.
Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.