Skip to content

Commit e4ced16

Browse files
committed
merge
2 parents 271909b + 59f6477 commit e4ced16

38 files changed

Lines changed: 3330 additions & 1232 deletions

.github/workflows/pre-release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ jobs:
2323
with:
2424
cache: npm
2525
node-version-file: '.nvmrc'
26+
registry-url: 'https://registry.npmjs.org'
27+
28+
# Ensure npm 11.5.1 or later is installed
29+
- name: Update npm
30+
run: npm install -g npm@latest
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Build and bundle
36+
run: npm run bundle
37+
env:
38+
NODE_ENV: 'production'
2639

2740
- name: Verify server.json
2841
run: npm run verify-server-json-version
42+
43+
- name: Verify npm package
44+
run: npm run verify-npm-package

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,10 @@ The Chrome DevTools MCP server supports the following configuration option:
497497
If enabled, ignores errors relative to self-signed and expired certificates. Use with caution.
498498
- **Type:** boolean
499499

500+
- **`--experimentalScreencast`/ `--experimental-screencast`**
501+
Exposes experimental screencast tools (requires ffmpeg). Install ffmpeg https://www.ffmpeg.org/download.html and ensure it is available in the MCP server PATH.
502+
- **Type:** boolean
503+
500504
- **`--chromeArg`/ `--chrome-arg`**
501505
Additional arguments for Chrome. Only applies when Chrome is launched by chrome-devtools-mcp.
502506
- **Type:** array

docs/tool-reference.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- AUTO GENERATED DO NOT EDIT - run 'npm run docs' to update-->
22

3-
# Chrome DevTools MCP Tool Reference (~6922 cl100k_base tokens)
3+
# Chrome DevTools MCP Tool Reference (~6980 cl100k_base tokens)
44

55
- **[Audits](#audits)** (1 tools)
66
- [`lighthouse_audit`](#lighthouse_audit)
@@ -188,6 +188,7 @@
188188

189189
- **url** (string) **(required)**: URL to load in a new page.
190190
- **background** (boolean) _(optional)_: Whether to open the page in the background without bringing it to the front. Default is false (foreground).
191+
- **isolatedContext** (string) _(optional)_: If specified, the page is created in an isolated browser context with the given name. Pages in the same browser context share cookies and storage. Pages in different browser contexts are fully isolated.
191192
- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used.
192193

193194
---

package-lock.json

Lines changed: 164 additions & 162 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"main": "index.js",
88
"scripts": {
99
"clean": "node -e \"require('fs').rmSync('build', {recursive: true, force: true})\"",
10-
"bundle": "npm run clean && npm run build && rollup -c rollup.config.mjs && node -e \"require('fs').rmSync('build/node_modules', {recursive: true, force: true})\"",
10+
"bundle": "npm run clean && npm run build && rollup -c rollup.config.mjs && node -e \"require('fs').rmSync('build/node_modules', {recursive: true, force: true})\" && node --experimental-strip-types scripts/append-lighthouse-notices.ts",
1111
"build": "tsc && node --experimental-strip-types --no-warnings=ExperimentalWarning scripts/post-build.ts",
1212
"typecheck": "tsc --noEmit",
1313
"format": "eslint --cache --fix . && prettier --write --cache .",
@@ -23,12 +23,12 @@
2323
"prepare": "node --experimental-strip-types scripts/prepare.ts",
2424
"verify-server-json-version": "node --experimental-strip-types scripts/verify-server-json-version.ts",
2525
"update-lighthouse": "node --experimental-strip-types scripts/update-lighthouse.ts",
26+
"verify-npm-package": "node scripts/verify-npm-package.mjs",
2627
"eval": "npm run build && CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS=true node --experimental-strip-types scripts/eval_gemini.ts",
2728
"count-tokens": "node --experimental-strip-types scripts/count_tokens.ts"
2829
},
2930
"files": [
3031
"build/src",
31-
"build/node_modules",
3232
"LICENSE",
3333
"!*.tsbuildinfo"
3434
],
@@ -64,8 +64,8 @@
6464
"globals": "^17.0.0",
6565
"lighthouse": "13.0.2",
6666
"prettier": "^3.6.2",
67-
"puppeteer": "24.37.4",
68-
"rollup": "4.57.1",
67+
"puppeteer": "24.37.5",
68+
"rollup": "4.58.0",
6969
"rollup-plugin-cleanup": "^3.2.1",
7070
"rollup-plugin-license": "^3.6.0",
7171
"sinon": "^21.0.0",
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* @license
3+
* Copyright 2026 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
import fs from 'node:fs';
8+
import path from 'node:path';
9+
10+
const ROOT_DIR = process.cwd();
11+
const TARGET_DIR = path.join(ROOT_DIR, 'build/src/third_party');
12+
const SOURCE_DIR = path.join(ROOT_DIR, 'src/third_party');
13+
14+
function main() {
15+
const lighthouseNotices = fs.readFileSync(
16+
path.join(SOURCE_DIR, 'LIGHTHOUSE_MCP_BUNDLE_THIRD_PARTY_NOTICES'),
17+
'utf8',
18+
);
19+
const bundledNotices = fs.readFileSync(
20+
path.join(TARGET_DIR, 'THIRD_PARTY_NOTICES'),
21+
'utf8',
22+
);
23+
fs.writeFileSync(
24+
path.join(TARGET_DIR, 'THIRD_PARTY_NOTICES'),
25+
bundledNotices +
26+
'\n\n-------------------- DEPENDENCY DIVIDER --------------------\n\n' +
27+
lighthouseNotices,
28+
);
29+
console.log('Done.');
30+
}
31+
32+
main();
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* @license
3+
* Copyright 2026 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
import assert from 'node:assert';
8+
9+
import type {TestScenario} from '../eval_gemini.ts';
10+
11+
export const scenario: TestScenario = {
12+
prompt:
13+
'Create a new page <TEST_URL> in an isolated context called contextB. Take a screenshot there.',
14+
maxTurns: 3,
15+
htmlRoute: {
16+
path: '/test.html',
17+
htmlContent: `
18+
<h1>test</h1>
19+
`,
20+
},
21+
expectations: calls => {
22+
console.log(JSON.stringify(calls, null, 2));
23+
assert.strictEqual(calls.length, 2);
24+
assert.ok(calls[0].name === 'new_page', 'First call should be navigation');
25+
assert.deepStrictEqual(calls[0].args.isolatedContext, 'contextB');
26+
assert.ok(
27+
calls[1].name === 'take_screenshot',
28+
'Second call should be a screenshot',
29+
);
30+
},
31+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @license
3+
* Copyright 2026 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
import assert from 'node:assert';
8+
9+
import type {TestScenario} from '../eval_gemini.ts';
10+
11+
export const scenario: TestScenario = {
12+
prompt: 'Check a11y issues on the current page',
13+
maxTurns: 1,
14+
expectations: calls => {
15+
assert.strictEqual(calls.length, 1);
16+
assert.ok(
17+
calls[0].name === 'lighthouse_audit',
18+
'First call should be lighthouse_audit',
19+
);
20+
},
21+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @license
3+
* Copyright 2026 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
import assert from 'node:assert';
8+
9+
import type {TestScenario} from '../eval_gemini.ts';
10+
11+
export const scenario: TestScenario = {
12+
prompt: 'Check for best practices on the current page',
13+
maxTurns: 1,
14+
expectations: calls => {
15+
assert.strictEqual(calls.length, 1);
16+
assert.ok(
17+
calls[0].name === 'lighthouse_audit',
18+
'First call should be lighthouse_audit',
19+
);
20+
},
21+
};

scripts/test.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ async function runTests(attempt) {
6868
env: {
6969
...process.env,
7070
CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS: true,
71+
CHROME_DEVTOOLS_MCP_CRASH_ON_UNCAUGHT: true,
7172
},
7273
});
7374

0 commit comments

Comments
 (0)