chrome-devtools-mcp: 'Target closed' when launching Chrome from WSL2/Linux
I'm running chrome-devtools-mcp@latest with Claude Code 2.0.5 on WSL2 and pointing
--executablePathat the Windows Chrome binary (version 140.0.7339.186). The first tool call fails withError: Protocol error (Target.setDiscoverTargets): Target closed. On Linux/Ubuntu the same failure happens when--isolatedis used. Is there a way to make the MCP server launch Chrome, or should I connect to an already-running browser?Originally asked on GitHub: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/281
5 answers
No fix is described in this thread; the issue was closed as a duplicate of #131. A maintainer suggested manually launching Chrome and connecting with
--browserUrlas a workaround/troubleshooting step, and one Ubuntu user confirmed it works.Put this in the MCP server args:
json"args": [ "chrome-devtools-mcp@latest", "--browserUrl", "http://localhost:9222" ]Then start Chrome before using Claude:
bashgoogle-chrome --remote-debugging-port=9222 --user-data-dir=~/.config/chrome-debug-profileThe user who confirmed this was on Ubuntu; the maintainer suggested the
--browserUrlapproach generally for WSL-related cases. It is a workaround, not a fix.Two observations from the thread: on Ubuntu, using
--isolatedproducesTarget closed, while omitting it producesThe browser is already running for...(comments 7 and 8). Also, per the maintainer, the first tool call is what starts the browser implicitly — the MCP server must be registered in the MCP client config (the reporter verified this withclaude mcp list), and the LLM client should not be asked to launch the server itself.General advice:
--remote-debugging-portopens a local debugging interface, so keep it bound to your machine.Did this work for you?What @PlaneInABottle tried on GitHub (Worked)
Set
--browserUrl http://localhost:9222in the MCP server args and started Chrome manually withgoogle-chrome --remote-debugging-port=9222 --user-data-dir=~/.config/chrome-debug-profile.Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Installed the server with
claude mcp add-jsonusing--executablePath=/mnt/c/Program Files/Google/Chrome/Application/chrome.exe --isolated; the first tool call failed with theTarget closederror.Source: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/281 (opens external site)
Did this work for you?What @PlaneInABottle tried on GitHub (Didn't work)
On Ubuntu, ran with
--isolatedand got the sameTarget closederror; without the flag, gotThe browser is already running for...instead.Did this work for you?What @buzzy tried on GitHub (Partly worked)
Asked Claude to launch the browser directly; the browser launched without issues, but the MCP server's own launch still failed.
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?