Client roots from a WSL2 client are dropped by a Windows-side server (fileURLToPath ERR_INVALID_FILE_URL_PATH)
Maintainers usually reply within 1 day
@nroscino is already working on this.
Since Oct 1, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
Research direction
Start in McpContext.js at the client-root handling that calls fileURLToPath, then reproduce the WSL2-to-Windows case described in the issue. Verify that a POSIX root is retained alongside the server workspace and that take_screenshot accepts a filePath under it, while existing Windows roots continue to work.
Written by the indexing model from the issue text.
Description
Description of the bug
When a client running in WSL2 (Claude Code, for example) launches chrome-devtools-mcp on the Windows side through WSL interop (Windows node.exe, Windows Chrome), the client's MCP roots are POSIX file URLs such as file:///home/user/project. On Windows, Node's fileURLToPath rejects these with ERR_INVALID_FILE_URL_PATH: File URL path must be absolute. The failed roots are dropped silently, only os.tmpdir() is left, and every filePath inside the project is refused:
Access denied: path /home/user/project/shot.png (canonical: \\wsl.localhost\Ubuntu-24.04\home\user\project\shot.png) is not within any of the configured workspace roots.
The requested path resolves correctly, against the server's UNC working directory, to \\wsl.localhost\…. Only the root never makes it into the allowed list.
Reproduction
- In WSL2, register the server with a Windows command, for example
"command": "node.exe", "args": ["C:\\…\\chrome-devtools-mcp\\build\\src\\bin\\chrome-devtools-mcp.js"]. - Start the client in a WSL project directory (
/home/user/project). The client advertisesroots. - Call
take_screenshotwithfilePath: "/home/user/project/shot.png". - The call is refused as above. The same call with a path under Windows
%TEMP%succeeds.
Where
In 1.9.0, McpContext.js:
const rootPath = path.resolve(fileURLToPath(rootPathUri));
This runs inside Promise.allSettled, so the throw only logs Could not resolve configured root … and the root is skipped. Checked on Windows Node 24.20.0:
> require('url').fileURLToPath('file:///home/user/project')
Uncaught TypeError [ERR_INVALID_FILE_URL_PATH]: File URL path must be absolute
Possible fix
Parse client roots with fileURLToPath(uri, { windows: false }) when the URI has no drive letter or host, then path.resolve the result. With the server's working directory on \\wsl.localhost\<distro>\…, path.resolve('/home/user/project') gives \\wsl.localhost\<distro>\home\user\project, which is the same canonical form validatePath produces for the requested file. playwright-mcp hit the identical bug and fixed it with the same pattern: microsoft/playwright-mcp#1172.
Workaround
--workspace=\\wsl.localhost\<distro>\home\<user> on the server's args. It works because the server-side root is a Windows path.
Environment
- chrome-devtools-mcp 1.9.0 (1.10.x's CHANGELOG lists no roots change)
- Windows Node 24.20.0, Windows 11 build 26200
- WSL 2.6.3 (Ubuntu 24.04)
- Claude Code 2.1.282 in WSL2
Related but distinct: #2808, a / root that doubles the separator.
- Dominant language
- TypeScript
- Stars
- 54.1k
- Forks
- 6.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 233
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ChromeDevTools/chrome-devtools-mcp
-
Truncating a page URL can split a percent-encoded characterPossibly taken @axchadxs claimed this 4 days ago. Openconfirmed p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ChromeDevTools/chrome-devtools-mcp#3340 · 1 comment ·
Maintainers usually reply within 1 day
-
collecting-feedback feature
Difficulty 2/5 Half a day Newbie friendliness 76/100
ChromeDevTools/chrome-devtools-mcp#3225 · 3 comments ·
Maintainers usually reply within 1 day
-
confirmed p3
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
ChromeDevTools/chrome-devtools-mcp#3089 · 2 reactions ·
Maintainers usually reply within 1 day
-
`resize_page` reports success when the page does not end up at the requested sizePossibly taken @SU-AN-coder claimed this today. Openconfirmed p3
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ChromeDevTools/chrome-devtools-mcp#2998 ·
Maintainers usually reply within 1 day
-
`wait_for` never finds visible text whose HTML source contains line breaks or repeated spacesPossibly taken A pull request linked to this issue is open or already merged. Openconfirmed p3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ChromeDevTools/chrome-devtools-mcp#2947 · 1 comment ·
Maintainers usually reply within 1 day
All issues in ChromeDevTools/chrome-devtools-mcp
Similar issues
-
bug ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
PhyberApex/kuroshiro#1687 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
microsoft/monaco-editor#5563 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 86/100
awslabs/visual-asset-management-system#937 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100