文件历史

提交图

67 次代码提交

作者 SHA1 备注 提交日期
Michael Hablich 55105dd431 Merge branch 'main' into breakpoints 2026-03-06 09:18:16 +01:00
Alex Rudenko ae311fc23c chore: filter out some tools from CLI (#1131)
Filters out wait_for and fill_form.
2026-03-06 08:05:50 +00:00
Michael Hablich 16cf90f08e feat: add debugger_set_logpoint and debugger_remove_logpoint tools with documentation and tests. 2026-03-06 08:45:13 +01:00
Alex Rudenko c2d8009ff7 refactor: move main files (#1120)
- `chrome-devtools-mcp.js` is the `npx chrome-devtools-mcp`
- `chrome-devtools.js` is the new CLI
- `-cli-options.js` is the corresponding options
- all these files are in the bin folder to indicate they are executable
2026-03-05 21:51:37 +00:00
Michael Hablich 93441555c7 feat: Add breakpoint debugger tools 2026-03-05 18:26:26 +01:00
Alex Rudenko 013110b0ee chore: generate cli automatically (#1117) 2026-03-05 13:35:15 +00:00
Madhavi bdbbc84c12 fix: improve tool descriptions (#965)
Addresses cases where DevTools MCP tools were not consistently picked up
from natural language prompts by improving tool descriptions and
metadata.

Validation:
Tested locally across multiple prompts related to LCP and page
performance.
MCP tools were selected more consistently after the description updates.

Refs #940

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
Co-authored-by: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com>
Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2026-03-05 06:47:15 +00:00
Alex Rudenko b5b9a7753b test: fix install of chrome in test.mjs (#1087)
This is used by some extension tests that rely on new CDP capabilities.
cc @nroscino
2026-03-03 20:43:53 +00:00
Alex Rudenko 109bf43e4c chore: fix arg forwarding in CLI (#1084)
Drive-by: e2e tests for major scenarios.
Drive-by: make stopDaemon more robust.
2026-03-03 17:47:01 +00:00
Nicholas Roscino 8dbf862549 test: installing chrome through test script (#1085)
Fixes local test failing for triggerAction on extensions.
2026-03-03 16:06:18 +00:00
Alex Rudenko a4533326a4 chore: add a script to generate CLI (#1077)
The script will be used to generate CLI for the MCP server at
`src/bin/cliDefinitions.ts`.
It uses the live server JSON schemas to make it more compatible with the
actual MCP server at runtime. The code definitions are used to extend
the CLI with tool categories.
2026-03-02 15:06:30 +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
Stanislav Publika caf601a328 feat: add pageId routing for parallel multi-agent workflows (#1022)
## Summary

Adds optional `pageId` routing to page-scoped tools, gated behind
`--experimental-page-id-routing`. When enabled, multi-agent callers can
target a specific page without relying on global selection state. Fully
backward-compatible: without the flag, behavior is unchanged.

### Key changes

- **`pageScoped` annotation**: tools declare `pageScoped: true`; the
server merges `pageId` into their schema at registration time (when the
flag is on)
- **`McpPage` wrapper**: consolidates per-page state (numeric id,
isolated context name, focus tracking) into a single class
- **Request-scoped page routing**: `resolvePageById()` resolves the
target page, `setRequestPage()` threads it through the handler so tools
like `getSelectedPage()` see the right page
- **`assertPageIsFocused`**: keyboard/input tools validate that the
target page holds browser focus, returning an actionable error ("call
select_page first") instead of silently dispatching to the wrong page
- **`--experimental-page-id-routing` CLI flag** (hidden): gates schema
injection and request-scoped routing so the feature can be tested before
graduating
- **Eval scenarios**: `page_id_routing_test` and
`page_focus_keyboard_test` with `serverArgs` support in the eval harness

Addresses #1019
2026-02-26 11:39:38 +00:00
Nicholas Roscino 25638f093b chore: enable dynamic tool definition based on CLI arguments (#1031)
This PR allows tools to be created dynamically based on the provided cli
arguments
2026-02-24 17:01:33 +00:00
Stanislav Publika a10617002f chore: make eval scripts cross-platform compatible (Windows) (#1030)
Fixes #1029

## Summary
- Use `pathToFileURL()` from `node:url` for dynamic imports in
`eval_gemini.ts` to fix `ERR_UNSUPPORTED_ESM_URL_SCHEME` on Windows -
converts absolute paths like `D:\projects\...\console_test.ts` to proper
`file:///D:/projects/.../console_test.ts` URLs that the Node.js ESM
loader accepts on all platforms
- Move `CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS=true` from Unix-only
shell env var prefix in `package.json` into `eval_gemini.ts` code,
matching the pattern already used in `scripts/test.mjs`
- Add `.gitattributes` with `* text=auto eol=lf` to enforce LF line
endings on checkout - Windows contributors cloning the repo would
otherwise get CRLF endings, which conflicts with the project's Prettier
`endOfLine: 'lf'` config and causes spurious diffs or formatting
failures
2026-02-24 13:16:27 +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
Matthias Rohmer 0ccc15e1fb chore: add -f argument for count token tool to read from file instead (#1021)
Makes it a little easier to repeatedly run the skill counter on the
contents of a file, instead of copy-pasting.
2026-02-23 14:06:04 +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 5696cce035 test: do not suppress uncaught errors in tests (#1008)
We want to suppress uncaught errors in production because we do not want
to crash the entire server. But it might be useful in tests.
2026-02-20 13:10:24 +00:00
Alex Rudenko 46bd54f7c8 chore: verify npm package content before publishing (#999)
Refs: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/996
https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/995
2026-02-20 08:40:46 +00:00
Alex Rudenko a2950e2e62 test: deflake network test (#994)
drive-by: switch to dot reporter locally and make it configurable
2026-02-19 13:34:07 +00:00
Alex Rudenko fd0a9193b3 docs: estimate tokens using tiktoken (#959) 2026-02-16 08:22:50 +00:00
Alex Rudenko 482a288c7e chore: evaluate select_page scenario (#925)
Passes the test with gemini-2.5-flash with no errors.

Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/921
2026-02-10 10:11:23 +00:00
Alex Rudenko c0435a2d53 fix: disable usage statistics when CI or CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS env is set (#862)
When CI or CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS env variables are
set, we override the set cli args and disable the usage statistics.
2026-01-30 07:58:45 +00:00
Alex Rudenko aa0a3679f5 feat: add a skill for using chrome-devtools-mcp (#830)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/pull/710
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/709
2026-01-26 10:04:39 +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 57e07eed7b chore: token count tool (#820)
small helper
2026-01-23 12:56:22 +00:00
dependabot[bot] 5bd77d3e97 chore(deps-dev): bump chrome-devtools-frontend from 1.0.1570343 to 1.0.1571573 in the bundled-devtools group (#811)
Bumps the bundled-devtools group with 1 update:
[chrome-devtools-frontend](https://github.com/ChromeDevTools/devtools-frontend).

Updates `chrome-devtools-frontend` from 1.0.1570343 to 1.0.1571573
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/5563496226fd71a8ab7681e7fdae4f99bb5e9fb5"><code>5563496</code></a>
Update DevTools DEPS (trusted)</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/92f6ef8e6da11408cbdabc22e565e2c22d21fd66"><code>92f6ef8</code></a>
Update Chrome (for Testing) PIN</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/5a8e2a0ef05a79898ff8444eeddeebc7ed8cc6d9"><code>5a8e2a0</code></a>
Node screenshots in OOPiF</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/bdd5124e030ee4cf59b78af0df257faef3f65a1b"><code>bdd5124</code></a>
Make <code>ComputedStyleModel</code> take a DOMNode explicitly.</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/09497c921d594414d34a45fec5fcf9db3b8276db"><code>09497c9</code></a>
Migrate XLink in templates</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/ed7883b3fd6f6fcc2170a89a1dc2c3b7cd7d763d"><code>ed7883b</code></a>
Roll browser-protocol</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/52c709a810c92ff1f925772b8262190c0935ec56"><code>52c709a</code></a>
Add initial //agents/prompts folder and some prompts</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/5e8a5c29da01203e176019cc9443dd51967a93c8"><code>5e8a5c2</code></a>
Update Chrome (for Testing) PIN</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/76990dded48a1b8d29e71d505af9c2877b0cbe22"><code>76990dd</code></a>
Remove default jslog name for devtools-link</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/8b9a227cf425a51e2825dad31e7cdc3bd3c4d606"><code>8b9a227</code></a>
Trace: remove outdated comment</li>
<li>Additional commits viewable in <a
href="https://github.com/ChromeDevTools/devtools-frontend/compare/v1.0.1570343...v1.0.1571573">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=chrome-devtools-frontend&package-manager=npm_and_yarn&previous-version=1.0.1570343&new-version=1.0.1571573)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2026-01-22 12:47:10 +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
Natasha Gorshunova 24d15a9375 chore: Implement uninstall_extension tool (#796)
Co-authored-by: Natallia Harshunova <nharshunova@chromium.org>
2026-01-20 07:01:10 +00:00
Alex Rudenko a83a338351 fix: increase timeouts for long text input (#787)
Fixes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/786
2026-01-19 13:01:41 +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
Natasha Gorshunova 1e0ee69d3a chore: Implement install_extension command (#764)
Co-authored-by: Natallia Harshunova <nharshunova@chromium.org>
2026-01-19 07:57:25 +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 67c1f80b28 chore: refactor eval script more (#781)
add args parsing and simplify output (support debug logging + headless).
2026-01-16 08:49:06 +00:00
Alex Rudenko 303a1383e1 chore: add more eval scenarios (#780) 2026-01-16 08:38:45 +00:00
Alex Rudenko 0284d18b7b chore: support an html route in evals (#770)
Allows using the server URL in the prompt.
2026-01-14 17:11:53 +00:00
Alex Rudenko 257b9943e9 chore: add basic eval (#766)
This PR adds a tool based on the node test runner that runs a loop to
see what tools a model chooses given a prompt. The expectations are
encoding for each prompt. Run `npm run eval` to get results. Currently,
only Gemini and needs and API key.
2026-01-14 14:15:21 +00:00
Alex Rudenko 10baac9c48 test: add a retry for the merge queue (#762)
The tests need to pass checks before being added to the merge queue so
we can avoid merge queue failures in case there are flaky tests.
2026-01-13 12:03:17 +00:00
Alex Rudenko c4e493b411 test: support testing a single test file without only (#761)
This PR adds a test.ts wrapper over the test runner to simplify scripts
in package.json and allow running a single test file.
2026-01-13 11:53:54 +00:00
Alex Rudenko b204ad7009 build: update verify server.json (#759)
move download to the script, run script without deleting server.json
2026-01-13 10:10:19 +00:00
Alex Rudenko a94dc0e614 chore: experimental vision mode (#745)
this PR adds the `--experimental-vision` argument that exposes
additional tool for visual automation (currently, click_at(x, y)).
2026-01-09 12:45:31 +00:00
Simon Zünd 79ab800b1e chore(build): remove obsolete protocol_client.js modifications (#739)
The `self.Protocol` assignment and register call have moved to the
InspectorBackend constructor. The `self.Protocol` assignment now use
`globalThis`. The register call is necessary to make DevTools foundation
work.
2026-01-08 13:05:01 +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 94b899c205 build: bundle devtools frontend (#656) 2025-12-11 11:51:04 +01:00
Alex Rudenko 7a072c0012 build: rewrite docs generator (#640)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/562
2025-12-03 09:44:46 +01:00
Simon Zünd 589d994974 chore: add UniverseManager to create DevTools Universes for each Page (#621)
A follow-up PR will add a single instance of the `UniverseManager` to
`McpContext` similarly to the *Collectors. We don't do that in this PR
yet, as we need to wait for some chrome-devtools-frontend changes to
roll.
2025-11-28 09:19:50 +00:00
Alex Rudenko a5c40d14a9 chore: remove i18n mocks (#576)
i18n can now run in node.js.
2025-11-19 09:32:54 +00:00
Natasha Gorshunova c1e4118992 feat: report console issues in list_console_messages (#505)
Co-authored-by: Natallia Harshunova <nharshunova@chromium.org>
Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
2025-11-17 10:38:46 +01:00