Make chrome-mcp the default agent provider with an auto-connect preflight
Merged
KA
19h ago+477+477+012345678901234567890123456789-98-98-01234567890123456789
Why
Chrome DevTools MCP drives the user's real Chrome with their sessions, which is the better default for reverse engineering logged-in sites. Headed chrome-mcp only works once auto-connect is enabled, and chrome-mcp runs save no HAR, so both need clear, early failures.
What
- New configs default to
agent_provider: "chrome-mcp". Existingconfig.jsonfiles keep the provider they store;auto(Playwright MCP + HAR) stays available. chrome_mcp.pychecks auto-connect the way chrome-devtools-mcp does:DevToolsActivePortin the stable Chrome profile (honoringCHROME_CONFIG_HOME/XDG_CONFIG_HOMEon Linux) plus an open port. Headed runs stop before launching with setup steps anderror_kind: config_invalid;agent --dry-runreportschrome-mcp:auto-connectas ok or error.--headlessskips it.engineer <run_id>on a run without a HAR stops before any model session: chrome-mcp runs (detected from the run's recordedmode) get an explanation,error_kind: misuseand exit 2; other runs name the missing HAR path.- Pins
chrome-devtools-mcp@1.12(it requirespageIdon most tools). The chrome-mcp prompt opens its own tab withnew_page, passespageId, closes only its tab, stops on "Could not connect to Chrome", and only promises the user's sessions on headed runs. - Playwright prompt:
browser_run_codeisbrowser_run_code_unsafe; the nonexistentbrowser_scrollis gone. - README, website docs (configuration, agent and engineer modes, overview) and changelog.
Verification
pytest: 1046 passed, includingtests/test_chrome_mcp.py(port file missing, unreadable, out of range, closed and open port; per-platform profile paths; dry-run error/ok/headless;agent --jsonand interactive fail fast without recording a run;engineerrejects HAR-less runs in text and JSON mode).ruffclean, website builds.- Real captures from this branch on Node 26 against hn.algolia.com, both
status: okwith working clients (30 live results):- headed, attached to a real Chrome: the agent only touched its own tab (
new_page→close_page), $0.71 - headless: $1.06
- headed, attached to a real Chrome: the agent only touched its own tab (
- Fresh
HOME(no config, no Chrome profile): default is chrome-mcp;--dry-run,--json,--json-streamand text mode all fail fast with the setup steps;--headless --dry-runpasses. engineeron the real headed chrome-mcp run exits 2 with the chrome-mcp message in text and JSON mode.
Out of scope
mypy srclocally reports the existingcopilot_engineer.py:58untyped-decorator error, same as onmain; CI mypy passes.- HAR capture for chrome-mcp runs.