文件历史

提交图

334 次代码提交

作者 SHA1 备注 提交日期
Nikolay Vitkov 15277541d8 chore: add additional EsLint rule (#147) 2025-09-25 17:20:01 +02:00
Oz Tamir 4c909bb8d7 feat: Add pagination list_network_requests (#145)
## Summary

This PR enhances the `list_network_requests` tool with pagination
support to handle large numbers of network requests efficiently. See
[this
issue](https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/136).

## Motivation

In my experience, the `list_network_requests` tool frequently hits LLM
token limits on pages with many requests, making it unusable for modern
web applications. I wanted to add pagination to allow agents to be more
flexible and manage token limits on their own.

## Changes

### Pagination Support
- Added `pageSize` parameter to limit requests per call
- Added `pageToken` parameter for navigation between pages
- Added pagination metadata in responses (nextPageToken,
previousPageToken, startIndex, endIndex, total)

### Implementation Details
- **New utility**: `src/utils/pagination.ts` - generic pagination
function
- **Enhanced McpResponse**: Added pagination options to
`setIncludeNetworkRequests()`
- **Updated network tool**: Added pagination parameters to schema
- **Offset-based pagination**: Uses numeric tokens, handles invalid
tokens gracefully

## Testing
- Comprehensive test coverage for pagination scenarios
- Tests for first page, subsequent pages, invalid tokens, and edge cases
- All existing tests continue to pass

## Backward Compatibility
- If no pagination parameters are provided, the MCP will return all
requests (same as before)
2025-09-25 16:26:43 +02:00
Alex Rudenko 44cfc8f945 fix: avoid reporting page close errors as errors (#127)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/125
2025-09-25 10:40:51 +00:00
Alex Rudenko 0cc907a9ad fix: clarify the node version message (#135) 2025-09-25 08:39:19 +02:00
Alex Rudenko adfcecf987 fix: validate and report incompatible Node versions (#113)
Ref https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/92
2025-09-24 14:45:27 +02:00
Alex Rudenko 0ca2434a29 fix: forbid closing the last page (#90)
McpContext currently assumes that there is a page. Eventually we might
support closing the browser by closing the last page but right now we do
not really have responses that indicate that the browser was closed. So
this PR helps the LLM understand that it is okay to keep the last page
running (and there are platform-specific differences as to what happens
if the last page is closed).

Ref https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/87
2025-09-24 07:23:53 +00:00
Alex Rudenko 1a4ba4d3e0 fix: add a message indicating that no console messages exist (#91)
To avoid clients being confused about the lack of console messages.

Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/87
2025-09-23 22:10:46 +02:00
Nikolay Vitkov 4e7001ac37 fix: clean up pending promises on action errors (#84) 2025-09-23 18:33:50 +00:00
Alex Rudenko 924c042492 fix: remove unnecessary waiting for navigation (#83) 2025-09-23 18:23:53 +00:00
Jack Franklin e8fb30c1bf fix: rework performance parsing & error handling (#75)
This PR tidies up the code around performance parsing and what we
respond with from our tools. It introduces the ability to have no
Insights from a trace (relatively rare, but can happen), and also adds
more information to the output in the event that something went wrong.

Previously we just logged errors, but if we respond with them here that
will also help users report issues and increase the chances that we can
debug them.
2025-09-23 15:42:35 +02:00
Alex Rudenko d6bab912df fix: cli version being reported as unknown (#74) 2025-09-23 13:33:18 +00:00
Nikolay Vitkov 0208bfdcf6 fix: expose timeout when Emulation is enabled (#73)
Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
2025-09-23 11:17:53 +02:00
Nikolay Vitkov c509c64576 fix: increase timeouts in case of Emulation (#71) 2025-09-22 18:13:49 +02:00
Jack Franklin b877f7a305 fix: add 'on the selected page' to performance tools (#69)
To hopefully ensure the client makes sure to navigate to and select a
page before starting the trace.

Bug: 446171427
2025-09-22 17:03:26 +02:00
Alex Rudenko d5457412a4 fix(windows): work around Chrome not reporting reasons for crash (#64) 2025-09-22 16:40:56 +02:00
Alex Rudenko 93923d9311 chore: add browser logs to the log file (#66) 2025-09-22 16:36:40 +02:00
Nikolay Vitkov 1e8662f068 fix(emulation): correctly report info for selected page (#63)
Previously if one page was setting emulation all were reporting it.
2025-09-22 16:03:47 +02:00
Nikolay Vitkov 699258accf refactor: move WaitForHelper to class and use it from inside context (#62)
This does not change any behavior but only refactors the code so the
following changes are easier to seem
2025-09-22 15:29:30 +02:00
Sebastian Benz a6923b8d93 fix: fix browserUrl not working (#53)
Setting the default channel in the CLI resulted in our mutually
exclusive check for browserUrl and channel to fail.
2025-09-19 12:24:05 +02:00
Alex Rudenko 93f4579dd9 fix: refresh context based on the browser instance (#44) 2025-09-17 14:38:13 +02:00
Jack Franklin 21e175b862 feat: add performance_analyze_insight tool. (#42) 2025-09-17 12:25:40 +00:00
Jack Franklin 0cb6147b87 feat: use Performance Trace Formatter in trace output (#36)
Note: this will error until a chrome-devtools-frontend with this change

https://chromiumdash.appspot.com/commit/62e1652b2bf044ec53a2ec212cf53b1a62bc357e
is released on npm.
2025-09-16 17:07:58 +00:00
Alex Rudenko c663f4d7f9 feat: support script evaluate arguments (#40)
This change allows clients to pass snapshot elements as arguments.
2025-09-16 17:44:53 +02:00
Alex Rudenko 36115d757a fix: change profile folder name to browser-profile (#39) 2025-09-16 14:49:05 +00: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
Alex Rudenko 3fcea791eb chore: roll puppeteer (#25)
This should solve flakiness related to multiple browser instances.
2025-09-15 16:12:13 +02:00
Alex Rudenko dd3bf338cb chore: fix a type and remove obsolete comment (#23) 2025-09-15 13:55:51 +00:00
Alex Rudenko c93945657c fix: define tracing categories (#21)
Drive-by: we do not need to download latest anymore.
Drive-by: report success if no insights were found (examples:
example.com)
2025-09-15 15:04:44 +02:00
Alex Rudenko a76b23dccf fix: make sure tool calls are processed sequentially (#22) 2025-09-15 12:58:27 +00:00
Sebastian Benz 8ba8460b98 docs: polish readme (#2)
* add configuration section
* move user-data-dir to new concepts section
2025-09-12 12:30:30 +02:00
Alex Rudenko 732267db5f fix: detect multiple instances and throw (#12)
We should be checking for browser logs in Puppeteer instead.
2025-09-11 16:42:27 +02:00
Nikolay Vitkov dba8b3c5fa feat: improve tools with awaiting common events (#10) 2025-09-11 12:21:05 +00:00
Alex Rudenko d89d593e22 chore: re-wrap cli (#4) 2025-09-11 13:30:26 +02:00
Alex Rudenko 31a0bdce26 feat: initial version 2025-09-11 12:46:05 +02:00