fix(mcp): avoid UNC cwd warnings for Windows stdio servers on WSL - #8305
Open
liu-collab wants to merge 1 commit into
Open
fix(mcp): avoid UNC cwd warnings for Windows stdio servers on WSL#8305liu-collab wants to merge 1 commit into
liu-collab wants to merge 1 commit into
Conversation
liu-collab
force-pushed
the
fix/wsl-windows-mcp-stdio-cwd
branch
from
April 12, 2026 10:27
e51d1f2 to
2e98f60
Compare
teknium1
reviewed
Jul 12, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for addressing a real WSL-to-Windows MCP failure mode. Current main still creates StdioServerParameters without a cwd at tools/mcp_tool.py:2068, and its docs still require a /mnt/c launch path (website/docs/guides/use-mcp-with-hermes.md:183).
Problems
- The added assertion at
tests/tools/test_mcp_tool_issue_948.py:153is incompatible with current main:_run_stdio()wraps POSIX commands withmcp_stdio_watchdog.pyattools/mcp_tool.py:2066, soStdioServerParameters.commandissys.executable, notcmd.exe. - The docs update misses the companion config reference (
website/docs/reference/mcp-config-reference.md:48-50) and leaves conflicting WSL workaround guidance inwebsite/docs/guides/use-mcp-with-hermes.md:183andwebsite/docs/user-guide/windows-wsl-quickstart.md:191,330.
Suggested changes
- Update the regression test to assert the watchdog wrapper and its forwarded
cmd.exetarget while retaining thecwdassertion. - Update the config reference and existing WSL guidance alongside the feature guide.
Automated hermes-sweeper review.
| await server.start({"command": "cmd.exe", "args": ["/c", "echo", "ok"]}) | ||
|
|
||
| call_kwargs = mock_params.call_args.kwargs | ||
| assert call_kwargs["command"].endswith("cmd.exe") |
Contributor
There was a problem hiding this comment.
Current main wraps POSIX stdio commands through sys.executable tools/mcp_stdio_watchdog.py ... -- <real-command> at tools/mcp_tool.py:2066. On WSL this assertion should instead verify the wrapper command and assert that cmd.exe appears after --; keep the cwd assertion to cover this fix.
This was referenced Jul 28, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UNCcwd warnings corrupting stdio MCP traffic when Hermes launches Windows executables likecmd.exemcp_servers.<name>.cwdis configuredcwdoption and the WSL/rootstartup failure mode for Windows-backed MCP serversProblem
When Hermes runs inside WSL and an MCP stdio server is configured with a Windows executable such as
cmd.exe, launching Hermes from a Linux-only WSL path like/rootcan break the MCP connection before the server even starts.In the reproduced setup:
rootchrome-devtools-mcpviacmd.exe /c npx .../rootThat caused Windows interop to emit this warning on stdout:
Because stdio MCP requires stdout to be protocol-only, those extra lines corrupted the transport and Hermes showed the MCP server as failed at startup.
Design
I fixed this in the stdio MCP launch layer rather than in a one-off browser integration because the failure is generic to any WSL -> Windows executable stdio server.
Implementation details:
mcp_servers.<name>.cwdif the user sets onehermes_constants.is_wsl()helper.exe,.cmd,.bat,.com)/mnt/c/Users/$USERNAME/mnt/c/Users/$WIN_USERNAME/mnt/c/Users/Administrator/mnt/c/Users/mnt/cThis keeps normal Linux stdio servers unchanged and avoids touching command strings or wrapping processes in shell glue.
Verification
Targeted tests:
uv run python -m pytest tests/tools/test_mcp_tool_issue_948.py -qManual repro / regression checks:
/root,hermes_cli/main.py mcp test chrome-devtools-winnow connects successfully/root,hermes_cli/main.py chat ... mcp_chrome_devtools_win_list_pagesnow succeeds instead of failing at startup due to theUNCwarningNotes
This came from a real WSL + Windows Chrome bridge setup where Hermes in WSL was driving a live Windows Chrome session via
chrome-devtools-mcp.