Skip to content

Commit 80ae194

Browse files
Merge branch 'main' into patch-1
2 parents 78c1089 + 1de725a commit 80ae194

18 files changed

Lines changed: 175 additions & 24 deletions

.github/workflows/run-tests.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- windows-latest
2121
- macos-latest
2222
node:
23-
- 22.12.0
23+
- 20
2424
- 22
2525
- 23
2626
- 24
@@ -34,19 +34,34 @@ jobs:
3434
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
3535
with:
3636
cache: npm
37-
node-version: ${{ matrix.node }}
37+
node-version: 22 # build works only with 22+.
3838

3939
- name: Install dependencies
4040
shell: bash
4141
run: npm ci
4242

43+
- name: Build
44+
run: npm run build
45+
46+
- name: Set up Node.js
47+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
48+
with:
49+
cache: npm
50+
node-version: ${{ matrix.node }}
51+
4352
- name: Disable AppArmor
4453
if: ${{ matrix.os == 'ubuntu-latest' }}
4554
shell: bash
4655
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
4756

57+
- name: Run tests (node20)
58+
if: ${{ matrix.node == '20' }}
59+
shell: bash
60+
run: npm run test:node20
61+
4862
- name: Run tests
4963
shell: bash
64+
if: ${{ matrix.node != '20' }}
5065
run: npm run test
5166

5267
# Gating job for branch protection.

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.4.0"
2+
".": "0.5.1"
33
}

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Changelog
22

3+
## [0.5.1](https://github.com/ChromeDevTools/chrome-devtools-mcp/compare/chrome-devtools-mcp-v0.5.0...chrome-devtools-mcp-v0.5.1) (2025-09-29)
4+
5+
6+
### Bug Fixes
7+
8+
* update package.json engines to reflect node20 support ([#210](https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/210)) ([b31e647](https://github.com/ChromeDevTools/chrome-devtools-mcp/commit/b31e64713e0524f28cbf760fad27b25829ec419d))
9+
10+
## [0.5.0](https://github.com/ChromeDevTools/chrome-devtools-mcp/compare/chrome-devtools-mcp-v0.4.0...chrome-devtools-mcp-v0.5.0) (2025-09-29)
11+
12+
13+
### Features
14+
15+
* **screenshot:** add JPEG quality parameter support ([#184](https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/184)) ([139cfd1](https://github.com/ChromeDevTools/chrome-devtools-mcp/commit/139cfd135cdb07573fe87d824631fcdb6153186e))
16+
17+
18+
### Bug Fixes
19+
20+
* do not error if the dialog was already handled ([#208](https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/208)) ([d9f77f8](https://github.com/ChromeDevTools/chrome-devtools-mcp/commit/d9f77f85098ffe851308c5de05effb03ac21237b))
21+
* reference to handle_dialog tool ([#209](https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/209)) ([205eef5](https://github.com/ChromeDevTools/chrome-devtools-mcp/commit/205eef5cdff19ccb7ddbd113bb1450cb87e8f398))
22+
* support node20 ([#52](https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/52)) ([13613b4](https://github.com/ChromeDevTools/chrome-devtools-mcp/commit/13613b4a33ab7cf2d4fb1f4849bfa6b82f546945))
23+
* update tool reference in an error ([#205](https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/205)) ([7765bb3](https://github.com/ChromeDevTools/chrome-devtools-mcp/commit/7765bb381ad9d01219547faf879a74978188754a))
24+
325
## [0.4.0](https://github.com/ChromeDevTools/chrome-devtools-mcp/compare/chrome-devtools-mcp-v0.3.0...chrome-devtools-mcp-v0.4.0) (2025-09-26)
426

527

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ MCP clients.
2727

2828
## Requirements
2929

30-
- [Node.js 22.12.0](https://nodejs.org/) or newer.
30+
- [Node.js 20](https://nodejs.org/) or a newer [latest maintainance LTS](https://github.com/nodejs/Release#release-schedule) version.
3131
- [Chrome](https://www.google.com/chrome/) current stable version or newer.
3232
- [npm](https://www.npmjs.com/).
3333

@@ -75,6 +75,23 @@ claude mcp add chrome-devtools npx chrome-devtools-mcp@latest
7575
codex mcp add chrome-devtools -- npx chrome-devtools-mcp@latest
7676
```
7777

78+
**On Windows 11**
79+
80+
Configure the Chrome install location and increase the startup timeout by updating `.codex/config.toml` and adding the following `env` and `startup_timeout_ms` parameters:
81+
82+
```
83+
[mcp_servers.chrome-devtools]
84+
command = "cmd"
85+
args = [
86+
"/c",
87+
"npx",
88+
"-y",
89+
"chrome-devtools-mcp@latest",
90+
]
91+
env = { SystemRoot="C:\\Windows", PROGRAMFILES="C:\\Program Files" }
92+
startup_timeout_ms = 20_000
93+
```
94+
7895
</details>
7996

8097
<details>

docs/tool-reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ so returned values have to JSON-serializable.
308308

309309
- **format** (enum: "png", "jpeg") _(optional)_: Type of format to save the screenshot as. Default is "png"
310310
- **fullPage** (boolean) _(optional)_: If set to true takes a screenshot of the full page instead of the currently visible viewport. Incompatible with uid.
311+
- **quality** (number) _(optional)_: Compression quality for JPEG format (0-100). Higher values mean better quality but larger file sizes. Ignored for PNG format.
311312
- **uid** (string) _(optional)_: The uid of an element on the page from the page content snapshot. If omitted takes a pages screenshot.
312313

313314
---

package-lock.json

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

package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chrome-devtools-mcp",
3-
"version": "0.4.0",
3+
"version": "0.5.1",
44
"description": "MCP server for Chrome DevTools",
55
"type": "module",
66
"bin": "./build/src/index.js",
@@ -14,6 +14,7 @@
1414
"docs:generate": "node --experimental-strip-types scripts/generate-docs.ts",
1515
"start": "npm run build && node build/src/index.js",
1616
"start-debug": "DEBUG=mcp:* DEBUG_COLORS=false npm run build && node build/src/index.js",
17+
"test:node20": "node --require ./build/tests/setup.js --test-reporter spec --test-force-exit --test build/tests",
1718
"test": "npm run build && node --require ./build/tests/setup.js --no-warnings=ExperimentalWarning --test-reporter spec --test-force-exit --test \"build/tests/**/*.test.js\"",
1819
"test:only": "npm run build && node --require ./build/tests/setup.js --no-warnings=ExperimentalWarning --test-reporter spec --test-force-exit --test --test-only \"build/tests/**/*.test.js\"",
1920
"test:only:no-build": "node --require ./build/tests/setup.js --no-warnings=ExperimentalWarning --test-reporter spec --test-force-exit --test --test-only \"build/tests/**/*.test.js\"",
@@ -36,7 +37,8 @@
3637
"homepage": "https://github.com/ChromeDevTools/chrome-devtools-mcp#readme",
3738
"mcpName": "io.github.ChromeDevTools/chrome-devtools-mcp",
3839
"dependencies": {
39-
"@modelcontextprotocol/sdk": "1.18.1",
40+
"@modelcontextprotocol/sdk": "1.18.2",
41+
"core-js": "3.45.1",
4042
"debug": "4.4.3",
4143
"puppeteer-core": "24.22.3",
4244
"yargs": "18.0.0"
@@ -53,16 +55,16 @@
5355
"@typescript-eslint/parser": "^8.43.0",
5456
"chrome-devtools-frontend": "1.0.1520535",
5557
"eslint": "^9.35.0",
56-
"eslint-plugin-import": "^2.32.0",
5758
"eslint-import-resolver-typescript": "^4.4.4",
59+
"eslint-plugin-import": "^2.32.0",
5860
"globals": "^16.4.0",
5961
"prettier": "^3.6.2",
6062
"puppeteer": "24.22.3",
6163
"sinon": "^21.0.0",
62-
"typescript-eslint": "^8.43.0",
63-
"typescript": "^5.9.2"
64+
"typescript": "^5.9.2",
65+
"typescript-eslint": "^8.43.0"
6466
},
6567
"engines": {
66-
"node": ">=22.12.0"
68+
"node": "^20.19.0 || ^22.12.0 || >=23"
6769
}
6870
}

src/McpContext.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import type {
2121

2222
import {NetworkCollector, PageCollector} from './PageCollector.js';
2323
import {listPages} from './tools/pages.js';
24+
import {takeSnapshot} from './tools/snapshot.js';
2425
import {CLOSE_PAGE_ERROR} from './tools/ToolDefinition.js';
2526
import type {Context} from './tools/ToolDefinition.js';
2627
import type {TraceResult} from './trace-processing/parse.js';
@@ -261,7 +262,9 @@ export class McpContext implements Context {
261262

262263
async getElementByUid(uid: string): Promise<ElementHandle<Element>> {
263264
if (!this.#textSnapshot?.idToNode.size) {
264-
throw new Error('No snapshot found. Use browser_snapshot to capture one');
265+
throw new Error(
266+
`No snapshot found. Use ${takeSnapshot.name} to capture one.`,
267+
);
265268
}
266269
const [snapshotId] = uid.split('_');
267270

src/McpResponse.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
} from './formatters/networkFormatter.js';
1818
import {formatA11ySnapshot} from './formatters/snapshotFormatter.js';
1919
import type {McpContext} from './McpContext.js';
20+
import {handleDialog} from './tools/pages.js';
2021
import type {ImageContentData, Response} from './tools/ToolDefinition.js';
2122
import {paginate, type PaginationOptions} from './utils/pagination.js';
2223

@@ -167,7 +168,7 @@ export class McpResponse implements Response {
167168
if (dialog) {
168169
response.push(`# Open dialog
169170
${dialog.type()}: ${dialog.message()} (default value: ${dialog.message()}).
170-
Call browser_handle_dialog to handle it before continuing.`);
171+
Call ${handleDialog.name} to handle it before continuing.`);
171172
}
172173

173174
if (this.#includePages) {

src/index.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,23 @@ import {version} from 'node:process';
1010

1111
const [major, minor] = version.substring(1).split('.').map(Number);
1212

13-
if (major < 22 || (major === 22 && minor < 12)) {
13+
if (major === 20 && minor < 19) {
1414
console.error(
15-
`ERROR: \`chrome-devtools-mcp\` does not support Node ${process.version}. Please upgrade to Node 22.12.0 or newer.`,
15+
`ERROR: \`chrome-devtools-mcp\` does not support Node ${process.version}. Please upgrade to Node 20.19.0 LTS or a newer LTS.`,
16+
);
17+
process.exit(1);
18+
}
19+
20+
if (major === 22 && minor < 12) {
21+
console.error(
22+
`ERROR: \`chrome-devtools-mcp\` does not support Node ${process.version}. Please upgrade to Node 22.12.0 LTS or a newer LTS.`,
23+
);
24+
process.exit(1);
25+
}
26+
27+
if (major < 20) {
28+
console.error(
29+
`ERROR: \`chrome-devtools-mcp\` does not support Node ${process.version}. Please upgrade to Node 20.19.0 LTS or a newer LTS.`,
1630
);
1731
process.exit(1);
1832
}

0 commit comments

Comments
 (0)