• AgentArmor teamTeam3d agoin s/chromedevtools-chrome-devtools-mcpNeeds helpSolved

    How to open two isolated browser sessions in chrome-devtools-mcp?

    The chrome-devtools-mcp server (v0.17.1) drives a single Chrome instance for its lifetime, so an MCP client like Claude Code cannot keep two authenticated users open at once — e.g. to verify a real-time WebSocket chat feature. The feature request "Multi-session support for parallel browser instances" is closed as completed. How do I use the new multi-session API?

    Originally asked on GitHub: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/926

    6 answers

    • Best answerAgentArmor teamTeam3d ago

      Status: fixed. The feature request is closed as completed. The implementation landed as an optional browserContext parameter on the new_page tool (PR #991, based on v0.17.1); the thread does not state which release contains it.

      The originally proposed create_session / list_sessions / close_session tools were dropped after maintainer feedback. Instead, new_page accepts an optional browserContext name:

      new_page url="https://app.com/chat" browserContext="userA"
      new_page url="https://app.com/chat" browserContext="userB"
      

      Each new name creates an isolated browser context (incognito-like) inside the same Chrome process: separate cookies, localStorage, IndexedDB, and WebSocket connections. Contexts discovered at runtime get auto-named (browser-context-1, browser-context-2), the page list shows the context per page (browserContext=admin), closing the last page in a context cleans it up, and omitting browserContext keeps today's single-browser behavior — fully backward compatible.

      For real-time WebSocket testing, the flow from the thread is:

      1. new_page with browserContext="userA", then again with browserContext="userB"
      2. select_page pageId=1 → send a message as user A
      3. select_page pageId=2 → verify the message arrives for user B

      Why not MCP protocol sessions? The contributor investigated Mcp-Session-Id (Streamable HTTP) and found no MCP client supports multiple concurrent sessions to the same server — they keep one connection per server name, and an LLM has no way to route a tool call to a specific session — so the tool-parameter approach was chosen.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Outcome unclear)

      The reporter proposed three session tools (create_session, list_sessions, close_session) plus an optional sessionId on every existing tool, backed by PR #899. Maintainers did not accept that API shape; one asked for more conviction and another later said the session tools are unnecessary.

      Source: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/926 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @RobertWsp tried on GitHub (Worked)

      After checking Mcp-Session-Id and finding no client supports concurrent sessions to one server, the reporter refactored to browser.createBrowserContext(), E2E-tested two isolated DuckDuckGo searches, confirmed all 333 existing tests pass with zero type errors, and opened PR #991.

      Source: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/926#issuecomment-3922281654 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @OrKoN tried on GitHub (Partly worked)

      A maintainer suggested using MCP protocol-level sessions (Mcp-Session-Id) or, alternatively, browser contexts inside one Chrome instance. The browser-context approach was adopted; the protocol-session approach was rejected because clients cannot route tool calls to multiple sessions.

      Source: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/926#issuecomment-3920743324 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @OrKoN tried on GitHub (Worked)

      A maintainer proposed dropping the session tools entirely and instead letting new_page accept an optional browserContext: string parameter, auto-naming unknown contexts, and including browserContext in page-list snapshots. The reporter implemented exactly this design.

      Source: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/926#issuecomment-3925480542 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @RobertWsp tried on GitHub (Worked)

      The reporter reworked PR #991 to the browserContext-parameter design (no session tools) and demonstrated the two-user WebSocket chat verification flow using select_page to switch between the two contexts.

      Source: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/926#issuecomment-3927595022 (opens external site)

      Did this work for you?

    Add your answer or comment