
This fix is part of MCP troubleshooting, within The MCP Guide. Still stuck? Request a free MCP readiness review.
Most MCP errors with WSL come from mixing two operating systems. A Windows app such as Claude Desktop starts its servers on Windows, so it cannot see npx, uvx or files installed only inside your Linux distribution. The fastest fix is to either install the server's runtime on Windows, or start the Linux server through wsl.exe with Linux-style paths, and to keep the client and the server on the same side whenever you can.
Checked against: Microsoft's WSL file systems guide, WSL basic commands and WSL networking guide, plus Claude Code's setup docs and the VS Code MCP management docs, on 2 November 2026. eSEOspace did not run these steps.
Key Takeaways
- Windows apps run MCP servers on Windows. A tool installed only inside WSL is not on the Windows
PATH. - Microsoft documents
wsl <command>(orwsl.exe <command>) for running Linux binaries from Windows, with paths written in WSL format. - Windows and WSL do not share environment variables by default. Microsoft's
WSLENVvariable lists which ones to share. - Claude Code installed inside WSL is launched from the WSL terminal, not from PowerShell or CMD, and reads its config inside Linux.
- In VS Code's Remote WSL windows, user-profile stdio servers run locally, so configure the server in the remote environment instead.
What this error means
WSL runs a Linux distribution next to Windows. Each side has its own programs, PATH and home folder. A Windows client that reads "command": "npx" looks for npx.exe or npx.cmd on Windows. If Node lives only in Ubuntu, the launch fails with ENOENT or "not recognized."
Paths cause the second group of errors. Windows writes C:\Users\you\project, while WSL sees the same folder as /mnt/c/Users/you/project. Microsoft's file systems guide says commands passed into wsl.exe "are forwarded to the WSL process without modification," so "file paths must be specified in the WSL format."
The third group is environment variables. A key set in Windows does not appear inside WSL unless you share it.
Quick fix
- Decide where the client runs: Windows (Claude Desktop, Cursor, VS Code without Remote WSL) or Linux (Claude Code in WSL, VS Code Remote WSL).
- Install the server's runtime on that same side, or bridge to the other side with
wsl.exe. - To bridge, set
"command": "wsl.exe"and put the Linux command and its arguments inargs. Microsoft says binaries run this way use the current working directory and run as the WSL default user. - Write every path in
argsthe way the side running the server expects (/home/...or/mnt/c/...for Linux). - Pass secrets inside the
wsl.execall, or share them withWSLENV. - Restart the client and read its MCP log.
A Claude Desktop entry that launches a server inside WSL, built from Microsoft's documented wsl <command> form and the standard MCP config format:
{
"mcpServers": {
"filesystem": {
"command": "wsl.exe",
"args": [
"npx", "-y", "@modelcontextprotocol/server-filesystem", "/home/you/projects"
]
}
}
}
This runs in your default distribution. To change the default, Microsoft's basic commands page gives wsl --set-default <Distribution Name>, and wsl -l -v lists your distributions and their WSL version. If npx is not found this way, use the full Linux path that which npx prints inside your distribution. Tools installed by nvm may only be on PATH in an interactive shell.
Fix by client / OS
Claude Desktop
Claude Desktop is a Windows app, and its config lives at %APPDATA%\Claude\claude_desktop_config.json. Either install Node or Python on Windows and use the native setup in our Claude Desktop Windows guide, or use the wsl.exe pattern above. For the Code tab, Anthropic documents WSL sessions that need WSL 2 and run Claude Code inside the distribution. Those docs say connectors may still be rolling out to WSL sessions.
Claude Code
Claude Code's setup docs offer native Windows or WSL. For WSL, "you install and launch claude inside the WSL terminal, not from PowerShell or CMD." Servers you add there run inside Linux, so add them from the WSL shell:
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /home/you/projects
A server added in native Windows Claude Code is a separate config. Do not expect it to appear in WSL. Claude Code's troubleshooting page also notes slower file access when a project sits on /mnt/c/, and suggests keeping projects under /home/.
VS Code
The VS Code docs say "local user-profile stdio servers run locally." For a WSL window, configure the server in the remote workspace or run MCP: Open Remote User Configuration, and install the runtime inside WSL. The same page warns that a command available locally might be missing remotely.
Cursor
Cursor reads .cursor/mcp.json or ~/.cursor/mcp.json and starts stdio servers with the command you give, per Cursor's MCP docs. Treat it like any Windows app: install the runtime on Windows, or use wsl.exe. Cursor's help page adds that when an admin turns on MCP Network Controls, sandboxed command servers do not start on Windows, and the log says the server requires sandboxing. Ask the admin for a No sandbox entry.
Remote servers inside WSL
If you run a Streamable HTTP server in WSL, a Windows client can usually reach it on localhost. Microsoft's networking guide says Windows apps can reach Linux networking apps via localhost, and that mirrored mode lets both sides use 127.0.0.1. IPv6 ::1 is not supported in that mode.
Where to find the logs
- Claude Desktop:
%APPDATA%\Claude\logs. In PowerShell:type "$env:AppData\Claude\logs\mcp*.log". - Claude Code in WSL:
/mcpin a session, orclaude mcp listin the WSL shell. - VS Code: MCP: List Servers, pick the server, Show Output.
- Cursor: Output panel (Ctrl+Shift+U), then MCP Logs.
If it still fails
- Variables missing inside WSL. Microsoft's guide describes
WSLENVas "a list of environment variables to share between Windows and WSL," with a/uflag for variables passed from Windows into WSL. See env variables not passed. - WSL 1. Claude Code Desktop WSL sessions need WSL 2. Check with
wsl -l -v. - Interop turned off. Microsoft notes interop can be disabled through
/proc/sys/fs/binfmt_misc/WSLInterop, which stops Windows from launching Linux binaries. - Native Windows errors. If you drop WSL, follow MCP server failed to start on Windows and spawn npx ENOENT.
Decode any JSON-RPC code with the MCP error code lookup, and generate a clean config per client with the MCP config generator.
Next step
Pick one side for each team and document it. Mixed setups are where most WSL errors start. If you need help standardizing MCP across Windows developers, see eSEOspace's MCP development services.
More in the MCP Guide
Free tools: MCP Error Code Lookup · MCP Config Generator
Latest research: State of MCP: October 2026
Frequently asked questions
Can Claude Desktop use an MCP server installed in WSL?
Not directly by name, because it starts commands on Windows. You can launch the server through wsl.exe with Linux paths, or install the runtime on Windows.
Should I put my project on /mnt/c or in /home?
Microsoft recommends storing files in the WSL file system when you work from a Linux command line, for speed. Claude Code's troubleshooting page gives the same advice.
Why does my API key work in PowerShell but not in the WSL server?
Windows variables do not cross into WSL unless you list them in WSLENV or pass them inside the wsl.exe command.
Does WSL 1 work for MCP?
Some stdio servers may run, but Claude Code Desktop WSL sessions require WSL 2, and Claude Code's setup docs say its sandboxing feature is not supported on WSL 1. Use WSL 2 where you can.











