Yury Semikhatsky commited on
Commit
793215a
·
unverified ·
1 Parent(s): b0b4b76

chore: roll 1.59.0-alpha-1771028105000 (#1400)

Browse files
README.md CHANGED
@@ -344,6 +344,8 @@ Playwright MCP server supports following arguments. They can be provided in the
344
  | --cdp-endpoint <endpoint> | CDP endpoint to connect to.<br>*env* `PLAYWRIGHT_MCP_CDP_ENDPOINT` |
345
  | --cdp-header <headers...> | CDP headers to send with the connect request, multiple can be specified.<br>*env* `PLAYWRIGHT_MCP_CDP_HEADER` |
346
  | --cdp-timeout <timeout> | timeout in milliseconds for connecting to CDP endpoint, defaults to 30000ms<br>*env* `PLAYWRIGHT_MCP_CDP_TIMEOUT` |
 
 
347
  | --codegen <lang> | specify the language to use for code generation, possible values: "typescript", "none". Default is "typescript".<br>*env* `PLAYWRIGHT_MCP_CODEGEN` |
348
  | --config <path> | path to the configuration file.<br>*env* `PLAYWRIGHT_MCP_CONFIG` |
349
  | --console-level <level> | level of console messages to return: "error", "warning", "info", "debug". Each level includes the messages of more severe levels.<br>*env* `PLAYWRIGHT_MCP_CONSOLE_LEVEL` |
@@ -358,13 +360,11 @@ Playwright MCP server supports following arguments. They can be provided in the
358
  | --init-script <path...> | path to JavaScript file to add as an initialization script. The script will be evaluated in every page before any of the page's scripts. Can be specified multiple times.<br>*env* `PLAYWRIGHT_MCP_INIT_SCRIPT` |
359
  | --isolated | keep the browser profile in memory, do not save it to disk.<br>*env* `PLAYWRIGHT_MCP_ISOLATED` |
360
  | --image-responses <mode> | whether to send image responses to the client. Can be "allow" or "omit", Defaults to "allow".<br>*env* `PLAYWRIGHT_MCP_IMAGE_RESPONSES` |
361
- | --no-sandbox | disable the sandbox for all process types that are normally sandboxed.<br>*env* `PLAYWRIGHT_MCP_NO_SANDBOX` |
362
  | --output-dir <path> | path to the directory for output files.<br>*env* `PLAYWRIGHT_MCP_OUTPUT_DIR` |
363
  | --output-mode <mode> | whether to save snapshots, console messages, network logs to a file or to the standard output. Can be "file" or "stdout". Default is "stdout".<br>*env* `PLAYWRIGHT_MCP_OUTPUT_MODE` |
364
  | --port <port> | port to listen on for SSE transport.<br>*env* `PLAYWRIGHT_MCP_PORT` |
365
  | --proxy-bypass <bypass> | comma-separated domains to bypass proxy, for example ".com,chromium.org,.domain.com"<br>*env* `PLAYWRIGHT_MCP_PROXY_BYPASS` |
366
  | --proxy-server <proxy> | specify proxy server, for example "http://myproxy:3128" or "socks5://myproxy:8080"<br>*env* `PLAYWRIGHT_MCP_PROXY_SERVER` |
367
- | --sandbox | enable the sandbox for all process types that are normally not sandboxed.<br>*env* `PLAYWRIGHT_MCP_SANDBOX` |
368
  | --save-session | Whether to save the Playwright MCP session into the output directory.<br>*env* `PLAYWRIGHT_MCP_SAVE_SESSION` |
369
  | --save-trace | Whether to save the Playwright Trace of the session into the output directory.<br>*env* `PLAYWRIGHT_MCP_SAVE_TRACE` |
370
  | --save-video <size> | Whether to save the video of the session into the output directory. For example "--save-video=800x600"<br>*env* `PLAYWRIGHT_MCP_SAVE_VIDEO` |
 
344
  | --cdp-endpoint <endpoint> | CDP endpoint to connect to.<br>*env* `PLAYWRIGHT_MCP_CDP_ENDPOINT` |
345
  | --cdp-header <headers...> | CDP headers to send with the connect request, multiple can be specified.<br>*env* `PLAYWRIGHT_MCP_CDP_HEADER` |
346
  | --cdp-timeout <timeout> | timeout in milliseconds for connecting to CDP endpoint, defaults to 30000ms<br>*env* `PLAYWRIGHT_MCP_CDP_TIMEOUT` |
347
+ | --chromium-sandbox | enable the chromium sandbox. disable with --no-chromium-sandbox.<br>*env* `PLAYWRIGHT_MCP_CHROMIUM_SANDBOX` |
348
+ | --no-chromium-sandbox | disable the chromium sandbox.<br>*env* `PLAYWRIGHT_MCP_NO_CHROMIUM_SANDBOX` |
349
  | --codegen <lang> | specify the language to use for code generation, possible values: "typescript", "none". Default is "typescript".<br>*env* `PLAYWRIGHT_MCP_CODEGEN` |
350
  | --config <path> | path to the configuration file.<br>*env* `PLAYWRIGHT_MCP_CONFIG` |
351
  | --console-level <level> | level of console messages to return: "error", "warning", "info", "debug". Each level includes the messages of more severe levels.<br>*env* `PLAYWRIGHT_MCP_CONSOLE_LEVEL` |
 
360
  | --init-script <path...> | path to JavaScript file to add as an initialization script. The script will be evaluated in every page before any of the page's scripts. Can be specified multiple times.<br>*env* `PLAYWRIGHT_MCP_INIT_SCRIPT` |
361
  | --isolated | keep the browser profile in memory, do not save it to disk.<br>*env* `PLAYWRIGHT_MCP_ISOLATED` |
362
  | --image-responses <mode> | whether to send image responses to the client. Can be "allow" or "omit", Defaults to "allow".<br>*env* `PLAYWRIGHT_MCP_IMAGE_RESPONSES` |
 
363
  | --output-dir <path> | path to the directory for output files.<br>*env* `PLAYWRIGHT_MCP_OUTPUT_DIR` |
364
  | --output-mode <mode> | whether to save snapshots, console messages, network logs to a file or to the standard output. Can be "file" or "stdout". Default is "stdout".<br>*env* `PLAYWRIGHT_MCP_OUTPUT_MODE` |
365
  | --port <port> | port to listen on for SSE transport.<br>*env* `PLAYWRIGHT_MCP_PORT` |
366
  | --proxy-bypass <bypass> | comma-separated domains to bypass proxy, for example ".com,chromium.org,.domain.com"<br>*env* `PLAYWRIGHT_MCP_PROXY_BYPASS` |
367
  | --proxy-server <proxy> | specify proxy server, for example "http://myproxy:3128" or "socks5://myproxy:8080"<br>*env* `PLAYWRIGHT_MCP_PROXY_SERVER` |
 
368
  | --save-session | Whether to save the Playwright MCP session into the output directory.<br>*env* `PLAYWRIGHT_MCP_SAVE_SESSION` |
369
  | --save-trace | Whether to save the Playwright Trace of the session into the output directory.<br>*env* `PLAYWRIGHT_MCP_SAVE_TRACE` |
370
  | --save-video <size> | Whether to save the video of the session into the output directory. For example "--save-video=800x600"<br>*env* `PLAYWRIGHT_MCP_SAVE_VIDEO` |
package-lock.json CHANGED
@@ -13,7 +13,7 @@
13
  ],
14
  "devDependencies": {
15
  "@modelcontextprotocol/sdk": "^1.25.2",
16
- "@playwright/test": "1.59.0-alpha-1770400094000",
17
  "@types/node": "^24.3.0"
18
  }
19
  },
@@ -854,13 +854,13 @@
854
  "link": true
855
  },
856
  "node_modules/@playwright/test": {
857
- "version": "1.59.0-alpha-1770400094000",
858
- "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.59.0-alpha-1770400094000.tgz",
859
- "integrity": "sha512-P0Jv0WouOb4dOhi6hrl6qa/3hszJp/RliFE1PzCd+Gw0k+aPiEFBzh8qVmur3P32kszv+pG9UPsivcsMcTpHNg==",
860
  "dev": true,
861
  "license": "Apache-2.0",
862
  "dependencies": {
863
- "playwright": "1.59.0-alpha-1770400094000"
864
  },
865
  "bin": {
866
  "playwright": "cli.js"
@@ -2442,6 +2442,16 @@
2442
  "url": "https://opencollective.com/express"
2443
  }
2444
  },
 
 
 
 
 
 
 
 
 
 
2445
  "node_modules/ms": {
2446
  "version": "2.1.3",
2447
  "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@@ -2616,12 +2626,12 @@
2616
  }
2617
  },
2618
  "node_modules/playwright": {
2619
- "version": "1.59.0-alpha-1770400094000",
2620
- "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.59.0-alpha-1770400094000.tgz",
2621
- "integrity": "sha512-49P817plxhSzZfn3lvB6G92KGgj7jb7cO39sqDQhqlI9mTJWM+slZrfokw1vL1H4ZZkYMoedRE14rUcn8cNl9g==",
2622
  "license": "Apache-2.0",
2623
  "dependencies": {
2624
- "playwright-core": "1.59.0-alpha-1770400094000"
2625
  },
2626
  "bin": {
2627
  "playwright": "cli.js"
@@ -2638,9 +2648,9 @@
2638
  "link": true
2639
  },
2640
  "node_modules/playwright-core": {
2641
- "version": "1.59.0-alpha-1770400094000",
2642
- "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.59.0-alpha-1770400094000.tgz",
2643
- "integrity": "sha512-hfQOLT2s7cKLvOx8BT4IB9CFAFAxsxKuZokmyESf6vWQesQ+lbeNCo8ogGJYYszTK1ojm9pNKNBM961QNqZ4+w==",
2644
  "license": "Apache-2.0",
2645
  "bin": {
2646
  "playwright-core": "cli.js"
@@ -3417,6 +3427,7 @@
3417
  "@types/react": "^18.2.66",
3418
  "@types/react-dom": "^18.2.22",
3419
  "@vitejs/plugin-react": "^4.0.0",
 
3420
  "react": "^18.2.0",
3421
  "react-dom": "^18.2.0",
3422
  "typescript": "^5.8.2",
@@ -3437,8 +3448,8 @@
3437
  "version": "0.0.66",
3438
  "license": "Apache-2.0",
3439
  "dependencies": {
3440
- "playwright": "1.59.0-alpha-1770400094000",
3441
- "playwright-core": "1.59.0-alpha-1770400094000"
3442
  },
3443
  "bin": {
3444
  "playwright-mcp": "cli.js"
 
13
  ],
14
  "devDependencies": {
15
  "@modelcontextprotocol/sdk": "^1.25.2",
16
+ "@playwright/test": "1.59.0-alpha-1771028105000",
17
  "@types/node": "^24.3.0"
18
  }
19
  },
 
854
  "link": true
855
  },
856
  "node_modules/@playwright/test": {
857
+ "version": "1.59.0-alpha-1771028105000",
858
+ "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.59.0-alpha-1771028105000.tgz",
859
+ "integrity": "sha512-chMidCR7qg6ExeTrYP3isJ5fzIgD0bXldX4aQo1vVWPb0su5xJL0UcA5hD1qsmuP1dkUlkI4Qf2wfuxuCfxdyg==",
860
  "dev": true,
861
  "license": "Apache-2.0",
862
  "dependencies": {
863
+ "playwright": "1.59.0-alpha-1771028105000"
864
  },
865
  "bin": {
866
  "playwright": "cli.js"
 
2442
  "url": "https://opencollective.com/express"
2443
  }
2444
  },
2445
+ "node_modules/minimist": {
2446
+ "version": "1.2.8",
2447
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
2448
+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
2449
+ "dev": true,
2450
+ "license": "MIT",
2451
+ "funding": {
2452
+ "url": "https://github.com/sponsors/ljharb"
2453
+ }
2454
+ },
2455
  "node_modules/ms": {
2456
  "version": "2.1.3",
2457
  "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
 
2626
  }
2627
  },
2628
  "node_modules/playwright": {
2629
+ "version": "1.59.0-alpha-1771028105000",
2630
+ "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.59.0-alpha-1771028105000.tgz",
2631
+ "integrity": "sha512-tSRYmBZlJt32Q0CKNlVyavvobXt+P7kFUJN+ak9wkcUo+hRSHqyAUcp6G9pRG/vilraanrS6gmAIs3cjUwwxhA==",
2632
  "license": "Apache-2.0",
2633
  "dependencies": {
2634
+ "playwright-core": "1.59.0-alpha-1771028105000"
2635
  },
2636
  "bin": {
2637
  "playwright": "cli.js"
 
2648
  "link": true
2649
  },
2650
  "node_modules/playwright-core": {
2651
+ "version": "1.59.0-alpha-1771028105000",
2652
+ "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.59.0-alpha-1771028105000.tgz",
2653
+ "integrity": "sha512-yEIjYyIGSWw8cuaw1hSkAQ+1EBQSdYW2RaHOgHLVAKW8iw7gs8tpY9Wr/75oGazhohRyZNNDom41SO7ktuTUcA==",
2654
  "license": "Apache-2.0",
2655
  "bin": {
2656
  "playwright-core": "cli.js"
 
3427
  "@types/react": "^18.2.66",
3428
  "@types/react-dom": "^18.2.22",
3429
  "@vitejs/plugin-react": "^4.0.0",
3430
+ "minimist": "^1.2.5",
3431
  "react": "^18.2.0",
3432
  "react-dom": "^18.2.0",
3433
  "typescript": "^5.8.2",
 
3448
  "version": "0.0.66",
3449
  "license": "Apache-2.0",
3450
  "dependencies": {
3451
+ "playwright": "1.59.0-alpha-1771028105000",
3452
+ "playwright-core": "1.59.0-alpha-1771028105000"
3453
  },
3454
  "bin": {
3455
  "playwright-mcp": "cli.js"
package.json CHANGED
@@ -26,7 +26,7 @@
26
  ],
27
  "devDependencies": {
28
  "@modelcontextprotocol/sdk": "^1.25.2",
29
- "@playwright/test": "1.59.0-alpha-1770400094000",
30
  "@types/node": "^24.3.0"
31
  }
32
  }
 
26
  ],
27
  "devDependencies": {
28
  "@modelcontextprotocol/sdk": "^1.25.2",
29
+ "@playwright/test": "1.59.0-alpha-1771028105000",
30
  "@types/node": "^24.3.0"
31
  }
32
  }
packages/extension/README.md CHANGED
@@ -10,16 +10,9 @@ The Playwright MCP Chrome Extension allows you to connect to pages in your exist
10
 
11
  ## Installation Steps
12
 
13
- ### Download the Extension
14
 
15
- Download the latest Chrome extension from GitHub:
16
- - **Download link**: https://github.com/microsoft/playwright-mcp/releases
17
-
18
- ### Load Chrome Extension
19
-
20
- 1. Open Chrome and navigate to `chrome://extensions/`
21
- 2. Enable "Developer mode" (toggle in the top right corner)
22
- 3. Click "Load unpacked" and select the extension directory
23
 
24
  ### Configure Playwright MCP server
25
 
 
10
 
11
  ## Installation Steps
12
 
13
+ ### Install the Extension
14
 
15
+ Install [Playwright MCP Bridge](https://chromewebstore.google.com/detail/playwright-mcp-bridge/mmlmfjhmonkocbjadbfplnigmagldckm) from the Chrome Web Store.
 
 
 
 
 
 
 
16
 
17
  ### Configure Playwright MCP server
18
 
packages/extension/package.json CHANGED
@@ -27,6 +27,7 @@
27
  "@types/react": "^18.2.66",
28
  "@types/react-dom": "^18.2.22",
29
  "@vitejs/plugin-react": "^4.0.0",
 
30
  "react": "^18.2.0",
31
  "react-dom": "^18.2.0",
32
  "typescript": "^5.8.2",
 
27
  "@types/react": "^18.2.66",
28
  "@types/react-dom": "^18.2.22",
29
  "@vitejs/plugin-react": "^4.0.0",
30
+ "minimist": "^1.2.5",
31
  "react": "^18.2.0",
32
  "react-dom": "^18.2.0",
33
  "typescript": "^5.8.2",
packages/extension/tests/extension.spec.ts CHANGED
@@ -42,8 +42,8 @@ type TestFixtures = {
42
  cli: (...args: string[]) => Promise<CliResult>;
43
  };
44
 
45
- const extensionPublicKey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9nMS2b0WCohjVHPGb8D9qAdkbIngDqoAjTeSccHJijgcONejge+OJxOQOMLu7b0ovt1c9BiEJa5JcpM+EHFVGL1vluBxK71zmBy1m2f9vZF3HG0LSCp7YRkum9rAIEthDwbkxx6XTvpmAY5rjFa/NON6b9Hlbo+8peUSkoOK7HTwYnnI36asZ9eUTiveIf+DMPLojW2UX33vDWG2UKvMVDewzclb4+uLxAYshY7Mx8we/b44xu+Anb/EBLKjOPk9Yh541xJ5Ozc8EiP/5yxOp9c/lRiYUHaRW+4r0HKZyFt0eZ52ti2iM4Nfk7jRXR7an3JPsUIf5deC/1cVM/+1ZQIDAQAB';
46
- const extensionId = 'jakfalbnbhgkpmoaakfflhflbfpkailf';
47
 
48
  const test = base.extend<TestFixtures>({
49
  pathToExtension: async ({}, use, testInfo) => {
@@ -52,6 +52,9 @@ const test = base.extend<TestFixtures>({
52
  await fs.cp(srcDir, extensionDir, { recursive: true });
53
  const manifestPath = path.join(extensionDir, 'manifest.json');
54
  const manifest = JSON.parse(await fs.readFile(manifestPath, 'utf8'));
 
 
 
55
  manifest.key = extensionPublicKey;
56
  await fs.writeFile(manifestPath, JSON.stringify(manifest, null, 2));
57
  await use(extensionDir);
@@ -113,7 +116,7 @@ const test = base.extend<TestFixtures>({
113
  });
114
 
115
  // Cleanup sessions
116
- await runCli(['session-stop-all'], { mcpBrowser, testInfo }).catch(() => {});
117
 
118
  const daemonDir = path.join(testInfo.outputDir, 'daemon');
119
  await fs.rm(daemonDir, { recursive: true, force: true }).catch(() => {});
@@ -130,7 +133,7 @@ async function runCli(
130
  const testInfo = options.testInfo;
131
 
132
  // Path to the terminal CLI
133
- const cliPath = path.join(__dirname, '../../../node_modules/playwright/lib/mcp/terminal/cli.js');
134
 
135
  return new Promise<CliResult>((resolve, reject) => {
136
  let stdout = '';
@@ -405,8 +408,8 @@ test.describe('CLI with extension', () => {
405
  // Wait for the confirmation page to appear
406
  const confirmationPage = await confirmationPagePromise;
407
 
408
- // Click the Allow button
409
- await confirmationPage.getByRole('button', { name: 'Allow' }).click();
410
 
411
  // Wait for the CLI command to complete
412
  const { output } = await cliPromise;
 
42
  cli: (...args: string[]) => Promise<CliResult>;
43
  };
44
 
45
+ const extensionPublicKey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwRsUUO4mmbCi4JpmrIoIw31iVW9+xUJRZ6nSzya17PQkaUPDxe1IpgM+vpd/xB6mJWlJSyE1Lj95c0sbomGfVY1M0zUeKbaRVcAb+/a6m59gNR+ubFlmTX0nK9/8fE2FpRB9D+4N5jyeIPQuASW/0oswI2/ijK7hH5NTRX8gWc/ROMSgUj7rKhTAgBrICt/NsStgDPsxRTPPJnhJ/ViJtM1P5KsSYswE987DPoFnpmkFpq8g1ae0eYbQfXy55ieaacC4QWyJPj3daU2kMfBQw7MXnnk0H/WDxouMOIHnd8MlQxpEMqAihj7KpuONH+MUhuj9HEQo4df6bSaIuQ0b4QIDAQAB';
46
+ const extensionId = 'mmlmfjhmonkocbjadbfplnigmagldckm';
47
 
48
  const test = base.extend<TestFixtures>({
49
  pathToExtension: async ({}, use, testInfo) => {
 
52
  await fs.cp(srcDir, extensionDir, { recursive: true });
53
  const manifestPath = path.join(extensionDir, 'manifest.json');
54
  const manifest = JSON.parse(await fs.readFile(manifestPath, 'utf8'));
55
+ // We don't hardcode the key in manifest, but for the tests we set the key field
56
+ // to ensure that locally installed extension has the same id as the one published
57
+ // in the store.
58
  manifest.key = extensionPublicKey;
59
  await fs.writeFile(manifestPath, JSON.stringify(manifest, null, 2));
60
  await use(extensionDir);
 
116
  });
117
 
118
  // Cleanup sessions
119
+ await runCli(['close-all'], { mcpBrowser, testInfo }).catch(() => {});
120
 
121
  const daemonDir = path.join(testInfo.outputDir, 'daemon');
122
  await fs.rm(daemonDir, { recursive: true, force: true }).catch(() => {});
 
133
  const testInfo = options.testInfo;
134
 
135
  // Path to the terminal CLI
136
+ const cliPath = path.join(__dirname, '../../../node_modules/playwright/lib/cli/client/program.js');
137
 
138
  return new Promise<CliResult>((resolve, reject) => {
139
  let stdout = '';
 
408
  // Wait for the confirmation page to appear
409
  const confirmationPage = await confirmationPagePromise;
410
 
411
+ // Click the Connect button
412
+ await confirmationPage.locator('.tab-item', { hasText: 'Playwright MCP extension' }).getByRole('button', { name: 'Connect' }).click();
413
 
414
  // Wait for the CLI command to complete
415
  const { output } = await cliPromise;
packages/playwright-mcp/cli.js CHANGED
@@ -16,9 +16,9 @@
16
  */
17
 
18
  const { program } = require('playwright-core/lib/utilsBundle');
19
- const { decorateCommand } = require('playwright/lib/mcp/program');
20
 
21
  const packageJSON = require('./package.json');
22
  const p = program.version('Version ' + packageJSON.version).name('Playwright MCP');
23
- decorateCommand(p, packageJSON.version)
24
  void program.parseAsync(process.argv);
 
16
  */
17
 
18
  const { program } = require('playwright-core/lib/utilsBundle');
19
+ const { decorateMCPCommand } = require('playwright/lib/mcp/program');
20
 
21
  const packageJSON = require('./package.json');
22
  const p = program.version('Version ' + packageJSON.version).name('Playwright MCP');
23
+ decorateMCPCommand(p, packageJSON.version)
24
  void program.parseAsync(process.argv);
packages/playwright-mcp/package.json CHANGED
@@ -32,8 +32,8 @@
32
  }
33
  },
34
  "dependencies": {
35
- "playwright": "1.59.0-alpha-1770400094000",
36
- "playwright-core": "1.59.0-alpha-1770400094000"
37
  },
38
  "bin": {
39
  "playwright-mcp": "cli.js"
 
32
  }
33
  },
34
  "dependencies": {
35
+ "playwright": "1.59.0-alpha-1771028105000",
36
+ "playwright-core": "1.59.0-alpha-1771028105000"
37
  },
38
  "bin": {
39
  "playwright-mcp": "cli.js"