Commit b2196a7
authored
Let Claude drive real Chrome via chrome-devtools-mcp (#519)
Prototype for #518. Wires the official
[chrome-devtools-mcp](https://github.com/ChromeDevTools/chrome-devtools-mcp)
server so **Claude (and any other MCP client) can drive a real headless
Chrome** against Kolu's own dev server — `evaluate_script`,
`list_console_messages`, `take_screenshot`, network inspection,
performance traces, all 29 tools. Solves the recurring "I'm guessing at
CSS cascade / computed styles" round-trip that inspired the issue.
The wiring lives in three places. `.mcp.json` at the repo root is the
bit Claude Code actually reads — Claude starts _outside_ the nix
devshell, so the `nix develop --command just ai::mcp-chrome-devtools`
wrapper bridges into a shell where `npx`/`node` and the
Playwright-provided Chrome-for-Testing are on `PATH`. The launcher
recipe sits in `agents/ai.just` alongside the rest of the APM/agent dev
tooling, and resolves Chrome's binary inline by globbing
`$PLAYWRIGHT_BROWSERS_PATH/chromium-*/chrome-linux64/chrome` so there's
no shell.nix surface area to maintain. _Reuses Playwright's
Chrome-for-Testing 143, which chrome-devtools-mcp officially supports —
no new browser dependency, just the Node package fetched by `npx`._
End-to-end smoke verified: JSON-RPC `initialize` returns
`chrome_devtools` v0.21.0 with `tools.listChanged` capability
advertised. Navigated to `http://localhost:7681`, took an a11y snapshot,
evaluated `document.querySelectorAll('[data-terminal-id]')` to probe
live sidebar state — all 29 tools work as expected. Warm `nix develop`
eval stays at ~0.25s.
> **Follow-up encapsulation is gated on
[microsoft/apm#655](microsoft/apm#655 Once
that PR (Claude Code MCP adapter) merges and lands in juspay's fork, the
`chrome-devtools` entry folds into `agents/apm.yml`'s `dependencies.mcp`
and `.mcp.json` becomes a generated artifact of `just ai::apm`. The TODO
is captured in the `mcp-chrome-devtools` recipe's doc comment.
> **Telemetry note.** `chrome-devtools-mcp` sends usage statistics to
Google by default, and performance traces send URLs to the Chrome CrUX
API. Left default-on for this prototype — if unwanted, add
`--no-usage-statistics --no-performance-crux` to the recipe before
merge.
Refs #518.1 parent 547cd9e commit b2196a7
2 files changed
+23
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
0 commit comments