文件历史

117 次代码提交

作者 SHA1 备注 提交日期
Alex Rudenko e51ba47203 fix: simplify emulation and script tools (#1073)
- reduces the token usage.
- makes emulation and script compatible with CLI.
- documents .nullable() and .object() restrictions for the future.
- the emulation tools do not have nullable anymore and undefined would
clear the emulation instead. The model is thus required to provide all
emulation settings at once.

Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/918
2026-03-02 13:31:55 +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
Alex Rudenko d0622d52d4 fix: remove endsWith for filePath in memory tools (#1041)
Looks like there is another incompatibility in JSON schema handling
between MCP clients.

Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1039
2026-02-25 15:27:58 +01:00
Nicholas Roscino 1a4eaba95b chore: list service workers (#1035)
This PR adds the extension service workers to the output of listPages.
This is available only behind "--category-extensions" flag
2026-02-25 13:49:37 +00:00
Alex Rudenko ca6635d5a5 refactor: optimize slim tool descriptions and params (#1028)
Minor changes to shorten descriptions and improve ease of use.

Note that `--slim` mode is not released yet and this is an improvement
for it.
2026-02-24 13:28:04 +00:00
Alex Rudenko b5d01b5fe6 feat: support type_text (#1026)
`type_text` is useful for pages that do not have a11y and, thus, uid is
not known. It's also useful for testing user-like keyboard input and
testing the focus state changes. The `fill` tools force the focus change
and require an uid and therefore are not suitable for these tasks.
2026-02-24 09:05:24 +00:00
Ashutosh Kumar 496ab1b45f feat: support any-match text arrays in wait_for (#1011)
## Summary

Enhances wait_for to support waiting on multiple possible texts and
resolve when any one appears.

This addresses long-running flows that can end in different UI outcomes
(for example, "Complete" or "Error"), avoiding unnecessary 300s waits
when only one expected string is provided.

Closes #916.

## Tool Update

### wait_for

Waits for text on the selected page, now with any-match support.

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| text | string \| string[] | yes | A single text or a non-empty list of
texts. Resolves when any value appears. |
| timeout | integer | no | Maximum wait in ms (0 keeps default
behavior). |

---

## Design / Implementation

- Kept backward compatibility: existing single-string text calls
continue to work unchanged.
- Added schema support for string | string[] with non-empty array
validation.
- Updated context API to accept string | string[].
- Matching logic now normalizes to an array and races all candidates
across all frames using both:
    - aria/<text>
    - text/<text>
- Added clearer response output for array input:
    - Element matching one of ["Complete","Error"] found.
- Updated generated tool docs for the new wait_for contract.
- Improved docs generation to render ZodUnion types (so union params are
documented correctly, not as unknown).
  
---

## Tests

Added/updated coverage for:

- Schema acceptance of:
    - single string
    - non-empty string array
    - rejection of empty array
- Any-match array success case
- Any-match array when matching text appears later (async/delayed
content)
- Existing wait_for behavior remains covered for single-text usage

Executed relevant test suites:

- tests/tools/snapshot.test.ts
- tests/McpContext.test.ts
- tests/index.test.ts 

Confirmation after the change applied:
https://opncd.ai/share/8m6I4r4a
2026-02-24 07:16:47 +00:00
Alex Rudenko 7ffdc5ee4d feat: add take_memory_snapshot tool (#1023)
Refs: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/406
2026-02-23 18:12:29 +00:00
Alex Rudenko c402b43697 feat: --slim mode for maximum token savings (#958)
- navigate
- run js
- take screenshot

That's it. Basic functionality for a low (~368) token price.
2026-02-23 14:42:27 +00:00
RobertWsp 59f6477a70 feat: add storage-isolated browser contexts (#991)
## Summary

Adds storage-isolated browser contexts via an optional `isolatedContext`
parameter on the `new_page` tool, following the simplified design
proposed by @OrKoN in #926.

Pages created with the same `isolatedContext` name share cookies,
localStorage, and storage. Pages in different isolated contexts (or the
default context) are fully isolated — ideal for testing multi-user
real-time features like chat, notifications, or collaborative editing.

## Changes

### `new_page` tool
- New optional `isolatedContext: string` parameter
- If specified, creates/reuses a named `BrowserContext` and opens a page
in it
- If omitted, uses the default browser context (existing behavior
unchanged)

### `McpContext`
- `#isolatedContexts` Map: LLM-provided names → Puppeteer
`BrowserContext` instances
- `#pageToIsolatedContextName` WeakMap: GC-safe page → context name
reverse lookup
- Auto-discovery: externally created browser contexts get
`isolated-context-1`, `isolated-context-2`, etc.
- `getIsolatedContextName(page)`: returns the isolated context name for
a page (used by response formatting)
- `page.browserContext()` used for context membership detection (no
custom target event forwarding needed)
- No context cleanup in `dispose()` or `closePage()` — either the entire
browser is closed or we disconnect without destroying state

### `McpResponse`
- Page list includes `isolatedContext=${name}` labels (both text and
structured JSON output)

### `ToolDefinition`
- `Context` interface extended with `getIsolatedContextName(page)`
method

## What's NOT included (by design)
- **No `TargetEventEmitter`**: Puppeteer forwards target events from
`BrowserContext` → `Browser` internally
- **No context cleanup**: Browser contexts are not closed on `dispose()`
or page close, per maintainer guidance
- **No `about:blank` cleanup**: Default context and isolated contexts
coexist side-by-side

## Example

```
> new_page url="https://app.example.com/chat" isolatedContext="userA"
> new_page url="https://app.example.com/chat" isolatedContext="userB"
> list_pages

Page 1: [app.example.com/chat] isolatedContext=userA
Page 2: [app.example.com/chat] isolatedContext=userB [selected]
```

Pages in different isolated contexts have fully independent cookies,
localStorage, IndexedDB, and WebSocket connections.

## Tests

- 6 new tests covering `isolatedContext` feature in
`tests/tools/pages.test.ts`
- All existing tests pass (333+)
- Zero type errors, lint clean

Closes #926

---------

Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2026-02-23 11:36:16 +00:00
Alex Rudenko fd0a9193b3 docs: estimate tokens using tiktoken (#959) 2026-02-16 08:22:50 +00:00
Michael Hablich 8d765c0aef docs: Add 'Progressive Complexity' and 'Reference over Value' design principles. (#939) 2026-02-13 15:57:53 +00:00
Alex Rudenko 107c46a4db docs: Update README with WSL configuration details (#946)
Added workarounds for using chrome-devtools-mcp in WSL.

Drive-by: moved known issues from readme to troubleshooting.
Drive-by: updated skill to link to troubleshooting.
Drive-by: rephrased for clarity.
2026-02-13 08:28:01 +00:00
Daniel Kastl 3c9528b43d docs: add macOS Web Bluetooth troubleshooting note (#930)
Docs-only change: add a troubleshooting note for macOS Web Bluetooth
chooser crashes in MCP-launched Chrome and the Bluetooth permission
workaround.

Fixes #917
2026-02-10 08:04:15 +00:00
kajanl 24db9dd78c fix: update evaluateScript description formatting (#880)
Fix formatting in the description of evaluateScript.

---------

Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2026-02-04 09:51:10 +00:00
Alex Rudenko 5a23a8c201 feat: support testing light and dark mode (#858)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/130
2026-01-28 13:57:54 +00:00
Gustav Ernberg von Heijne d845ad4858 feat: Add ability to inject script to run on page load (#568)
Adds a parameter "initScript" to be used to inject a script into the
page load before other scripts execute.

[Page.evaluateOnNewDocument](https://pptr.dev/api/puppeteer.page.evaluateonnewdocument)

See #567

---------

Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2026-01-28 12:29:33 +00:00
adam jones d7568881ba feat: add background parameter to new_page tool (#837)
## Summary

- Add `background` boolean parameter to the `new_page` tool
- When set to `true`, the new page opens in the background without
bringing it to the front
- Uses Puppeteer's existing `background` option for `browser.newPage()`

Fixes #826

---------

Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2026-01-26 16:06:59 +00:00
Alex Rudenko 4b8e9f2875 feat: allow skipping snapshot generation for input tools (#821)
Input tools have snapshots not re-generated by default now with an
option to opt-in to get a snapshot.

Refs: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/726
2026-01-23 13:43:00 +00:00
Alex Rudenko a8169676f9 feat: support device viewport and user agent emulation (#798)
This PR adds two emulation attributes `viewport` and `userAgent` that
allow emulating a mobile or a different desktop device.

Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/pull/272
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/619
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/410
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/280
(the recommended way is to emulate via the MCP server instead of a
parallel DevTools session)
2026-01-20 14:07:57 +00:00
Alex Rudenko aa9a176956 fix: improve performance tool description (#800)
Drive-by: refactor and improve eval scripts.
2026-01-20 11:38:51 +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 9b21f8b2e9 fix: handle beforeunload dialogs in navigations (#788)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/713
2026-01-19 10:04:45 +00:00
Alex Rudenko 68ae2f8253 feat: support filePath in performance tools (#686)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/680
2026-01-13 11:22:14 +00:00
Alex Rudenko a23c6ba8c9 refactor: change pageIdx to page ids (#741)
This allows for order-independent page IDs that are still easy to
consume by LLMs (incremental integers).
2026-01-08 15:59:30 +01:00
Sebastian Benz 4a87702ca6 docs: add experimental chrome on android guide (#691) 2025-12-17 12:33:52 +01:00
Alex Rudenko 81cbd99f52 docs: enhance cli docs + sort required vs opt params (#674) 2025-12-13 09:16:04 +00:00
Alex Rudenko ceae17be26 fix: make bringToFront optional in select_page (#668)
bringToFront() not only brings the tab to front in the browser but also
the browser window itself. This PR fixes the issue by making the call to
bringToFront() optional allowing agents to bring a tab to the user's
attention if needed but not always. To mitigate the risk of selected
page that is in the background being throttled, this PR implements
emulation of the focused page to make background tabs run as usual.
2025-12-12 11:04:04 +00:00
Richard Michael a8aae6652e docs: Add debug instructions (#670)
Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
2025-12-12 10:40:17 +00:00
Michael Hablich 90ed192c55 docs: Add AX design principles (#643) 2025-12-05 15:36:08 +01:00
JustasM 3991e4c2a9 feat(emulation): add geolocation emulation tool (#634)
Adding emulate_geolocation tool to emulate device location for testing
location-based features. Supports setting latitude/longitude or clearing
the override.

Closing https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/296
2025-12-02 08:57:55 +01:00
Connor Clark 36504d29ca feat: add insightSetId to performance_analyze_insight (#518)
This should land with / after
https://github.com/ChromeDevTools/chrome-devtools-mcp/pull/508
2025-11-04 08:18:04 +00: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 c06f4522ee refactor: merge emulate tools into one (#494)
Merges emulateCpu and emulateNetwork into a single tool to reduce token
consumption. Changes descriptions to be more concise.
2025-10-30 08:50:36 +00:00
Alex Rudenko 8e56307d62 feat: an option to ignore cache on reload (#485)
This CL implements an option to ignore cache on reload. Since the
configuration is passed as-is we rely on tests in Puppeteer to verify
the cache behavior.

Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/374
2025-10-29 10:32:27 +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 b0ce08ae2c feat: support saving snapshots to file (#463)
Refs https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/153

---------

Co-authored-by: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com>
2025-10-24 09:20:14 +00:00
Alex Rudenko d177087981 feat: support page reload (#462)
- merges navigation tools into a single tool.
- adds reload functionality.
- in a follow-up we will add options to reload.
2025-10-24 09:00:04 +00:00
Alex Rudenko b427392392 feat: add a press_key tool (#458)
Press key can be used to test shortcuts and individual key presses.
2025-10-23 16:18:58 +00:00
Nikolay Vitkov 70cd290986 chore: rename options to includePreserved<Data> (#455) 2025-10-22 10:54:12 +00:00
Nikolay Vitkov 6f24362039 feat: support previous navigation for Console messages (#452) 2025-10-22 01:03:01 +02:00
Nikolay Vitkov 165cf9c70b feat: expose previous navigations to the MCP (#419)
We should consider changing the order of element shown in the from the
collectors to be show newest first rather then the current oldest first
approach.

Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/88
2025-10-21 12:25:08 +00:00
Alina Varkki 92055933dc feat: tool to get a verbose single console message (#435) 2025-10-20 11:18:41 +02:00
circle33 9f9dab0787 docs: add VM-to-host remote debugging workaround (#399)
I think this part should be included in the document, I investigated it
for a long time at first, and it's not just me:
https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/328
https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/131
https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/139
2025-10-17 08:24:18 +02:00
Nikolay Vitkov 2313fdacad fix: better wording for evaluate_script (#392)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/pull/390
2025-10-16 11:53:04 +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
Alex Rudenko d47aaa96ff feat: support verbose snapshots (#388)
As an option allow verbose snapshots
https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/363

---------

Co-authored-by: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com>
2025-10-15 12:16:34 +00:00
Nikolay Vitkov 579819b5e7 feat: use stable id for network request querying (#382)
Provides stable id when selecting a network request, this should fix
issues with multiple same places and long URL selection.
2025-10-14 14:35:15 +02:00
Alex Rudenko 9ad7cbb2de fix: document that console and requests are since the last nav (#335)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/240
2025-10-10 13:51:36 +00:00