Skip to content

[MCP]: Isolated HTTP sessions keep their browser context after disconnect #41539

Description

What's going on?

When two HTTP clients connect to a server started with --isolated, they share one browser but get separate browser contexts. If one client terminates while the other remains connected, the terminated client's context stays open until the last client disconnects.

Reproduce:

  1. start the MCP server with --port=8931 --isolated;
  2. connect two Streamable HTTP clients and navigate from both.
  3. Terminate the first session.
  4. From the second session check page.context().browser().contexts().length.

It remains 2; it should be 1.

This is related to #40709, but concerns per-client context cleanup after disconnect rather than duplicate browser launches.

Version

1.62.0-next (main)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions