fix(mcp): support remoteHeaders for remote browser endpoint#40828
Conversation
Allows the MCP/CLI client to forward custom headers (e.g. `x-playwright-browser`) when connecting to a Playwright `run-server` endpoint, which previously failed because no browser type was specified. Fixes: microsoft#40814
Remote server connection is browser-agnostic, so running the same test against every mcpBrowser project just burns CI time.
Test results for "MCP"6 failed 7080 passed, 1104 skipped Merge workflow run. |
Summary
browser.remoteHeadersconfig option (and--remote-headerCLI flag /PLAYWRIGHT_MCP_REMOTE_HEADERSenv var) to forward custom headers when MCP/CLI connects to a Playwrightrun-serverendpoint.x-playwright-browserso the remote can select a browser type, fixing theCannot read properties of undefined (reading 'launch')failure.Fixes #40814