Skip to content

[MCP]: browser_close caches a disposed backend with shared HTTP clients #42363

Description

@HMWCS

Using @playwright/mcp@0.0.79 with HTTP transport and --shared-browser-context:

  1. Clients A and B each call a browser tool.
  2. A calls browser_close.
  3. A calls browser_tabs { action: "new", url: "https://example.com" }.

A then fails until restart with:

TypeError: Cannot read properties of undefined
(reading 'checkUrlAndNavigate' / 'waitForInitialized')

browser_close disposes A's Context, but its cached backendPromise is cleared only on disconnected. Because B keeps the shared browser alive, no disconnect occurs and A reuses the disposed backend.

Expected: explicit close invalidates A's cached backend so the next call creates a fresh one.

This appears to be a 0.0.79 regression. Please clear backendPromise on explicit close and add a two-client regression test.

Version: @playwright/mcp 0.0.79, playwright-core 1.63.0-alpha-2026-08-05.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions