文件历史

提交图

51 次代码提交

作者 SHA1 备注 提交日期
Nikolay Vitkov b2b05a0670 chore(memory): expose retainer logic (#2056)
Allows the LLM to query the heapsnapshot further to understand what the
retainer path logic.
2026-05-18 09:54:00 +00:00
Nikolay Vitkov 66dacb83fd chore(memory): sort all by retainer size (#1963)
This is a better measurement as if object self size is X and the
retainerSize Y. X will always be smaller then Y, there Y will be the
actual size on the Heap.
2026-04-28 14:32:04 +00:00
Alex Rudenko 80bee1e6cd fix: note about missing elements should not show in verbose mode (#1950)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1947
2026-04-24 07:29:05 +00:00
@masamaru0513 dbddb2e4ef feat: group identical consecutive console messages in list_console_messages (#1939)
## Summary

Group consecutive identical console messages in `list_console_messages`,
similar to Chrome DevTools' console grouping behavior.

Fixes #904

## Changes

- Introduce `GroupedConsoleFormatter` subclass that extends
`ConsoleFormatter` and overrides `toString()` / `toJSON()` for
count-aware formatting
- Add `ConsoleFormatter.groupConsecutive()` static method that groups
consecutive messages with the same type, text, and argument count
- Apply grouping **before pagination** so grouped counts are accurate
and page sizes reflect the collapsed view
- Add unit tests for grouping logic, string formatting, and JSON output

## Key design decisions

- **`GroupedConsoleFormatter` subclass**: Keeps the existing formatter
interface clean — no new methods added to `ConsoleFormatter`.
`ConsoleFormatter` and `GroupedConsoleFormatter` are interchangeable via
the same interface.
- **Grouping before pagination** (not at format time): This was the
feedback on #963 and #1025 — grouping at format time breaks pagination
counts. This implementation groups in `McpResponse` before calling
`paginate()`.
- **No `lastId`**: Since grouped messages are truly identical, only the
first message's ID is needed.
- **`argCount` matching**: Prevents false grouping of messages with the
same text but different argument counts.

## Output example

```
msgid=1 [log] hello world (1 args) [5 times]
```

## Testing

- Unit tests in `tests/formatters/ConsoleFormatterGrouping.test.ts`
- Manual verification: identical messages (×5), mixed pattern (A,A,B,A,A
→ A×2, B×1, A×2)
2026-04-23 09:55:18 +00:00
Wolfgang Beyer e046c23563 chore: in-page tool output: stash DOM elements and preprocess for serialization (#1877)
Improvements for handling in-page tool responses. In order to
successfully pass an in-page tool response from the page context to the
MCP server, the response needs to be serializable. The code walks the
response object an performs the following changes:

- DOM elements are stashed onto the window object and replaced with an
ID. On the MCP server side this ID is used to map back to the
corresponding UID in the page snapshot generated from the accessibility
tree.
- Circular references are replaced with a string.
- Class instances (which can be complex or non-serializable) are
replaced with a string.
- Functions are replaced with a string.

If the in-page tool response contains DOM elements which are not part of
the page snapshot, a new snapshot is created add the missing elements
are added explicitly.
2026-04-22 14:51:09 +00:00
Nikolay Vitkov 9211c6b52d chore(memory): expose a tool for getting the inital data. (#1909)
This refactors the code to extract the Id logic from the PageCollector
and provide it in the heapsnapshot.
We need to use an UID as we need the internal ClassKey to query the
heapsnapshot, but that is a strange string (usually looking like
`,ClassName`) which may get the LLM confused as we use comma separated
output.
2026-04-20 18:39:48 +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
Nikolay Vitkov 2f458c11eb fix(network): trailing data in Network redirect chain (#1880)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/pull/1808
2026-04-17 12:19:46 +00:00
Alex Rudenko 5c398c4e7c feat: support DevTools header redactions as an option (#1848)
This PR adds a CLI flag to enable redacting network headers in the same
way they are redacted in DevTools. Note that sometimes it might prevent
the agent from properly analysing network issues. Pass
`--redact-headers=false` to revert to the previous behavior.
2026-04-14 13:21:11 +00:00
Nikolay Vitkov e56d79393c chore: don't re-export internals (#1211) 2026-03-20 13:15:06 +00:00
Alex Rudenko 9ef4479bec refactor: types for JSON output of IssueFormatter (#1007)
- makes the id required in types
- requires toString(), toStringDetailed() to use the JSON
representation.
2026-02-23 08:03:09 +00:00
Alex Rudenko 0d78685a5b refactor: cleanup string and structured console formatters (#1005)
- typed JSON objects for structured output
- same source is used for text formatting
2026-02-20 11:43:35 +00:00
Alex Rudenko c9691c6250 test: fix missing sinon.restore (#989) 2026-02-18 15:39:30 +00:00
Nikolay Vitkov 327a3884d8 refactor: remove text from the status code for Network requests (#778)
LLM are trained to know the common status code so we can rely on that
when displaying the status code and fall back to text in case of errors
or pending reponse.
2026-02-18 14:23:26 +00:00
Alex Rudenko d59bca4ddf test: add tests for more a11y attributes (#934)
I think this covers all a11y attributes from CDP + we have now verbose
vs non-verbose mode.

Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/363
2026-02-11 09:03:10 +00:00
Simon Zünd 8e2380b434 fix: console formatter hides frames from ignored scripts (#927)
This PR wires up the default DevTools ignore listing to hide frames from
third party scripts in stack traces. By default, we ignore:

* Scripts with `/node_modules/` in their URL or where the URL starts
with `node:/`
* Scripts that are marked as ignore listed in the source map
* Content scripts from extensions

The PR adds both, unit tests and an e2e test. This is because we allow
the unit test to pass a mocked ignore checker, where-as the e2e uses the
real DevTools one.
2026-02-10 07:24:09 +00:00
Simon Zünd caea23a7cf fix: limit stack traces to 50 lines (#923)
This PR refactors the stack trace formatting logic a bit: We split the
`formatStackTrace` function into 2: One for the top-level stack trace
and the rest for the recursive ones. We also return lines separately so
we can slice the result later.
2026-02-09 12:06:04 +00:00
Simon Zünd 9b90564888 chore: implement formatting for Error.cause messages (#905)
A follow-up PR will add actual `cause` property resolving of remote
`Error` objects.
2026-02-06 11:28:40 +00:00
Simon Zünd ffa00dab1b feat: show message and stack trace in details when console.log'ging Error objects (#902)
This PR improves the `get_console_message` tool when logging `Error`
objects. We use the existing `getExceptionDetails` CDP command to
retrieve the structured stack trace, we'll then source map.

Example:

```js
try {
  compute();
} catch (e) {
  console.log('Compute failed', e);
}
```

Before:
```txt
### Arguments
Arg #0: Compute failed
Arg #1: {}
```

After:
```txt
### Arguments
Arg #0: Compute failed
Arg #1: ComputeError: Invariant violation
at compute (foo.ts:1:20)
at <anonymous> (main.ts:2:8)
Note: line and column numbers use 1-based indexing
```

---------

Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
2026-02-06 09:38:27 +00:00
Simon Zünd 1fad330bad chore: implement formatting of Error console.log arguments (#901)
This PR implements formatting for `SymbolizedError` objects that are
part of "resolved arguments". A follow-up PR will handle the actual
conversion of `Error` remote objects to `SymbolizedError`s.
2026-02-06 08:25:38 +00:00
Simon Zünd f4cfd4664e chore: introduce SymbolizedError class (#890)
The "SymbolizedError" class represents a fully resolved error: The stack
trace is fully resolved and (in the future), the full `Error.cause`
chain is also fully resolved.

We'll use the `SymbolizedError` for both "uncaught exceptions" as well
as when logging `Error` objects to the console (e.g. `console.log(new
Error())`. This means the `resolvedArgs` array in `ConsoleFormatter`
will contain one `SymbolizedError` instance for every `Error` object
logged.
2026-02-05 07:57:21 +00:00
Simon Zünd 7e1ec81fb6 fix: use 1-based line/column and fix wasm offsets in stack frames (#884)
`UILocation.linkText` does the right thing when formatting a location,
e.g. a wasm location will be formatted as `foo.wasm:0x95`.
2026-02-04 08:15:27 +00:00
Simon Zünd a08f550b28 chore: implement formatting for UncaughtError (#875) 2026-02-03 11:42:18 +00:00
Alex Rudenko 695817f6d6 fix: make request and response handling more robust (#846)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/842
2026-01-27 12:35:47 +00:00
Alex Rudenko dc43ede1f2 fix: improve error handling for console messages (#844)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/838
2026-01-27 12:27:10 +00:00
Alex Rudenko b0d041a0b2 chore: structured content for console (#804) 2026-01-22 06:53:03 +00:00
Alex Rudenko feee900a4c chore: create a console formatter class (#802)
This cleans up the McpResponse and helps with returning the structured
content.
2026-01-21 10:04:20 +00:00
Alex Rudenko c29d097b92 chore: extract issue formatter in preparation to structured content (#794)
This makes it easier to add JSON-format as the output for issues.
Console formatter will be changed next.
2026-01-20 07:03:30 +00:00
Alex Rudenko 6d0e4cab28 feat: support filePath for network request and response bodies (#795)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/377
2026-01-19 12:44:59 +00:00
Alex Rudenko 755eeef3af chore: support structured network (#774)
This PR adds a structured variant of the network responses and refactors
the code accordingly.
2026-01-15 11:59:00 +00:00
Alex Rudenko 3fcca026cb chore: support structured content (#744)
The idea is to turn formatters into instances and support both text and
JSON formatting. The structured content is output if the experimental
structured content flag is passed. For now, only the snapshots are
returned in a structured way.

Refs https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/689
2026-01-12 13:53:12 +00:00
Simon Zünd b48e10b69c chore: implement stack trace formatting for console messages (#738)
The PR only implements the formatting, we don't create
`DevTools.StackTrace` instances from puppeteer console message stack
traces yet.
2026-01-08 10:27:28 +01:00
Alex Rudenko 7114bb1bf3 chore: integrate issues and fix up checks (#628) 2025-11-28 09:16:32 +00:00
Natasha Gorshunova 63b826cfe0 chore: report issues in details in get_console_mesasge (#611)
Co-authored-by: Natallia Harshunova <nharshunova@chromium.org>
2025-11-27 08:08:47 +01:00
Natasha Gorshunova 326c279179 chore: report console issues in get_console_messages (#594)
Co-authored-by: Natallia Harshunova <nharshunova@chromium.org>
2025-11-25 11:41:14 +01:00
Alex Rudenko 80e77fd9a3 fix: include a note about selected elements missing from the snapshot (#593)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/586
2025-11-21 11:14:44 +01:00
Alex Rudenko 4a83574961 feat: fetch DOM node selected in the DevTools Elements panel (#486)
Refs https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/129
2025-10-31 11:07:10 +01:00
Alex Rudenko 2f448e84ea fix: improve get_network_request description (#500)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/497
2025-10-30 11:52:09 +01:00
Alex Rudenko 796aed72b7 feat: detect network requests inspected in DevTools UI (#477)
If you manually inspect a network request in the DevTools UI, the Chrome
DevTools MCP server is now able to detect it and allow you to refer to
the selected request. The approach was tested in a couple of models.

In the list of the network requests we have a short indication about
which request is selected in DevTools UI. We refer to the DevTools as
"DevTools UI" to disambiguate from the DevTools MCP server.
2025-10-28 10:52:09 +01:00
Alex Rudenko 7d47d6b2f4 fix: indicate when request and response bodies are not available (#446) 2025-10-21 12:16:28 +00:00
Alex Rudenko 5c871c3bd9 refactor: cleanup data fetching (#441)
Drive-by: fixed extra newline
2025-10-20 13:05:05 +00:00
Alex Rudenko 962ac88445 chore: improve console message format (#440)
I checked Puppeteer implementation and it computes the text based on all
args so we should treat the first arg in a special way. Also, changes
the format to print count of args in the list and full args in the
details only.
2025-10-20 14:49:09 +02:00
Alina Varkki 92055933dc feat: tool to get a verbose single console message (#435) 2025-10-20 11:18:41 +02:00
Alina Varkki 15d942c4f3 feat: add filters and pagination to the console messages tool (#387)
In the next pr, we will add ids to messages and another tool to get more
details by id
2025-10-15 18:22:15 +02:00
Nikolay Vitkov 78bf66a7b1 refactor: use different format for reqid (#380) 2025-10-14 12:23:19 +00:00
Nikolay Vitkov f4d7b49bb1 feat: support stable id for network requests (#375)
This is part 1, we just expose the uid here, in a follow up PR we will
be used for finding the request.
2025-10-14 12:45:16 +02:00
Alex Rudenko 2082641cc7 refactor: simplify snapshot generation (#369)
the only difference is that checked/pressed are only included if the
element was checked/pressed.

Refs: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/363
2025-10-13 13:51:49 +00:00
Nicholas Roscino dd3c14336e feat: add request and response body (#267)
This PR adds the request and response bodies into the context if they
are available and in a readable format.

---------

Co-authored-by: Nicholas Roscino <nroscino@chromium.org>
Co-authored-by: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com>
2025-10-08 11:22:10 +02:00
Nikolay Vitkov 15277541d8 chore: add additional EsLint rule (#147) 2025-09-25 17:20:01 +02:00
Alex Rudenko 014a8bc52e feat: validate uids (#37)
- generate snapshot IDs.
- change uid to be a string.
- validate that uid is not coming from a stale snapshot.
2025-09-16 11:54:35 +00:00