Disclaimer: This is an unofficial, modified fork of Microsoft Playwright. It is not affiliated with, endorsed by, or maintained by Microsoft. Use at your own risk.
The official Playwright MCP server runs a single shared browser context — all tool calls share one set of tabs, cookies, and state. This makes it impossible for multiple AI agents (or sub-agents) to browse the web in parallel without stepping on each other.
This fork is a workaround that adds browser instance isolation so each agent gets its own independent session through the same MCP server. It's a pragmatic hack, not a polished product — if/when upstream Playwright adds native parallel support, this repo becomes obsolete.
Three new tools and one new parameter on all existing tools:
| Addition | What it does |
|---|---|
browser_instance_create |
Spin up a new isolated browser instance (own tabs, cookies, storage) |
browser_instance_list |
List active instances with tab counts and current URLs |
browser_instance_close |
Tear down an instance by ID |
instanceId param |
Added to every standard tool — targets a specific instance |
When instanceId is omitted, tools operate on the default instance (fully backward-compatible with standard Playwright MCP).
- Node.js ≥ 18
- Chromium/Chrome (auto-installed by Playwright if needed)
git clone https://github.com/martin-lzh/playwright-mcp-parallellel.git
cd playwright-mcp-parallellel
npm install
npm run buildnpx playwright install chromiumHTTP/SSE (for networked agents):
node packages/playwright-core/lib/tools/mcp/cli-stub.js --isolated --port 3000Stdio (for local MCP clients like VS Code):
node packages/playwright-core/lib/tools/mcp/cli-stub.js --isolatedShortcut:
npm start
# → node packages/playwright-core/lib/tools/mcp/cli-stub.js --isolated --port 3000Add to your VS Code settings.json:
Replace the path with your actual clone location.
Each agent creates its own instance, uses it, then cleans up:
Agent A Agent B
─────── ───────
browser_instance_create browser_instance_create
→ instanceId: "agent-a" → instanceId: "agent-b"
browser_navigate browser_navigate
url: "https://site-a.com" url: "https://site-b.com"
instanceId: "agent-a" instanceId: "agent-b"
browser_snapshot browser_click
instanceId: "agent-a" element: "Submit"
instanceId: "agent-b"
browser_instance_close browser_instance_close
instanceId: "agent-a" instanceId: "agent-b"
Tools called without instanceId hit the default instance — works exactly like upstream.
| Flag | Description |
|---|---|
--isolated |
Isolated browser contexts (required for instance support) |
--port <n> |
HTTP/SSE server on given port (omit for stdio) |
--browser <name> |
chromium (default), firefox, webkit |
--headless |
Headless mode |
--caps <list> |
Comma-separated: core, tabs, pdf, history, wait, files, install, testing |
--config <path> |
Path to config JSON |
npm run build # Full build
npm run ctest-mcp # Run all MCP tests (Chromium)
npm run ctest-mcp -- instance # Instance isolation tests onlyThis project is a modified fork of Microsoft Playwright, which is licensed under the Apache License 2.0.
The original copyright and license terms are preserved in full — see LICENSE. Per the Apache 2.0 license terms, this fork constitutes a derivative work. The modifications add browser instance isolation to the MCP server; all original Playwright functionality remains intact and is the work of Microsoft and the Playwright contributors.
This project is not an official Microsoft product.
{ "mcp": { "servers": { "playwright": { "command": "node", "args": [ "C:/absolute/path/to/playwright-mcp-parallel/packages/playwright-core/lib/tools/mcp/cli-stub.js", "--isolated" ] } } } }