chrome-devtools-mcp 0.20.1: 'Target.getDevToolsTarget' wasn't found with Electron apps
Connecting chrome-devtools-mcp 0.20.1 to an Electron app (Obsidian 1.12.4 on Electron 39.7.0) via --browser-url=http://127.0.0.1:9222 makes every tool call fail with "Protocol error (Target.getDevToolsTarget): 'Target.getDevToolsTarget' wasn't found". Version 0.20.0 worked fine with the same setup. Why did 0.20.1 break Electron connections, and what is the fix?
Originally asked on GitHub: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1197
4 answers
Fixed in chrome-devtools-mcp 0.20.2: the maintainer reverted PR #1150, which caused the regression, and released the fix. Upgrade to 0.20.2 (or downgrade to 0.20.0) to restore Electron support.
The error comes from
McpContext.detectOpenDevToolsWindows(), which calledpage.hasDevTools()and issued the CDP commandTarget.getDevToolsTarget. Electron 39.7.0 (Chromium 142.0.7444.265) does not implement that method. The maintainer noted the API was introduced in Chromium 144.0.7559.59 and considered the change non-breaking for Chrome stable, the supported product; Electron apps carry older Chromium because they only bump Electron periodically. Since the call ran on everylist_pagesand page selection, all tool calls failed.If you must stay on 0.20.1, the reporter proposed patching the built output
build/src/McpContext.jsto wrap theawait page.hasDevTools()call in a try/catch and setmcpPage.devToolsPage = undefinedon failure, so DevTools window detection is skipped gracefully. That patch was only proposed in the issue, not confirmed applied. The maintainer agreed a fallback like that could be released later as a new version, but the immediate resolution was the revert.Did this work for you?What a GitHub user tried on GitHub (Outcome unclear)
Proposed patching the built
build/src/McpContext.jsto wrappage.hasDevTools()in a try/catch and setmcpPage.devToolsPage = undefinedon failure. The thread does not confirm anyone applied this.Source: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1197 (opens external site)
Did this work for you?What @Igloczek tried on GitHub (Worked)
Reported reverting from 0.20.1 to 0.20.0; version 0.20.0 works fine with the same Electron setup.
Did this work for you?What @wolfib tried on GitHub (Worked)
Maintainer reverted PR #1150 and released 0.20.2, resolving the regression.
Did this work for you?
Related questions
- Why does chrome-devtools-mcp snapshot miss table/ARIA semantics?
- Why is --load-extension ignored by chrome-devtools-mcp?
- How do I use chrome-devtools-mcp from WSL when Chrome is installed on Windows?
- chrome-devtools-mcp --autoConnect times out on every tool call with Chrome 144
- How to select which Chrome profile chrome-devtools-mcp automates when several are open?