autoConnect fails on Chrome 150 stable default profile: port 9222 listens but /json/version returns 404, DevToolsActivePort never created
Summary
chrome-devtools-mcp --autoConnect cannot connect to a running Chrome 150 stable instance using the default profile, even though remote debugging is enabled and Chrome is listening on port 9222. All documented connection modes fail on the default profile.
Environment
- macOS (Darwin 27.0.0)
- Google Chrome
150.0.7871.47(stable, arm64, default profile at~/Library/Application Support/Google/Chrome/) chrome-devtools-mcp1.4.0- Started via:
npx chrome-devtools-mcp@latest --autoConnect
Repro
- Start Google Chrome normally with the default profile.
- Open
chrome://inspect#remote-debuggingand enable remote debugging. The "Server running at" indicator shows port 9222. - Run
npx -y chrome-devtools-mcp@latest --autoConnect.
Observed (all three connection modes fail)
Port is listening, but the standard DevTools HTTP API is NOT exposed:
$ lsof -nP -iTCP:9222 -sTCP:LISTEN
Google 22075 a 126u IPv4 ... TCP 127.0.0.1:9222 (LISTEN)
$ curl -sv http://127.0.0.1:9222/json/version
> GET /json/version HTTP/1.1
< HTTP/1.1 404 Not Found
< Content-Length: 0
A standard CDP endpoint returns JSON metadata here (Browser, webSocketDebuggerUrl, etc.). Instead the port appears to be the M144+ permission-proxy layer introduced by the autoConnect flow, not the real CDP endpoint.
The DevToolsActivePort file is never created on the default profile:
~/Library/Application Support/Google/Chrome/DevToolsActivePort -> does not exist
Resulting MCP errors:
--autoConnect->Could not find DevToolsActivePort for chrome at ~/Library/Application Support/Google/Chrome/DevToolsActivePort--browser-url=http://127.0.0.1:9222-> fails becausepuppeteer.connectcannot retrievewebSocketDebuggerUrl(/json/versionreturns 404)
Root cause
autoConnect reads DevToolsActivePort to obtain the real WebSocket path + token. On Chrome 150 stable with the default profile:
- Chrome listens on 9222, but only the permission-proxy layer is exposed; the standard DevTools HTTP API (
/json/version) is not. - The
DevToolsActivePortfile is never written to the default profile directory.
So the port is up but unreachable through any documented connection mode. This matches the hardening described in #1830, but goes further: even with the port confirmed listening and remote debugging enabled in chrome://inspect, neither autoConnect nor --browser-url can attach.
Workaround
Non-default --user-data-dir + --remote-debugging-port works (matches the #1830 control test):
open -na "Google Chrome" --args \
--remote-debugging-port=9333 \
--user-data-dir=/tmp/chrome-debug-profile \
--no-first-run
# then: --browser-url=http://127.0.0.1:9333
Expected
On Chrome 150+ with remote debugging enabled via chrome://inspect, --autoConnect should either:
- Attach via the M144 permission-based live-session flow without relying on the default-profile
DevToolsActivePortfile, or - Detect this configuration and emit an explicit error explaining that default-profile attach is unsupported and a non-default
--user-data-diris required.
Actual
--autoConnect silently falls back to the default-profile DevToolsActivePort lookup that Chrome 150 no longer honors, producing a misleading "Could not find DevToolsActivePort" error even though the user has enabled remote debugging and a port is listening.
Related
- #1830 — autoConnect fails against default Chrome profile on macOS after Chrome 136+ remote-debugging hardening
I just tested with Chrome Version 150.0.7871.47 (Official Build) (arm64).
Logged into my default profile (verified via chrome://version)
Allowed remote debugging
In my terminal on mac I run: npx chrome-devtools-mcp@latest --autoConnect
Then pasted the following commands to it to emulate the connection by an agent (one line at a time):
{"jsonrpc": "2.0", "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "triage-client", "version": "1.0"}}, "id": 1}
{"jsonrpc": "2.0", "method": "notifications/initialized"}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "list_pages", "arguments": {}}, "id": 2}
The full output (my commands + mcp server responses), was as follows:
$ npx chrome-devtools-mcp@latest --autoConnect
chrome-devtools-mcp exposes content of the browser instance to the MCP clients allowing them to inspect,
debug, and modify any data in the browser or DevTools.
Avoid sharing sensitive or personal information that you do not want to share with MCP clients.
Performance tools may send trace URLs to the Google CrUX API to fetch real-user experience data. To disable, run with --no-performance-crux.
Google collects usage statistics to improve Chrome DevTools MCP. To opt-out, run with --no-usage-statistics.
For more details, visit: https://github.com/ChromeDevTools/chrome-devtools-mcp#usage-statistics
{"jsonrpc": "2.0", "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "triage-client", "version": "1.0"}}, "id": 1}
{"result":{"protocolVersion":"2024-11-05","capabilities":{"logging":{},"tools":{"listChanged":true}},"serverInfo":{"name":"chrome_devtools","title":"Chrome DevTools MCP server","version":"1.4.0"}},"jsonrpc":"2.0","id":1}
{"jsonrpc": "2.0", "method": "notifications/initialized"}
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "list_pages", "arguments": {}}, "id": 2}
{"result":{"content":[{"type":"text","text":"## Pages\n1: Inspect with Chrome Developer Tools (chrome://inspect/#remote-debugging) [selected]\n2: Google.com <snipped for privacy reasons>"}]},"jsonrpc":"2.0","id":2}
As you can see, the connection was established successfully.
~/Library/Application Support/Google/Chrome/DevToolsActivePort ~~does not~~ do exist on my system ~~either, so that's not related.~~ while remote connection is allowed.
Please try this reproduction to dissect the issue. The agent can be at fault (I see no mention which agent you are using), browser configuration can be different, firewalls etc.
EDIT: fixed info on DevToolsActivePort after verifying again.
HTTP endpoint is not expected to work in the chrome://inspect#remote-debugging mode.
@OrKoN Thanks for confirming the HTTP endpoint isn't expected to work in chrome://inspect#remote-debugging mode.
To make sure I'm testing the right path: is --autoConnect (via the M144 permission-based live-session flow) the only supported way to attach to the default profile on Chrome 150? --browser-url=http://... is out, as you noted.
I re-ran npx chrome-devtools-mcp@latest --autoConnect against the default profile with remote debugging enabled in chrome://inspect#remote-debugging. After allowing the permission prompt in Chrome, autoConnect still falls back to the DevToolsActivePort lookup and errors with Could not find DevToolsActivePort for chrome at ~/Library/Application Support/Google/Chrome/DevToolsActivePort.
@zyzyzyry confirmed the same path works on their machine (Chrome 150.0.7871.47 arm64, default profile, 1.4.0), so it's not broken in general - it just consistently fails on mine. State on my side: port 9222 listening (Chrome process per lsof), /json/version returns 404 (expected), DevToolsActivePort never written to the default profile dir.
What's the right way to diagnose why the M144 handshake isn't completing here? Are there logs/flags from chrome-devtools-mcp or Chrome that would show where the permission-proxy handshake drops?
@phpmac could it be that you have multiple Chrome instance or something else listening on 9222? if you toggle the checkbox on the chrome://inspect#remote-debugging page, which port does it output on that page? I can confirm that --auto-connect is the only supported way to attach to Chrome via chrome://inspect#remote-debugging. As a troubleshooting step, could you try closing all Chrome instances, and making sure nothing runs on 9222 before starting Chrome again and re-trying the --auto-connect steps?
I think the root cause here is a Chrome security change rather than a bug in the connection code — but the tooling's messaging actively points users the wrong way, and that part is fixable.
Why the default profile can't work: Chrome disables the remote-debugging endpoint when Chrome is running on its default user-data-dir (a hardening change to stop malware/other local apps from silently attaching to your everyday browser). The chrome://inspect#remote-debugging toggle still flips and the port still listens, but no usable DevTools HTTP endpoint is created on the default profile — which is exactly what you observed (/json/version → 404, no DevToolsActivePort file). So no connection mode can succeed against the default profile; it needs a dedicated data dir.
Where the tooling misleads: both the --autoConnect help text and the failure message point at chrome://inspect#remote-debugging as the fix —
- CLI help: "Requires the remote debugging server to be started in the Chrome instance via chrome://inspect/#remote-debugging."
- Runtime (
src/browser.ts): "Could not connect to Chrome. Check if Chrome is running and remote debugging is enabled by going to chrome://inspect/#remote-debugging."
For a user on the default profile that's a dead end: they did enable it, and it still can't work.
Proposed change (happy to send a PR): when an autoConnect attempt fails, surface an accurate, actionable message — something like:
Could not connect to Chrome. If Chrome is running on its default profile, remote debugging is disabled there for security. Start Chrome with a dedicated data dir (
--user-data-dir=/path --remote-debugging-port=9222), or run chrome-devtools-mcp without--autoConnectso it launches its own isolated profile.
…plus a matching tweak to the --autoConnect help text. I'd keep it to messaging only (no behavior change) and add a unit test around the failure path.
Before I write it: would you prefer (a) just the clearer runtime error, (b) error + help-text wording, or (c) would you rather own the exact wording yourselves? Happy to go whichever way — didn't want to send a wording PR you'd have to rewrite.
@Liohtml this is not correct. --auto-connect with chrome://inspect#remote-debugging works on the default use profile. What does not work with chrome://inspect#remote-debugging is the HTTP endpoint which is not needed for the chrome-devtools-mcp to operate: it connects directly to the WebSocket endpoint.
You're right, and I was wrong — sorry for the noise.
I went back to the code: --autoConnect reads DevToolsActivePort from the user data dir and connects straight to ws://127.0.0.1:<port><path> (src/browser.ts). It never touches /json/version — only --browserUrl goes through the HTTP endpoint. So the 404 in the report is expected and irrelevant, and the chrome://inspect#remote-debugging pointer in both the error message and the --autoConnect help text is correct, not misleading.
My error: I conflated the older --remote-debugging-port hardening on the default profile with the Chrome 144 chrome://inspect#remote-debugging toggle, which is a different, sanctioned mechanism that does work on the default profile and deliberately exposes only the WebSocket endpoint. I should have read the connection path before theorising about it.
Withdrawing the messaging change I proposed — the premise was wrong. Thanks for taking the time to correct it.