文件历史

提交图

35 次代码提交

作者 SHA1 备注 提交日期
Piotr Paulski aa33bff19f feat: add experimental TOON support for structured content output (#2042)
Adds `--experimentalToonFormat` boolean flag, controlling how structured
content is formatted in text response.
By default, custom shorthand format is used. With this flag, TOON format
(see https://github.com/toon-format/toon) is used instead.

TOON format is supposed to be more token-efficient and less error-prone
for agents to understand than json, but it's not clear if it will be
better on those metrics than the custom format used so far. (Evals
pending)

One clear benefit over custom format would be less code to maintain if
we decide to fully switch to TOON, due to dropping custom formatters and
reusing json formatters used for structuredContent anyways.

Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
2026-06-08 13:41:58 +00:00
Nicholas Roscino 29e389848f feat: implement extension service worker logs (#1915)
This PR introduces the possiblity to collect console messages from
service workers.
2026-06-08 12:30:37 +00:00
Lusa Zhan be4a34c19a chore(deps): Roll lighthouse 13.3.0 (#2022)
Co-authored-by: Lusa Zhan <lusazhan@chromium.org>
2026-05-11 08:16:33 +00:00
Lusa Zhan 5fa2750456 feat: agentic browsing in lighthouse (#1931)
pending https://github.com/GoogleChrome/lighthouse/pull/16980

---------

Co-authored-by: Lusa Zhan <lusazhan@chromium.org>
Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2026-05-02 08:09:55 +00:00
Alex Rudenko def53ddf1d feat: support MCP client roots feature (#1945)
This PR implements
https://modelcontextprotocol.io/specification/2025-11-25/client/roots If
client specifies roots, all reads and writes to the file system
originating in tool calls will denied (including tmp files). The client
specified empty list of roots, all filesystem access will be restricted.

Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1860

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
2026-04-27 11:55:30 +00:00
Alex Rudenko d50255778a feat: support experimental allowlist for navigate tool calls (#1935)
This PR adds an experimental allowlist for the page navigate tool call
(requires `--experimentalNavigationAllowlist`, off by default). The
feature uses a list of URLPatterns to decline navigations that land on
disallowed URLs. If that happens, the client can update the allowlist
and re-try. The purpose of the this feature is to offer additional
guardrails on top of the MCP server. It does not restrict subresources
or JS/iframe navigations in any way. The performance impact is minimized
by turning off interception as soon as the navigation request is done.
2026-04-22 12:16:10 +00:00
Alex Rudenko 57648b7ab0 chore(deps): update lh (#1913)
Updated to
https://github.com/GoogleChrome/lighthouse/commit/b328482638078735ec3bd74cf31355f1a758eb27
2026-04-20 19:09:09 +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
Mathias Bynens 3f0cf1068b fix: avoid showing update notification for local builds (#1889)
Previously, we would show the notification if the local version string
was *different* from the latest version string published to npm.

With this patch, we actually check if the npm-published version is newer
and avoid showing the notification otherwise.


Closes #1886
2026-04-17 09:38:51 +00:00
Alex Rudenko fb6e857d4e chore(deps): bump lighthouse to 13.1.0 (#1825)
Changelog
https://github.com/GoogleChrome/lighthouse/blob/main/changelog.md
2026-04-08 06:24:16 +00:00
Wolfgang Beyer 627ed68a28 chore: DOM elements as inputs for in-page tools (#1791)
DOM elements are non-serializable and therefore cannot be directly sent
between the inspected page and the MCP server. JSONSchema also has no
native type for DOM elements.

If an in-page tool expects a DOM element as an input parameter, it
should specify this in its input schema by adding `'x-mcp-type':
'HTMLElement'` to the object it expects to be a DOM element.

The MCP server internally refers to DOM elements by a UID (UIDs are
assigned when generating a page snapshot which is based on the page's
accessibility tree).

This change provides the mapping between DOM element and UID in both
directions:
1) The tool's input schema is rewritten internally, adding a required
UID attribute to objects with `'x-mcp-type': 'HTMLElement'`. This allows
the MCP server to call the in-page tool with UIDs where the tool expects
DOM elements.
2) In the page context, the UIDs are replaced with the corresponding DOM
elements, before the actual in-page tool is called. This means that the
in-page tool receives DOM elements as parameters where it expects them.
2026-04-02 09:34:26 +00:00
Wolfgang Beyer 4637ab9389 chore: Add execute_in_page_tool tool (#1766)
This allows the MCP server to call the in-page tools provided by the
inspected page.

Handling of (non-serializable) DOM elements as tool parameters or tool
output will be added in follow-ups.
2026-03-31 19:01:47 +00:00
yulunz 44e511f6f6 chore: add function to sanitize params for tool calls (#1250)
This adds functions to sanitize the tool call parameters. They are not
called as of now since we don't have server side changes landed yet to
support these.
2026-03-31 17:56:43 +00:00
Alex Rudenko 604c41167b chore(deps): bump lighthouse (#1776) 2026-03-31 12:17:44 +00:00
Wolfgang Beyer cea963be68 feat: Add a new tool for listing in-page tools (gated behind a command line flag) (#1239)
This adds a `list_in_page_tools` MCP tool. When called, it dispatches a
`devtoolstooldiscovery` event on the active page. The page announces its
exposing tools by calling the event's `respondWith` method, which causes
the exposed tools to be stashed on the page's `window` object. This list
of in-page tools is then appended to the `list_in_page_tools` response.

Calling the exposed in-page tools from the MCP server will be handled in
a follow-up.
2026-03-30 09:51:35 +00:00
Alex Rudenko 88da3b83da chore: fix bundling for the CLI (#1111)
extracts non-launch related fixes from
https://github.com/ChromeDevTools/chrome-devtools-mcp/pull/1100
2026-03-05 08:26:37 +00:00
Alex Rudenko 9d14d7ad11 chore: shim puppeteer in lh bundle (#1101)
LH PR https://github.com/GoogleChrome/lighthouse/pull/16895 Contains
unmodified output from `npm run update-lighthouse`.
2026-03-04 15:49:14 +00:00
Alex Rudenko 9d173cd3f2 chore(deps): update lh bundle (#1078)
Produced by `npm run update-lighthouse`.
2026-03-02 15:40:15 +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 dd26bbf172 chore: implement a daemon process (#1020)
Implements a daemon process needed for the CLI. The daemon has commands
to start/stop itself as well as an ability to forward data to the
managed MCP server. Local sockets or named pipes are used depending on
the platform.

The .sock and .pid files are placed under
XDG_RUNTIME_DIR/chrome-devtools-mcp or /tmp/chrome-devtools-mcp for
short socket paths.

It uses Puppeteer's PipeTransport to avoid re-implementing \0 terminated
messages.

Note the code is not used anywhere at the moment.
2026-02-24 13:48:36 +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
Simon Zünd a3a00210a3 feat: include stack trace in 'get_console_message' tool (#740)
This is the stack trace of the console message itself. If the argument
is an Error object or an "Error.stack" like string we don't do anything
special (yet).

The stack trace is source mapped if source maps are available.

The function matches the target ID of the console message to the
`SDK.Target` of DevTools. The only oddity is that DevTools works in a
lazy manor: It creates stack traces upfront and as source maps come in,
stack traces get updated. This does not work for the MCP server.
Instead, we wait for script parsed events and source maps to attach
before creating the stack trace. Since this could take potentially a
while, we guard it with a time out.
2026-01-20 09:58:29 +00:00
zyzyzyryxy 3c8ce2d281 chore: Remove file unused after bundling from published package (#785)
build/src/third_party/devtools.js is only used during bundling, but we
publish it unnecessarily. We should remove it to not cause confusion and
slightly decrease package size.

Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
2026-01-19 11:42:58 +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
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 657b996733 build: namespace devtools exports (#662) 2025-12-11 13:12:01 +01:00
Alex Rudenko 94b899c205 build: bundle devtools frontend (#656) 2025-12-11 11:51:04 +01:00
Alex Rudenko e3c59bcd9c feat: support --user-data-dir with --auto-connect (#654)
This PR integrates `--user-data-dir` with the `--auto-connect` feature.
If `--user-data-dir` is provided as well `--auto-connect`, the specified
dir is used to locate a running browser server.
2025-12-09 10:46:23 +01:00
zyzyzyryxy 94752ffade fix: prevent dropping license notices on some files when publishing (#604)
This PR prevents license notices being dropped when creating package for
publication.

This can happen when first import in the file is type-only import that
gets removed during build. When there is no empty line between the
license block comment and such import, the comment is treated as related
to the import and gets removed alongside it.
Adding an empty line between copyright notice and the import fixes the
issue.

Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
2025-11-24 12:38:30 +00:00
Simon Zünd eea5b80165 chore: change puppeteer/devtools connection adapter (#602)
Rather then adapting on the transport layer, we adapt the puppeteer
`CDPSession`/`Connection` and make them look like a `CDPConnection`. The
class assumes that callers create a dedicated `CDPSession` to be used.

The `PuppeteerDevToolsConnection` installs a generic `'*'` event
listener on all child sessions to funnel all CDP events into DevTools
via `CDPConnectionObservers`. As pointed out in the code comment, we
don't need to recursively listen to `'sessionattached'` events on child
sessions: Nested `sessionattached` events are reported on all parent
sessions.

While not strictly necessary, `PuppeteerDevToolsConnection` also
uninstalls the CDP event listener when a session gets detached (modulo
the root puppeteer `CDPSession`).
2025-11-24 10:30:14 +00:00
Alex Rudenko 17b2edca7c build: do not bundle by default (#488)
The CI jobs will still bundle by default but I think the risk of the
differences between the bundled and unbundled version is fairly low for
local development.
2025-10-29 11:00:43 +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
zyzyzyryxy 800e7e8364 refactor: bundle zod together with modelcontextprotocol/sdk (#414)
Continue bundling dependencies for faster startup time.

---------

Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
2025-10-17 19:10:11 +02: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