Skip to content

fix(mcp): default stdio sessions to isolated#40420

Closed
BaseInfinity wants to merge 2 commits intomicrosoft:mainfrom
BaseInfinity:fix/mcp-stdio-isolated-default
Closed

fix(mcp): default stdio sessions to isolated#40420
BaseInfinity wants to merge 2 commits intomicrosoft:mainfrom
BaseInfinity:fix/mcp-stdio-isolated-default

Conversation

@BaseInfinity
Copy link
Copy Markdown

@BaseInfinity BaseInfinity commented Apr 25, 2026

Summary

Default stdio MCP sessions to isolated browser contexts unless the user explicitly opts into persistence or an attached browser mode.

This avoids default-profile SingletonLock collisions for short-lived stdio MCP clients after a previous client disconnects without an explicit browser_close. HTTP/SSE transports keep the existing persistent default.

Fixes #40419.

Changes

  • Resolve stdio MCP defaults to browser.isolated = true when no persistence or attachment mode is configured.
  • Keep HTTP/SSE, --user-data-dir, remote endpoint, CDP endpoint, extension, and explicit --isolated behavior unchanged.
  • Update MCP docs to describe the stdio-vs-HTTP/SSE profile defaults.
  • Update MCP tests whose tab/root expectations depend on the default profile mode.
  • Keep tracing start/stop on the same isolated browser context when tracing starts before navigation.

Verification

  • RED: 5dafdf939 test(mcp): cover stdio default isolated behavior
  • GREEN: 52afd9c76 fix(mcp): default stdio sessions to isolated
  • npm run build
  • npm run ctest-mcp -- tests/mcp/config-resolve.spec.ts tests/mcp/launch.spec.ts tests/mcp/profile-lock.spec.ts tests/mcp/roots.spec.ts tests/mcp/tabs.spec.ts tests/mcp/tracing.spec.ts
    • 87 passed, 1 skipped
  • env -u NO_COLOR npm run ctest-mcp -- --workers=3
    • 589 passed, 3 skipped
  • npm run flint

Note: I unset NO_COLOR locally only to avoid a Node 25 color-environment warning affecting exact-output MCP tests.

@BaseInfinity
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@pavelfeldman
Copy link
Copy Markdown
Member

That's unfortunately very breaking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(mcp): stdio default profile lock collisions for agent clients

2 participants