You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WSL2: auto-selects Windows chrome.exe under /mnt/c causing ECONNRESET and Target.setDiscoverTargets: Target closed #690
On WSL2 (Linux), when chrome-devtools-mcp is started without an explicit --executablePath, it may launch the Windows Chrome executable under /mnt/c/.../chrome.exe.
Shortly after launch, the CDP pipe connection resets (read ECONNRESET), and tool calls fail with:
If I force the Linux Chrome binary (e.g. --executablePath /usr/bin/google-chrome), the same tool calls work as expected.
Reproduction
Configure the MCP server (no --executablePath) and enable a log file:
command = "npx"
args = ["-y", "chrome-devtools-mcp@latest", "--headless", "--isolated", "--logFile", "/home/xxx/tmp/chrome-devtools-mcp-wsl.log"]
On Linux/WSL, if a Linux Chrome binary is available (e.g. /usr/bin/google-chrome), default executable selection should prefer it.
At minimum, if a Windows .exe under /mnt/c is selected, the server should emit a clear warning explaining this is likely to break CDP and recommend using --executablePath.
Here is how I diagnosed and worked around the issue:
Root cause (confirmed via server log):
On WSL2 (Linux), when chrome-devtools-mcp is started without an explicit --executablePath, it auto-selected and launched the Windows Chrome binary (path like /mnt/c/.../chrome.exe).
The server then used CDP over --remote-debugging-pipe, but the connection was reset (read ECONNRESET), and tool calls failed with:
Protocol error (Target.setDiscoverTargets): Target closed
Workaround:
Force the Linux Chrome executable:
--executablePath "/usr/bin/google-chrome"
In headless / constrained environments (WSL/containers), also add:
--chromeArg "--no-sandbox"
(optional: --isolated to use a temporary profile)
After applying the workaround:
chrome-devtools.list_pages returned a valid list
chrome-devtools.new_page / navigate_page worked
chrome-devtools.take_snapshot returned a normal accessibility tree snapshot
Before (problematic on WSL2): no explicit --executablePath
Here is how I diagnosed and worked around the issue:
Root cause (confirmed via server log):
On WSL2 (Linux), when chrome-devtools-mcp is started without an explicit --executablePath, it auto-selected and launched the Windows Chrome binary (path like /mnt/c/.../chrome.exe).
The server then used CDP over --remote-debugging-pipe, but the connection was reset (read ECONNRESET), and tool calls failed with:
Protocol error (Target.setDiscoverTargets): Target closed
Workaround:
Force the Linux Chrome executable:
--executablePath "/usr/bin/google-chrome"
In headless / constrained environments (WSL/containers), also add:
--chromeArg "--no-sandbox"
(optional: --isolated to use a temporary profile)
After applying the workaround:
chrome-devtools.list_pages returned a valid list
chrome-devtools.new_page / navigate_page worked
chrome-devtools.take_snapshot returned a normal accessibility tree snapshot
Before (problematic on WSL2): no explicit --executablePath
Activity
asdlem commentedon Dec 17, 2025
Here is how I diagnosed and worked around the issue:
Root cause (confirmed via server log):
Protocol error (Target.setDiscoverTargets): Target closed
Workaround:
Force the Linux Chrome executable:
--executablePath "/usr/bin/google-chrome"
In headless / constrained environments (WSL/containers), also add:
--chromeArg "--no-sandbox"
(optional: --isolated to use a temporary profile)
After applying the workaround:
Before (problematic on WSL2): no explicit --executablePath
[mcp_servers.chrome-devtools]
command = "npx"
args = [
"-y",
"chrome-devtools-mcp@latest",
"--headless",
"--isolated"
]
startup_timeout_sec = 30.0
After (workaround): force Linux Chrome on WSL2 + no-sandbox
[mcp_servers.chrome-devtools]
command = "npx"
args = [
"-y",
"chrome-devtools-mcp@latest",
"--headless",
"--executablePath",
"/usr/bin/google-chrome",
"--chromeArg",
"--no-sandbox"
]
startup_timeout_sec = 30.0
Optional (debug only): enable server log file / DEBUG
[mcp_servers.chrome-devtools]
command = "npx"
args = [
"-y",
"chrome-devtools-mcp@latest",
"--headless",
"--isolated",
"--logFile",
"/tmp/chrome-devtools-mcp.log"
]
[mcp_servers.chrome-devtools.env]
DEBUG = "*"
huihui43 commentedon Jan 15, 2026
work for me, thanks!
docs: add comprehensive AI technical gotchas guide for MCP builders
LiCeline commentedon Feb 9, 2026
OMG , it helps me!!!