Commit Graph
14 Commits
Author SHA1 Message Date
Nikolay Vitkov 65e6b97afd refactor(config): isolate scripts and unit tests from home config discovery (#3256)
Isolates code generation scripts (`scripts/generate-cli.ts`,
`scripts/update_metrics.ts`) and unit tests
(`tests/ToolHandler.test.ts`, `tests/cli.test.ts`,
`tests/tools/pages.test.ts`, `tests/tools/screencast.test.ts`,
`tests/tools/slim/tools.test.ts`, `tests/tools/tools.test.ts`) from
discovering `~/.config/cd4a/config.json` on the developer's machine by
using `ServerConfig.applyDefaults` or stubbing
`ConfigLocator.prototype.locate`.
2026-10-20 13:05:49 +00:00
Alex Rudenko 9de05ae6e5 fix(cli): pass positional values starting with - through to tools (#3084)
`chrome-devtools fill 1 <uid> -` reported success but cleared the field,
`type_text 1 -` typed an empty string, and values like `--weird` could
not be passed at all, not even after `--`.

yargs re-parses command positionals as `--name value` pairs. In that
pass yargs-parser treats any value starting with `-` (other than a
negative number) as the next flag and substitutes the string default
`''`. yargs also never fills positionals from the tokens after `--`.
Neither can be fixed via configuration (`unknown-options-as-args` and
`nargs` hit the same re-parse), and the upstream fix for the lone `-`
(yargs/yargs-parser#472) is unreleased and only covers that one case.

The CLI now shields such tokens before yargs sees them: a lone `-` is
always shielded, and everything after the first `--` is shielded with
the separator dropped. Shielded tokens are replaced by opaque
placeholders and restored when building the tool arguments. Unknown
flags such as `--weird` or `--pageid` without `--` are still rejected by
strict mode; the error tip and docs/cli.md now explain the `--` form.

Related upstream issues:
- https://github.com/yargs/yargs/issues/1312
- https://github.com/yargs/yargs/issues/1821
- https://github.com/yargs/yargs-parser/pull/472

Fixes #2984
2026-10-14 15:28:32 +00:00
Nikolay Vitkov 99847a71ab refactor: create all tools and register per slim mode (#2874)
Prepares the server for applying configuration changes at runtime.

- createTools() always returns every tool. The DevTools comments tools
are
gated by their `devtoolsComments` condition like other tools, instead of
  not being created.
- Slim tools are marked with `slim: true`. Slim mode selects which set
of
tools is registered, so slim tools may reuse the names of regular tools
  and other tools do not need a "not slim" condition.
- McpServer keeps the registered tool handles so tools can be updated in
  place, and declares the `tools.listChanged` capability with debounced
  `notifications/tools/list_changed`.
- The docs, CLI and metrics scripts use the single tool list. The
DevTools
  comments tools are now tracked in the tool call metrics.

---

<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
2026-09-30 10:01:07 +00:00
Nikolay Vitkov e4168d0045 refactor: extract config parsing logic in a class (#2861)
The PR refactors the the methods in a full ConfigParser class to make
each logical step easier to follow.
The methods are help as public to ease the migration, else test would
need to be re-done.
Tightens the conditions of tools to only allow existing Config
arguments.
2026-09-30 08:08:37 +00:00
Nikolay Vitkov 5068584894 refactor: simplify our gen scritps (#2793) 2026-09-21 14:39:51 +00:00
Nikolay Vitkov 61780c7498 refactor: prepare for SDK v2 (#2771)
The code changes here are a subset that works for both the current and
the update one. Splitting to reduce the review process.
2026-09-21 08:57:52 +00:00
Nikolay Vitkov 401a1192b6 refactor: extract category config into a seprate file (#2652) 2026-09-03 15:45:45 +00:00
Alex Rudenko a78566ee7c feat: add an option to turn off js execution tools (#2627)
While we keep the evaluate script available by default since it is
useful for many users, we give an option to disable it.
2026-08-31 09:10:30 +00:00
Nikolay Vitkov 5d0283969c refactor: move config files out of bin (#2578) 2026-08-14 14:17:28 +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
Alex Rudenko 8cbdb8d494 fix(cli): re-generate cli correctly (#1969)
Regressed in
https://github.com/ChromeDevTools/chrome-devtools-mcp/pull/1120
2026-04-28 14:18:39 +00: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
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 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