Skip to content

docs(readme): Configuration schema and PLAYWRIGHT_MCP_* env docs are out of sync with playwright-core runtime #550

Open

Description

@alok-108

Version

@playwright/cli 0.1.25 (playwright-core 1.66.0-alpha-2026-11-18)

What happens

README.md's Configuration file schema and Configuration via env sections have drifted from the bundled playwright-core runtime (configFromEnv / resolveCLIConfigForCLI), and no test in tests/integration.spec.ts checks for drift:

  1. Removed / stale PLAYWRIGHT_MCP_* entries in "Configuration via env":

    • PLAYWRIGHT_MCP_SAVE_TRACE and PLAYWRIGHT_MCP_SAVE_VIDEO do not exist anywhere in playwright-core/lib/coreBundle and are silently ignored by configFromEnv / resolveCLIConfigForCLI (tracing and video recording use tracing-start/tracing-stop and video-start/video-stop).
    • PLAYWRIGHT_MCP_EXTENSION still references "Playwright MCP Bridge" instead of "Playwright Extension".
    • PLAYWRIGHT_MCP_CAPS omits devtools, PLAYWRIGHT_MCP_CDP_TIMEOUT omits the 30000ms default, and active env vars read by configFromEnv / playwright-core (PLAYWRIGHT_MCP_BACKGROUND, PLAYWRIGHT_MCP_CODEGEN, PLAYWRIGHT_MCP_EXTENSION_TOKEN, PLAYWRIGHT_MCP_FILE_PATHS, PLAYWRIGHT_MCP_IDLE_TIMEOUT, PLAYWRIGHT_MCP_IMAGE_RESPONSES, PLAYWRIGHT_MCP_MOBILE, PLAYWRIGHT_MCP_NO_TAB_GROUP, PLAYWRIGHT_MCP_OUTPUT_MAX_SIZE, PLAYWRIGHT_MCP_PROFILE_DIR_NAME, PLAYWRIGHT_MCP_REDACT_URL_PARAMS, PLAYWRIGHT_MCP_REMOTE_HEADERS, PLAYWRIGHT_MCP_SESSION_COLOR, PLAYWRIGHT_MCP_TIMEOUT_SETTLE, PLAYWRIGHT_MCP_WEBMCP) are undocumented.
  2. Removed / stale options in "Configuration file schema":

    • outputMode?: 'file' | 'stdout' was removed from playwright-core (0 occurrences in coreBundle.js).
    • saveVideo?: { width: number; height: number } is no longer read by configFromCLIOptions or the tool runtime.
    • codegen?: 'typescript' | 'none' omits 'python' | 'java' | 'csharp', which the runtime accepts.
    • Active configuration options supported by resolveCLIConfigForCLI and .playwright/cli.config.json (extension, tabGroup, sessionColor, background, webmcp, secrets, redactUrlParams, outputMaxSize, timeouts.expect/settle/idle, imageResponses, filePaths, snapshot, ignoreRoots, browser.remoteEndpoint object form) are missing.

Steps to reproduce

node -e '
const fs = require("fs");
const readme = fs.readFileSync("README.md", "utf8");
const envSection = readme.match(/<summary>Configuration via env<\/summary>([\s\S]*?)<\/details>/)[1];
const docEnvs = [...envSection.matchAll(/`(PLAYWRIGHT_MCP_[A-Z0-9_]+)`/g)].map(m => m[1]);
const core = fs.readFileSync(require.resolve("playwright-core/lib/coreBundle"), "utf8");
const runtimeEnvs = new Set(core.match(/\bPLAYWRIGHT_MCP_[A-Z0-9_]+\b/g) || []);
console.log("Unsupported in runtime:", docEnvs.filter(e => !runtimeEnvs.has(e)));
'

Observed output on main:

Unsupported in runtime: [ 'PLAYWRIGHT_MCP_SAVE_TRACE', 'PLAYWRIGHT_MCP_SAVE_VIDEO' ]

Verifying runtime config resolution via tools.resolveCLIConfigForCLI:

node -e '
const { tools } = require("playwright-core/lib/coreBundle");
tools.resolveCLIConfigForCLI(".", "default", {}, {
  PLAYWRIGHT_MCP_SAVE_TRACE: "true",
  PLAYWRIGHT_MCP_SAVE_VIDEO: "800x600",
  PLAYWRIGHT_MCP_CODEGEN: "python",
  PLAYWRIGHT_MCP_WEBMCP: "false",
}).then(c => console.log({ codegen: c.codegen, webmcp: c.webmcp }));
'

PLAYWRIGHT_MCP_SAVE_TRACE and PLAYWRIGHT_MCP_SAVE_VIDEO have no effect, whereas PLAYWRIGHT_MCP_CODEGEN (python) and PLAYWRIGHT_MCP_WEBMCP (false) are applied.

Expected

README.md documents the configuration schema options and PLAYWRIGHT_MCP_* environment variables supported by the pinned playwright-core runtime, and tests/integration.spec.ts asserts that every documented PLAYWRIGHT_MCP_* variable exists in playwright-core/lib/coreBundle.

Activity

  1. microsoft-playwright-automation commented on Nov 23, 2026

    @microsoft-playwright-automation
  2. microsoft-playwright-automation commented on Nov 23, 2026

    @microsoft-playwright-automation
    Contributor

    Hi, I'm the Playwright bot and I checked this on Linux.

    Reproduced on 0.1.25; #551 fixes the documentation drift. On main (c872a33cec77fa03c28fa7c6d1ad99d15d04ce42), the README advertises two environment variables absent from the pinned playwright-core 1.66.0-alpha-2026-11-18 runtime. The linked PR removes those entries and obsolete schema options, and documents the supported configuration.

    My independent check and the PR's regression test both fail before the README fix and pass at PR head 7e8f6c708b155e17aed4b67fc1a85372d8db0f51. The full local suite passes, and the PR merges into the checked main without conflicts.

    Reproduction and verification

    The independent test extracts the environment section from README.md, collects its PLAYWRIGHT_MCP_* names, and checks each against playwright-core/lib/coreBundle. Before the fix, it reports:

    Unsupported: PLAYWRIGHT_MCP_SAVE_TRACE, PLAYWRIGHT_MCP_SAVE_VIDEO
    

    I also applied only the PR's test to main: it fails on the same two entries.

    On #551, npm test -- --workers=2 passes all 11 tests: the PR's 10 integration tests plus my independent check. The new test also verifies removed schema entries and configuration resolution. I compared the documentation with the pinned runtime's environment parser, CLI resolver, path resolution and remote connection handling. These checks are browser-independent; the existing browser-opening integration test also passes.

    git diff --check main pr-551 and the local merge check pass. The only GitHub check that ran, license/cla, is successful; no GitHub test-CI result is available. Validation here was on Linux.

    Triaged on Linux by the Playwright bot - agent run

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions