文件历史

提交图

22 次代码提交

作者 SHA1 备注 提交日期
Wolfgang Beyer 7548c97663 feat: support third-party developer tools (#1982)
Enables "third-party developer tools" feature. This allows the inspected
web page to expose tools which provide debugging information to Chrome
DevTools for Agents.

Third-party developer tools enable web applications to expose internal
state, component hierarchies, or specific debug data that cannot be
deduced through static analysis. This allows Chrome DevTools for Agents
to provide richer, more actionable context to AI agents during debugging
sessions.

2 additional tools are enabled in Chrome DevTools for Agents for
interacting with third-party developer tools:
`list_3p_developer_tools()` and `execute_3p_developer_tool`.

Code changes in this PR:
- Rename "in-page tools" to "third-party developer tools"
- Unhide
- Make available in CLI
- Add documentation
2026-05-06 12:43:34 +00:00
Alex Rudenko f45f0681a2 fix: make sure env variables are consistently applied when parsing args (#1994)
This PR moves the checks for CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS and
CI env vars to parseArguments making sure it is correctly applied by the
daemon and in tests. It also updates the tests to set explicit
CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS as it might not always be
inherited. This change is likely to affect the metrics collected and
might explain some fluctuations we observed.
2026-05-05 15:44:55 +00:00
Nicholas Roscino b2b3e99d67 feat(cli): generate commands for conditional tools (#1962)
This PR adds all tools in the CLI interface. When a tool is not enabled
the server responds with an error guiding the user on how to enable the
category or the experiment.

Closes:
https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1933
2026-04-30 07:59:08 +00:00
Nicholas Roscino 3ff21cf30d feat: support Chrome extensions debugging (#1922)
Adds ability to install, uninstall and reload extensions, trigger
extension actions and inspect extension pages, service workers and
content scripts. Specify `--categoryExtensions` to enable.

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

---------

Co-authored-by: Mathias Bynens <mathias@qiwi.be>
Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2026-04-21 14:03:15 +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
Nicholas Roscino 8c2a7fc21e fix: mark categoryExtensions flag mutually exclusive with autoConnect (#1202)
Fixes #1072
2026-03-18 16:57:30 +00: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
Paul Irish b747f9d74a feat: Integrate CrUX data into performance trace summaries (#733)
We upgrade the performance trace tools to include real-user experience
data from the Chrome User Experience Report (CrUX).

https://developer.chrome.com/docs/crux
https://developer.chrome.com/docs/crux/methodology

### Deets

* When a trace is stopped, the server now extracts the primary
navigation URLs from the trace (determined by insightSets).
* It calls the public CrUX API to fetch field metrics (LCP, INP, CLS)
for each unique URL/Origin.
* The formatting of crux data is handled by upstream TraceFormatter, but
it looks like this:

```md
Metrics (field / real users):
  - LCP: 2595 ms (scope: url)
  - LCP breakdown:
    - TTFB: 1273 ms (scope: url)
    - Load delay: 86 ms (scope: url)
    - Load duration: 451 ms (scope: url)
    - Render delay: 786 ms (scope: url)
  - INP: 140 ms (scope: url)
  - CLS: 0.06 (scope: url)
  - The above data is from CrUX–Chrome User Experience Report. It's how the page performs for real users.
  - The values shown above are the p75 measure of all real Chrome users
  - The scope indicates if the data came from the entire origin, or a specific url
  - Lab metrics describe how this specific page load performed, while field metrics are an aggregation of results from real-world users. Best practice is to prioritize metrics that are bad in field data. Lab metrics may be better or worse than fields metrics depending on the developer's machine, network, or the actions performed while tracing.
 ```
 
**Privacy Considerations:**

*   Updates the server README to inform users that performance analysis tools may send trace URLs to the Google CrUX API.
*   Adds a notification message to the server startup logs regarding the CrUX API interaction.


Doc: go/crux-in-bifrost 
Fixes b/446630695

---------

Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
2026-02-05 07:27:15 +00:00
Alex Rudenko 7e279f1b67 feat: enable usage statistics by default with opt-out (#855)
## **Usage statistics**

Google collects usage statistics (such as tool invocation success rates,
latency, and environment information) to improve the reliability and
performance of Chrome DevTools MCP.

Data collection is **enabled by default**. You can opt-out by passing
the `--no-usage-statistics` flag when starting the server:

```json
"args": ["-y", "chrome-devtools-mcp@latest", "--no-usage-statistics"]
```

Google handles this data in accordance with the [Google Privacy
Policy](https://policies.google.com/privacy).

Google's collection of usage statistics for Chrome DevTools MCP is
independent from the Chrome browser's usage statistics. Opting out of
Chrome metrics does not automatically opt you out of this tool, and
vice-versa.

The code determining statistics that are collected is in here
https://github.com/ChromeDevTools/chrome-devtools-mcp/tree/main/src/telemetry.
2026-01-28 10:18:10 +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
Ergün Erdoğmuş e8c9192dbd chore: add usage statistics CLI flag (#757)
This PR initiates the implementation of clearcut telemetry. It
introduces the CLI configuration required to opt-out of usage
statistics, along with the necessary transparency disclaimers for the
user. It's hidden by default during development & while we get the
launch approvals.

**Implementation Roadmap:**
This is the first in a series of PRs designed to implement the telemetry
system:
1.  **CLI & Opt-out Mechanism (This PR):**
* Adds the `--usage-statistics` flag (hidden, default `false` for now).
* Adds transparency logging to specify data collection when enabled.
2.  **Logger Scaffolding & Integration:**
    *   Implement `ClearcutLogger` and integrate it into `main.ts`.
    *   Add hooks for `logServerStart` and `logToolInvocation`.
* Introduce `ClearcutSender` as an abstraction layer for transport
logic.
3.  **Persistence Layer:**
* Implement local state management to reliably track "First Time
Installation" and "Daily Active" metrics.
* Implement sending the daily active and first time installation event
based on this local state.
4.  **Watchdog Process Architecture:**
* Move `ClearcutSender` execution to a dedicated watchdog process to
ensure reliable event transmission even during abrupt server shutdowns.
5.  **Transport, Batching & Retries:**
* Finalize `ClearcutSender` with actual HTTP transport logic, including
event batching, respecting `next_request_wait_millis` and retries.
2026-01-12 13:58:58 +00:00
Lakshan Perera 9a51af219f feat: Allow opting out of default Chrome launch arguments (#729)
Related Issue -
https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/430

### Description

When Chrome is launched via Puppeteer, it automatically adds a set of
default flags like `--enable-automation --disable-extensions
--disable-component-extensions-with-background-pages.`

Currently, there is no way to opt out of these defaults, which makes
certain use cases difficult or impossible to support. this PR adds a way
to selectively ignore specific default Chrome launch flags applied by
Puppeteer using its
[ignoreDefaultArgs](https://pptr.dev/api/puppeteer.launchoptions#ignoredefaultargs)
property.

```json
{
  "name": "chrome-devtools-mcp",
  "version": "latest",
  "mcpServers": {
    "chrome-devtools": {
      "command": "npx",
      "args": [
        "chrome-devtools-mcp@latest",
        "--ignore-default-chrome-arg='--enable-automation'",
        "--ignore-default-chrome-arg='--disable-extensions'"
      ]
    }
  }
}
```

**Feedback appreciated** @OrKoN
2026-01-12 10:08:18 +00:00
Lakshan Perera ddeacfecfb chore: fix test name for chrome args (#732)
Fix test name for chrome args
2026-01-07 08:44:45 +00:00
Alex Rudenko 6ab6d85d50 feat: support --auto-connect to a Chrome instance (#651)
This PR adds a new connection mode called `--auto-connect`. To activate
it, add the `--auto-connect` flag to the chrome-devtools-mcp server
configuration. With this, chrome-devtools-mcp will automatically connect
to the running Chrome instance by looking up the port and the URL in the
user data dir for the specified `--channel` (by default, `stable`).
Requires Chrome M145.
2025-12-08 12:20:35 +00:00
Alex Rudenko fcaf55354c feat: support --user-data-dir (#622)
Allow configuring Chrome's `--user-data-dir` to allow changing the
defaults to support discovery of running Chrome instances later on.
2025-11-28 10:49:36 +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
Alex Rudenko 0fe2b8a2b4 feat: allow configuring tool categories (#454)
This PR introduces a feature to disable some of the MCP server tool
categories to tailor it to specific use cases.

For example,

```
npx chrome-devtools-mcp@latest --no-category-emulation        Disable tools in the emulation category
npx chrome-devtools-mcp@latest --no-category-performance      Disable tools in the performance category
npx chrome-devtools-mcp@latest --no-category-network          Disable tools in the network category
```
2025-10-22 12:32:16 +02:00
Đào Hoàng Sơn 41d6a107ba feat: add WebSocket endpoint and custom headers support (#404)
## Summary
Add support for connecting to Chrome via WebSocket endpoint with custom
headers, enabling authenticated remote debugging scenarios and providing
an alternative to the HTTP-based connection method.

## What's New
This PR introduces two new CLI arguments:

- **`--wsEndpoint` / `-w`**: Connect directly to Chrome using a
WebSocket URL
  - Example: `ws://127.0.0.1:9222/devtools/browser/<id>`
  - Alternative to `--browserUrl` (mutually exclusive)
  
- **`--wsHeaders`**: Pass custom headers for WebSocket connections (JSON
format)
  - Example: `'{"Authorization":"Bearer token"}'`
  - Only works with `--wsEndpoint`

## Use Cases
- **Authenticated remote debugging**: Use API keys, tokens, or custom
auth headers
- **Secured instances**: Connect to browser instances requiring
authentication
2025-10-17 11:06:36 +02:00
Alex Rudenko e1b5363653 feat: support passing args to Chrome (#338)
Drive-by: removes custom devtools frontend as a dedicated argument.

Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/261
2025-10-10 15:05:41 +00:00
Alex Rudenko 098a904b36 fix(cli): tolerate empty browser URLs (#298)
it seems some clients default to empty default values for args. We can
accept that and do not error for these.

Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/264
2025-10-07 14:33:59 +02:00
Alex Rudenko ef61a08707 feat: support initial viewport in the CLI (#229)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/165

This PR uses page_resize logic to set the initial viewport size. Not
using the emulation because it looks buggy in headful which is our
default mode.
2025-10-01 10:11:35 +02:00
Alex Rudenko 03b59f0bca fix: do not set channel if executablePath is provided (#150)
Fixes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/148
2025-09-25 18:44:31 +02:00