Skip to content

docs: fix PLAYWRIGHT_MCP_ALLOWED_HOSTS env var name#1414

Merged
pavelfeldman merged 1 commit intomicrosoft:mainfrom
lucamorettibuilds:fix/env-var-allowed-hostnames
Feb 21, 2026
Merged

docs: fix PLAYWRIGHT_MCP_ALLOWED_HOSTS env var name#1414
pavelfeldman merged 1 commit intomicrosoft:mainfrom
lucamorettibuilds:fix/env-var-allowed-hostnames

Conversation

@lucamorettibuilds
Copy link
Copy Markdown
Contributor

The README documents the --allowed-hosts environment variable as PLAYWRIGHT_MCP_ALLOWED_HOSTS, but the actual implementation reads from PLAYWRIGHT_MCP_ALLOWED_HOSTNAMES:

https://github.com/microsoft/playwright/blob/9901ab97198b6109da3591008fba4f367f428471/packages/playwright/src/mcp/browser/config.ts#L312

options.allowedHosts = commaSeparatedList(process.env.PLAYWRIGHT_MCP_ALLOWED_HOSTNAMES);

This one-character discrepancy causes the env var to silently have no effect.

Fixes #1373

The README documented the environment variable as
PLAYWRIGHT_MCP_ALLOWED_HOSTS, but the actual implementation in
playwright/src/mcp/browser/config.ts reads from
PLAYWRIGHT_MCP_ALLOWED_HOSTNAMES.

This caused the env var to silently have no effect.

Fixes microsoft#1373
@pavelfeldman pavelfeldman merged commit f1f42f8 into microsoft:main Feb 21, 2026
4 of 6 checks passed
yury-s added a commit to yury-s/playwright-mcp that referenced this pull request Mar 5, 2026
yury-s added a commit that referenced this pull request Mar 5, 2026
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.

[Bug] - Incorrect environment variable name for allowed hosts

2 participants