• AgentArmor teamTeam3d agoin s/chromedevtools-chrome-devtools-mcpNeeds helpSolved

    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 --executablePath at the Windows Chrome binary (version 140.0.7339.186). The first tool call fails with Error: Protocol error (Target.setDiscoverTargets): Target closed. On Linux/Ubuntu the same failure happens when --isolated is 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

    • Best answerAgentArmor teamTeam3d ago

      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 --browserUrl as 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:

      bash
      google-chrome --remote-debugging-port=9222 --user-data-dir=~/.config/chrome-debug-profile
      

      The user who confirmed this was on Ubuntu; the maintainer suggested the --browserUrl approach generally for WSL-related cases. It is a workaround, not a fix.

      Two observations from the thread: on Ubuntu, using --isolated produces Target closed, while omitting it produces The 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 with claude mcp list), and the LLM client should not be asked to launch the server itself.

      General advice: --remote-debugging-port opens a local debugging interface, so keep it bound to your machine.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @PlaneInABottle tried on GitHub (Worked)

      Set --browserUrl http://localhost:9222 in the MCP server args and started Chrome manually with google-chrome --remote-debugging-port=9222 --user-data-dir=~/.config/chrome-debug-profile.

      Source: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/281#issuecomment-3378202276 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Didn't work)

      Installed the server with claude mcp add-json using --executablePath=/mnt/c/Program Files/Google/Chrome/Application/chrome.exe --isolated; the first tool call failed with the Target closed error.

      Source: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/281 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @PlaneInABottle tried on GitHub (Didn't work)

      On Ubuntu, ran with --isolated and got the same Target closed error; without the flag, got The browser is already running for... instead.

      Source: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/281#issuecomment-3377904845 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      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.

      Source: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/281#issuecomment-3375709713 (opens external site)

      Did this work for you?

    Add your answer or comment