Skip to content

Commit 4968bc6

Browse files
authored
chore(mcp): allow to pass extension token via env variable (#37371)
1 parent 60bf27c commit 4968bc6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/playwright/src/mcp/extension/cdpRelay.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ export class CDPRelayServer {
127127
url.searchParams.set('protocolVersion', process.env.PWMCP_TEST_PROTOCOL_VERSION ?? protocol.VERSION.toString());
128128
if (toolName)
129129
url.searchParams.set('newTab', String(toolName === 'browser_navigate'));
130+
const token = process.env.PLAYWRIGHT_MCP_EXTENSION_TOKEN;
131+
if (token)
132+
url.searchParams.set('token', token);
130133
const href = url.toString();
131134

132135
let executablePath = this._executablePath;

0 commit comments

Comments
 (0)