Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore(mcp): fix PLAYWRIGHT_MCP_ALLOWED_HOSTS name (#39521)

Yury Semikhatsky3c8c457b85e2
diff --git a/packages/playwright-core/src/mcp/browser/config.ts b/packages/playwright-core/src/mcp/browser/config.ts
index 88e5b1bec3..6c3792e0c4 100644
--- a/packages/playwright-core/src/mcp/browser/config.ts
+++ b/packages/playwright-core/src/mcp/browser/config.ts
@@ -316,7 +316,7 @@ export function configFromCLIOptions(cliOptions: CLIOptions): Config & { configF
export function configFromEnv(): Config & { configFile?: string } {
const options: CLIOptions = {};
- options.allowedHosts = commaSeparatedList(process.env.PLAYWRIGHT_MCP_ALLOWED_HOSTNAMES);
+ options.allowedHosts = commaSeparatedList(process.env.PLAYWRIGHT_MCP_ALLOWED_HOSTS);
options.allowedOrigins = semicolonSeparatedList(process.env.PLAYWRIGHT_MCP_ALLOWED_ORIGINS);
options.allowUnrestrictedFileAccess = envToBoolean(process.env.PLAYWRIGHT_MCP_ALLOW_UNRESTRICTED_FILE_ACCESS);
options.blockedOrigins = semicolonSeparatedList(process.env.PLAYWRIGHT_MCP_BLOCKED_ORIGINS);