文件历史

提交图

25 次代码提交

作者 SHA1 备注 提交日期
Nikolay Vitkov bf0574da8c refactor: change type of logger (#2165)
This change aligns most of our logger allowing them to be omitted when
needed meaning code inside the args will not be executed unconditionally
- example `logger?.(JSON.stringy(X))`.

Currently only changes the type, while in a follow up I will remove the
`debug` package and update the file logs.
2026-06-02 09:29:48 +00:00
Alex Rudenko 1b51a520f2 fix(cli): address pid file creation issues (#2124) 2026-05-26 09:28:46 +00:00
lmlm a9fb555c80 fix: include saved image paths in CLI JSON output (#2070)
Fixes #1910

Summary:
- save image content before returning structured CLI JSON output
- include saved image metadata in `structuredContent.images`
- add coverage for JSON output with image content

Tests:
- `npm test -- tests/daemon/client.test.ts`
- `npx eslint src/daemon/client.ts tests/daemon/client.test.ts && npx
prettier --check src/daemon/client.ts tests/daemon/client.test.ts`

Co-authored-by: Nicholas Roscino <nroscino@google.com>
2026-05-18 13:46:41 +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 82b67b07d3 refactor: add support for CLI sessionIds in tests (#1919)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1119
2026-04-22 08:15:36 +00:00
Cocoon-Break e3a5f6bb69 fix(cli): correct WebP MIME type check in handleResponse ('webp' → 'image/webp') (#1899)
## Summary

Fixes a bug in `src/daemon/client.ts` where the MIME type case for WebP
images was `'webp'` instead of the correct `'image/webp'`.

## Problem

In `handleResponse`, the switch statement for determining file extension
used the incorrect string `'webp'` as the MIME type. Since browsers and
servers send `image/webp` as the MIME type, the case never matched, and
all WebP images were saved with a `.png` extension instead of `.webp`.

```ts
// Before (buggy)
case 'webp':
  extension = '.webp';
  break;

// After (fixed)
case 'image/webp':
  extension = '.webp';
  break;
```

## Testing

WebP screenshots/images returned by the tool will now correctly receive
the `.webp` extension.

Closes #1898

Signed-off-by: cocoon <54054995+kuishou68@users.noreply.github.com>

Signed-off-by: cocoon <54054995+kuishou68@users.noreply.github.com>
2026-04-20 11:48:12 +00:00
Nikolay Vitkov d97a04b084 chore: remove workaround after SDK update (#1790) 2026-04-01 15:27:51 +00:00
yulunz b2b5e3fef6 chore: handling more client name enums (#1228)
The openclaw client name is defined at
https://github.com/openclaw/openclaw/blob/ea476de1e488979a3e9e5bf32e4d4f20e563144f/src/browser/chrome-mcp.ts#L234C14-L234C29
2026-03-24 18:18:14 +00:00
Alex Rudenko 06c295278d chore: work around the SDK's MCP client issues (#1137)
MCP SDK client does not set windowsHide when spawning the process unless
it is on windows under Electron (not sure why). But I think we can
safely pretend to be "electron".

Refs https://github.com/modelcontextprotocol/typescript-sdk/issues/1638
Refs https://github.com/ChromeDevTools/chrome-devtools-mcp/pull/1100
2026-03-06 14:15:14 +00:00
Alex Rudenko 1c6db83810 chore: use windowsHide in daemon client (#1135)
prevents cmd.exe from showing on Windows.
2026-03-06 08:45:51 +00:00
Alex Rudenko f07353f88a chore: report current cli args (#1133)
This CL records the args in the daemon and reports them back to the
client via the status call.
2026-03-06 08:23:35 +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
Alex Rudenko 4e4038beff chore: configure cli args (#1115)
This PR configures CLI args for the start command. It removes arguments
that do not make sense.
2026-03-05 12:48:42 +00:00
Alex Rudenko dc53fa331d chore: validate start args (#1113)
The `start` command accepts the MCP server CLI options. This PR adds
yargs validation to the start command and re-uses the same yargs
definitions.
2026-03-05 11:27:26 +01:00
Alex Rudenko d95e9ba89d chore: add detailed daemon status (#1110)
adds additional details about running daemon.
2026-03-05 08:41:10 +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 bad5a16f95 chore: handle images in the CLI (#1107)
- save base64 data as an image to a tmp file.
- change `--format` to `--output-format` to avoid conflicts.
2026-03-05 07:49:13 +00:00
Alex Rudenko a02a5671f9 chore: change text format to md in CLI (#1102)
as it is closer to reality.
2026-03-04 18:08:50 +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
Alex Rudenko bedfd5d886 chore: forward disclaimers (#1082)
`chrome-devtools start` should forward underlying disclaimers. This is
achieved by piping stderr until the start indicator is seen.
2026-03-03 12:54:26 +00:00
Alex Rudenko 82f9e6539d chore: handle CLI responses and formats (#1080)
Initial handling for CLI responses. Note that image responses are not
supported yet.
2026-03-03 12:30:08 +00:00
Alex Rudenko 2216b3a933 chore: implement chrome-devtools CLI (#1079)
Note that the implementation for response handling and daemon start/stop
is still a placeholder. The proper handling will be done in follow-ups.
The `generateCustomHelp` function is also fully experimental and it is
likely to get removed before the release. The goal of this PR is to
scaffold the e2e workflow for early manual testing. Automated tests will
be also added in a follow-up.

Note this does not expose the CLI as a binary on the package.
2026-03-03 07:06:23 +00:00
Alex Rudenko 13a18e2380 chore: implement daemon client (#1037)
The client is meant to start the daemon if it is not running or connect
to the existing one. Long-running client connections are not needed yet.

Removed previous direct daemon test as we better test it via the client,
the intended way to manage the daemon.
2026-02-26 15:03:21 +00:00
Nikolay Vitkov 0106865aad refactor: extract version in a seprate file (#1032) 2026-02-24 14:22:26 +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