Skip to content

Conversation

@w0lf69
Copy link

@w0lf69 w0lf69 commented Jan 30, 2026

Summary

  • The PLAYWRIGHT_MCP_CONFIG environment variable is documented and read by configFromEnv() but was never used to actually load the config file
  • This fix adds a fallback in resolveCLIConfig() to use the env var when --config CLI option is not provided

Test plan

  • Set PLAYWRIGHT_MCP_CONFIG=/path/to/config.json environment variable
  • Verify config file is loaded (tested with contextOptions.extraHTTPHeaders and contextOptions.userAgent)
  • Verify --config CLI flag still takes precedence over env var

🤖 Generated with Claude Code

The PLAYWRIGHT_MCP_CONFIG environment variable is read by configFromEnv()
but was never actually used to load the config file. This fix adds a
fallback to use the env var when --config CLI option is not provided.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
options.caps = commaSeparatedList(process.env.PLAYWRIGHT_MCP_CAPS);
options.cdpEndpoint = envToString(process.env.PLAYWRIGHT_MCP_CDP_ENDPOINT);
options.cdpHeader = headerParser(process.env.PLAYWRIGHT_MCP_CDP_HEADERS, {});
options.config = envToString(process.env.PLAYWRIGHT_MCP_CONFIG);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is happening, just a little too late. Remove this line.

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.

2 participants