文件历史

提交图

14 次代码提交

作者 SHA1 备注 提交日期
Piotr Paulski 515f8afb58 chore: report exact bundled package versions during release (#2318)
At bundle time, we know exactly which version of the package is
installed, we should report exact version instead of a range from
package.json.

This change parses package-lock.json to obtain this information.

This approach aligns better with upstream security analyzers relying on
dependency version information.

Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
2026-07-10 09:29:05 +00:00
Dayna Blackwell 3d2138945c feat: add experimentalGcfFormat flag for GCF-encoded tool responses (#2235)
## Summary

Add `--experimentalGcfFormat` as a hidden experimental flag alongside
the existing `--experimentalToonFormat`. When enabled, tool responses
encode structured data using GCF (Graph Compact Format) instead of
formatted JSON. No changes to existing behavior or default output.

## Why

### Benchmarked on Chrome DevTools data shapes

Data shapes verified from source code and test snapshots
(`ConsoleMessageConcise`, `NetworkRequestConcise`,
`HeapSnapshotFormatter.toJSON()`, `SnapshotFormatter.toJSON()`):

| Dataset | JSON | TOON | GCF | TOON vs JSON | GCF vs JSON | GCF vs TOON
|

|---------|------|------|-----|-------------|-------------|-------------|
| Console (100) | 2,534 | 1,716 | 1,663 | 32.3% | 34.4% | +3.1% |
| Console (500) | 12,879 | 8,761 | 8,475 | 32.0% | 34.2% | +3.3% |
| Network (100) | 3,287 | 1,776 | 1,682 | 46.0% | 48.8% | +5.3% |
| Network (500) | 16,547 | 8,936 | 8,442 | 46.0% | 49.0% | +5.5% |
| Heap (100) | 2,210 | 797 | 753 | 63.9% | 65.9% | +5.5% |
| DOM (3x3) | 282 | 295 | 244 | -4.6% | 13.5% | +17.3% |
| DOM (4x3) | 396 | 464 | 407 | -17.2% | -2.8% | +12.3% |

TOON increases token count on DOM snapshots (-4.6% to -17.2% vs JSON).
GCF saves tokens on every data type.

### Console message corruption

TOON's decoder crashes on console messages containing bracket-colon
patterns, which are standard browser output:

```
[Error]: net::ERR_CONNECTION_REFUSED
[React DevTools]: Component rendered 3 times
[Violation]: Forced reflow while executing JavaScript took 42ms
[Performance]: Long task detected (duration: 234ms)
```

10 of 20 console messages fail TOON round-trip. GCF: zero failures.
While Chrome DevTools MCP encodes only (no decode), the structurally
ambiguous output can affect downstream consumers.

### LLM comprehension

GCF scores 100% on general structured data and 90.7% on adversarial
payloads across GPT-4o, GPT-5.5, Claude, and Gemini. JSON scores 53.6%.
TOON scores 68.5%. (1,700+ evaluations.)

Full eval data: [GCF benchmarks](https://gcformat.com/guide/benchmarks)

### Data integrity

GCF verified lossless across 43 billion+ round-trips in 5 formats and 6
languages. Zero failures. Zero runtime dependencies.

## Implementation

Mirrors the existing `experimentalToonFormat` pattern exactly:

- Hidden boolean CLI flag, defaults to false
- `useGcf` parameter threaded through `handle()` → `format()`
- `compactEncode` helper selects GCF, TOON, or null (formatted JSON)
- GCF takes precedence if both flags are set

## Changes

| File | Change |
|------|--------|
| `src/bin/chrome-devtools-mcp-cli-options.ts` | Add
`experimentalGcfFormat` flag |
| `src/third_party/index.ts` | Export `gcfEncode` from
`@blackwell-systems/gcf` |
| `src/McpResponse.ts` | Add `useGcf` parameter, `compactEncode` helper
|
| `src/ToolHandler.ts` | Pass `experimentalGcfFormat` to `handle()` |
| `package.json` | Add `@blackwell-systems/gcf` (pinned 2.1.2, zero
deps) |

## Links

- GCF spec: https://gcformat.com
- TypeScript SDK: https://www.npmjs.com/package/@blackwell-systems/gcf
- Benchmarks: https://gcformat.com/guide/benchmarks
- Lossless verification:
https://gcformat.com/guide/lossless-verification

---------

Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
2026-07-06 09:45:01 +00:00
Piotr Paulski e5bd334c97 chore: make TOON dependency optional (#2260)
Since toon dependency is only needed for `--experimentalToonFormat`
flag, we can make it optional to decrease package size and security
footprint for users that don't use it.

Testing npx optional peer dependency resolution before the release:
```
npm i -g verdaccio
verdaccio
```
On a separate terminal:
```
npm adduser --registry http://localhost:4873/
# follow prompts to create user and login

# replace the published package in verdaccio
npm unpublish chrome-devtools-mcp@1.4.0 --force --registry http://localhost:4873
npm publish --registry http://localhost:4873

# clear npx cache
rm -rf ~/.npm/_npx

# run the server from commandline and observe both packages being installed:
npx --registry http://localhost:4873 --package chrome-devtools-mcp@latest --package @toon-format/toon chrome-devtools-mcp --experimentalToonFormat
```
Paste the following commands (each line separately) to manually interact
with the mcp server and observe TOON formatted response directly

### 1. Initialize the session


{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test-client","version":"1.0.0"}}}
    
  ### 2. Confirm initialization
    {"jsonrpc":"2.0","method":"notifications/initialized"}
    
### 3. Navigate to Google (this will already create snapshot in most
recent versions)


{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"navigate_page","arguments":{"url":"https://google.com"}}}
    
  ### 4. Take Snapshot (if not returned by the previous command)


{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"take_snapshot","arguments":{}}}

---------

Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
2026-06-26 08:11:31 +00:00
Nikolay Vitkov 0331f6a8a2 chore: implement memory snapshot information (#1874)
WIP of exposing a tool for debugging memory issue directly with the MCP
2026-04-17 12:40:41 +00:00
Alex Rudenko dfdac2648e feat: integrate Lighthouse audits (#831)
This PR adds tool to perform navigation and snapshot audits using
Lighthouse for Accessibility, SEO and Best practices. For performance
audits existing tools can be used.

Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/473
2026-02-26 12:30:45 +00:00
zyzyzyryxy 3e816aed12 chore: list bundled packages before publication (#861)
List bundled packages and their versions for automated vulnerability
reporting.

---------

Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
2026-01-29 16:51:00 +00:00
Alex Rudenko 85d008ac3a chore: merge licenses for all dependencies in one file (#849) 2026-01-27 18:37:31 +00:00
Simon Zünd 7ba63a8777 chore(build): add devtools-formatter-worker.ts bundle (#792)
The `devtools-formatter-worker` is a separate entrypoint from the MCP
entrypoint. It is identical to the upstream
`front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.js`
and a required part to make source mapping, formatting and other
AST-based DevTools features work.

The implementation consists of 3 parts:
1) A trivial `devtools-formatter-worker.ts` file that imports the
DevTools entrypoint.
2) A new bundle output, bundling everything that needs to run in the
worker.
3) A call that initializes the `FormatterWorkerPool` with the custom
entrypoint. Otherwise we'd use the unbundled entrypoint from
`chrome-devtools-frontend` not available to us at runtime.

Note that we could improve code splitting in the future as some things
like `core/common` are now bundled twice.

---------

Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
2026-01-19 09:18:08 +00:00
zyzyzyryxy f028f8c075 chore: Update eslint rule to require empty line after license notice. (#784)
We should make sure there is always an empty line after license notice,
otherwise it gets dropped during build if it happens to be before import
statement.

---------

Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
2026-01-16 16:35:45 +00:00
Alex Rudenko 94b899c205 build: bundle devtools frontend (#656) 2025-12-11 11:51:04 +01:00
zyzyzyryxy 914b980113 refactor: bundle all dependencies together (#450)
Final bundling step for improved startup times.

---------

Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
2025-10-21 17:44:31 +00:00
zyzyzyryxy b443033000 refactor: bundle puppeteer-core (#417)
Continue speeding up boot time.

---------

Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
2025-10-21 09:31:06 +00:00
Nikolay Vitkov 2ffe56a1a5 chore: clean up rollup config (#416)
Source maps were not provided for local builds.
And a left out debug
2025-10-17 15:46:03 +00:00
zyzyzyryxy 6c8432b6b6 refactor: bundle modelcontextprotocol-sdk (#409)
Improve installation time.

---------

Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
2025-10-17 13:13:15 +00:00