chrome-devtools-mcp 1.11.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +72 -20
  2. package/build/src/BrowserManager.js +27 -18
  3. package/build/src/McpContext.js +435 -87
  4. package/build/src/McpPage.js +189 -59
  5. package/build/src/McpResponse.js +61 -44
  6. package/build/src/TextSnapshot.js +37 -18
  7. package/build/src/ToolHandler.js +256 -135
  8. package/build/src/bin/chrome-devtools-mcp-main.js +6 -4
  9. package/build/src/bin/chrome-devtools.js +4 -4
  10. package/build/src/collectors/PageCollector.js +13 -9
  11. package/build/src/collectors/ServiceWorkerCollector.js +2 -2
  12. package/build/src/collectors/constants.js +7 -0
  13. package/build/src/config/ConfigParser.js +44 -149
  14. package/build/src/config/ConfigWatcher.js +3 -2
  15. package/build/src/config/ServerConfig.js +251 -0
  16. package/build/src/config/browser-options.js +13 -4
  17. package/build/src/config/cli-options.js +35 -19
  18. package/build/src/config/mcp-options.js +61 -35
  19. package/build/src/config/puppeteer-options.js +4 -2
  20. package/build/src/daemon/client.js +3 -3
  21. package/build/src/daemon/daemon.js +7 -3
  22. package/build/src/daemon/utils.js +2 -1
  23. package/build/src/devtools/DevToolsCommentBridge.js +28 -5
  24. package/build/src/devtools/DevtoolsUtils.js +49 -12
  25. package/build/src/formatters/ConsoleFormatter.js +28 -1
  26. package/build/src/formatters/HeapSnapshotFormatter.js +14 -18
  27. package/build/src/formatters/NetworkFormatter.js +54 -15
  28. package/build/src/formatters/RemoteObjectFormatter.js +231 -0
  29. package/build/src/formatters/SnapshotFormatter.js +13 -3
  30. package/build/src/index.js +256 -104
  31. package/build/src/processors/HeapSnapshotManager.js +390 -128
  32. package/build/src/third_party/THIRD_PARTY_NOTICES +542 -445
  33. package/build/src/third_party/bundled-packages.json +2 -2
  34. package/build/src/third_party/cli.js +9239 -0
  35. package/build/src/third_party/devtools-formatter-worker.js +3089 -2438
  36. package/build/src/third_party/devtools-heap-snapshot-worker.js +172 -1
  37. package/build/src/third_party/index.js +52247 -55764
  38. package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +54576 -52174
  39. package/build/src/tools/ToolDefinition.js +90 -12
  40. package/build/src/tools/comments.js +42 -3
  41. package/build/src/tools/console.js +6 -4
  42. package/build/src/tools/css.js +1 -0
  43. package/build/src/tools/emulation.js +5 -4
  44. package/build/src/tools/extensions.js +5 -0
  45. package/build/src/tools/input.js +21 -6
  46. package/build/src/tools/lighthouse.js +24 -8
  47. package/build/src/tools/memory.js +59 -53
  48. package/build/src/tools/network.js +5 -4
  49. package/build/src/tools/pages.js +48 -6
  50. package/build/src/tools/performance.js +7 -4
  51. package/build/src/tools/pwa.js +7 -0
  52. package/build/src/tools/screencast.js +3 -1
  53. package/build/src/tools/screenshot.js +23 -7
  54. package/build/src/tools/script.js +38 -6
  55. package/build/src/tools/slim/tools.js +21 -5
  56. package/build/src/tools/snapshot.js +13 -3
  57. package/build/src/tools/thirdPartyDeveloper.js +3 -1
  58. package/build/src/tools/webmcp.js +2 -0
  59. package/build/src/utils/TaskRunner.js +136 -0
  60. package/build/src/utils/WaitForHelper.js +1 -1
  61. package/build/src/utils/bytes.js +2 -12
  62. package/build/src/utils/check-for-updates.js +1 -1
  63. package/build/src/utils/disclaimers.js +27 -0
  64. package/build/src/utils/keyboard.js +14 -2
  65. package/build/src/utils/logger.js +69 -0
  66. package/build/src/utils/resourceType.js +27 -0
  67. package/build/src/utils/text.js +29 -0
  68. package/build/src/utils/timeout.js +14 -0
  69. package/build/src/utils/url.js +41 -0
  70. package/build/src/version.js +1 -1
  71. package/package.json +5 -4
  72. package/skills/a11y-debugging/SKILL.md +3 -8
@@ -3,8 +3,12 @@
3
3
  * Copyright 2026 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ // Node 22 has no global URLPattern. The CLI bundle exports Puppeteer's
7
+ // polyfill, so this module does not need the full third-party bundle.
8
+ import { URLPattern } from '../third_party/cli.js';
6
9
  const ALLOWED_PROTOCOLS = new Set(['http:', 'https:', 'ws:', 'wss:']);
7
10
  const IPV4_LOOPBACK_REGEX = /^127(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)){3}$/;
11
+ const IPV4_MAPPED_LOOPBACK_REGEX = /^\[::ffff:7f[0-9a-f]{2}:[0-9a-f]{1,4}\]$/;
8
12
  /**
9
13
  * Determines whether a given URL string points to a localhost / loopback address.
10
14
  *
@@ -38,8 +42,42 @@ export function isLocalhost(url) {
38
42
  if (IPV4_LOOPBACK_REGEX.test(hostname)) {
39
43
  return true;
40
44
  }
45
+ // 4. Check IPv4-mapped IPv6 loopback. URL serializes [::ffff:127.0.0.1]
46
+ // as [::ffff:7f00:1].
47
+ if (IPV4_MAPPED_LOOPBACK_REGEX.test(hostname)) {
48
+ return true;
49
+ }
41
50
  return false;
42
51
  }
52
+ // URL serializes `0`, `0x0` and `0.0` as 0.0.0.0, `[::0]` as [::], and
53
+ // [::ffff:0.0.0.0] as [::ffff:0:0].
54
+ const UNSPECIFIED_HOSTNAMES = new Set(['0.0.0.0', '[::]', '[::ffff:0:0]']);
55
+ /**
56
+ * Determines whether a browser endpoint URL points to the local machine.
57
+ *
58
+ * In addition to {@link isLocalhost}, this accepts the unspecified addresses
59
+ * 0.0.0.0 and [::]. A connection to an unspecified address reaches the local
60
+ * machine.
61
+ *
62
+ * @param url The browser endpoint URL (for example, a WebSocket endpoint).
63
+ * @returns true if the endpoint is on the local machine.
64
+ */
65
+ export function isLocalBrowserEndpoint(url) {
66
+ if (isLocalhost(url)) {
67
+ return true;
68
+ }
69
+ let parsed;
70
+ try {
71
+ parsed = new URL(url);
72
+ }
73
+ catch {
74
+ return false;
75
+ }
76
+ if (!ALLOWED_PROTOCOLS.has(parsed.protocol)) {
77
+ return false;
78
+ }
79
+ return UNSPECIFIED_HOSTNAMES.has(parsed.hostname);
80
+ }
43
81
  /**
44
82
  * Determines whether a URL is allowed for navigation and page tracking.
45
83
  *
@@ -201,6 +239,9 @@ export function validateUrl(url, options) {
201
239
  if (fileNavigations === false && targetsFileScheme(parsed)) {
202
240
  throw new Error(`Navigating to file: URLs is not allowed when --file-navigations is disabled.`);
203
241
  }
242
+ if (parsed.protocol === 'devtools:') {
243
+ throw new Error(`Navigating to devtools: URLs is not allowed.`);
244
+ }
204
245
  if (!isAllowedUrl(url, { categoryExtensions })) {
205
246
  if (parsed.protocol === 'chrome-extension:') {
206
247
  throw new Error(`Navigating to chrome-extension: URLs is not allowed without --categoryExtensions.`);
@@ -5,6 +5,6 @@
5
5
  */
6
6
  // If moved update release-please config
7
7
  // x-release-please-start-version
8
- export const VERSION = '1.11.0';
8
+ export const VERSION = '1.12.0';
9
9
  // x-release-please-end
10
10
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chrome-devtools-mcp",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "MCP server for Chrome DevTools",
5
5
  "type": "module",
6
6
  "bin": {
@@ -43,7 +43,8 @@
43
43
  "LICENSE",
44
44
  "skills",
45
45
  "!*.tsbuildinfo",
46
- "!*.js.map"
46
+ "!**/*.js.map",
47
+ "!**/*.d.ts"
47
48
  ],
48
49
  "repository": "ChromeDevTools/chrome-devtools-mcp",
49
50
  "author": "Google LLC",
@@ -82,8 +83,8 @@
82
83
  "globals": "^17.0.0",
83
84
  "lighthouse": "13.5.0",
84
85
  "prettier": "^3.6.2",
85
- "puppeteer": "25.14.0",
86
- "rollup": "4.64.2",
86
+ "puppeteer": "25.16.0",
87
+ "rollup": "4.64.7",
87
88
  "rollup-plugin-cleanup": "^3.2.1",
88
89
  "rollup-plugin-license": "^3.6.0",
89
90
  "semver": "^7.7.4",
@@ -21,8 +21,8 @@ Start by running a Lighthouse accessibility audit to get a comprehensive baselin
21
21
  - Set `mode` to `"navigation"` to refresh the page and capture load issues.
22
22
  - Omit `outputDirPath` to save reports to the default temporary directory (the exact path to `report.json` is returned under `Reports`), or set `outputDirPath` to a directory within the workspace.
23
23
  2. **Analyze the Summary**:
24
- - Check `scores` (0-1 scale). A score < 1 indicates violations.
25
- - Review `audits.failed` count.
24
+ - In the default text output, category scores use a 0-100 scale (100 is a perfect score), followed by `Passed: N` and `Failed: N` audit counts.
25
+ - If the server was started with `--experimentalStructuredContent`, inspect `summary.scores[].score` (0-1 scale) and `summary.audits.failed` in the structured content instead.
26
26
  3. **Review the Report (CRITICAL)**:
27
27
  - **Parsing**: Do not read the entire file line-by-line. Use a CLI tool like `jq` or a Node.js one-liner to filter for failures from the report path returned by `lighthouse_audit`:
28
28
  ```bash
@@ -73,12 +73,7 @@ _Pass the element's `uid` from the snapshot as an argument to `evaluate_script`.
73
73
 
74
74
  ### 7. Color Contrast
75
75
 
76
- To verify color contrast ratios, start by checking for native accessibility issues:
77
-
78
- 1. Call `list_console_messages` with `types: ["issue"]`.
79
- 2. Look for "Low Contrast" issues in the output.
80
-
81
- If native audits do not report issues (which may happen in some headless environments) or if you need to check a specific element manually, use `evaluate_script` with the **"Check Color Contrast" snippet** found in [references/a11y-snippets.md](references/a11y-snippets.md).
76
+ To verify color contrast ratios, use the **"Check Color Contrast" snippet** found in [references/a11y-snippets.md](references/a11y-snippets.md) with `evaluate_script`.
82
77
 
83
78
  ### 8. Global Page Checks
84
79