Repository navigation
Description
Summary
Plugin-shipped stdio MCP servers that use bare npx as their command (the default for most official plugins) fail with spawn npx ENOENT on Windows. The LSP spawn fix from #17312 (landed in v2.1.132) addressed the equivalent bug for LSP plugins but didn't extend to the MCP server spawn path — so MCP plugins are still broken in the same way.
This affects every official plugin I tested whose .mcp.json / plugin.json ships "command": "npx".
Affected official plugins (as of 2.1.139)
All of these Failed to connect until I manually wrapped each with cmd /c:
| Plugin | Config location | Command shipped |
|---|---|---|
context7@claude-plugins-official |
.mcp.json |
npx -y @upstash/context7-mcp |
chrome-devtools-mcp@claude-plugins-official |
.claude-plugin/plugin.json (inline) |
npx chrome-devtools-mcp@latest |
azure@claude-plugins-official |
.mcp.json |
npx -y @azure/mcp@latest server start |
mongodb@claude-plugins-official |
mcp.json (referenced from plugin.json) |
npx -y mongodb-mcp-server@1 |
desktop-commander@claude-plugins-official |
.claude-plugin/plugin.json (inline) |
npx -y @wonderwhy-er/desktop-commander@latest |
playwright@claude-plugins-official |
.mcp.json |
npx @playwright/mcp@latest |
Reproducer (no Claude Code needed)
const { spawn } = require('child_process');
const p = spawn('npx', ['-y', '@upstash/context7-mcp', '--version'], { stdio: 'inherit' });
p.on('error', e => console.error('SPAWN ERROR:', e.code, e.message));On Windows 10/11, Node 20.x or 22.x:
SPAWN ERROR: ENOENT spawn npx ENOENT
With { shell: true } (or wrapping in cmd /c), it succeeds immediately:
2.2.5
Root cause
On Windows, npx is the batch shim npx.cmd. Node's child_process.spawn only resolves .cmd/.bat extensions via PATHEXT when shell: true (or shell: 'cmd.exe') is set, or when the caller passes the explicit .cmd filename. This is the same Node-on-Windows pattern that #17312 fixed for LSP server spawning in v2.1.132.
Expected behavior
The MCP server spawn path should use shell: true (or equivalent) on process.platform === 'win32' — matching whatever the LSP path now does post-#17312.
Workaround (fragile)
Edit each plugin's manifest under ~/.claude/plugins/cache/<marketplace>/<plugin>/<version>/... to wrap the command:
- "command": "npx",
- "args": ["-y", "@upstash/context7-mcp"]
+ "command": "cmd",
+ "args": ["/c", "npx", "-y", "@upstash/context7-mcp"]This works (verified all 6 plugins above now show ✓ Connected), but gets wiped whenever the plugin updates, since the patched files live in the plugin cache rather than in any user-owned config.
Note: the location of the MCP block varies across plugins — .mcp.json at the install root, mcpServers inline in .claude-plugin/plugin.json, or a separate mcp.json referenced from plugin.json. The patch has to land in whichever file the plugin actually uses, and claude mcp list doesn't tell you which.
Why this is distinct from existing open issues
- Windows: claude mcp add breaks /c flag, Playwright MCP plugin fails — working workaround #46360 (Playwright/Windows) is about the
claude mcp addCLI mangling/cintoC:/for user-configured servers. This issue is about plugin-shipped configs that never go throughclaude mcp add. - [BUG] Local stdio MCP servers not loaded on native Windows #32951 (local stdio MCP not loaded on native Windows) is about local servers being silently absent from
/mcp. Here the servers do appear inclaude mcp list— they just fail at the spawn step with a visible "Failed to connect". - [BUG] Claude Code - LSP Tool Returns Empty Results Despite Server Responding Correctly (Windows) #17312 / typescript-lsp plugin fails on Windows: spawn ENOENT for npm global binaries #19658 / LSP plugins fail on Windows with "spawn ENOENT" error #21115 are all LSP-specific. The fix that closed them addressed the LSP code path; the MCP path has the same bug and needs the same fix.
Environment
- Claude Code: 2.1.139 (latest as of filing)
- OS: Windows 10 Pro 10.0.19045
- Node: tested on 20.15.0 and 22.22.2 — both reproduce the spawn ENOENT
- Shell: PowerShell 7 (also reproduces from Git Bash and a raw
node -einvocation) - Plugin marketplace:
claude-plugins-official
Suggested fix
In whatever module spawns stdio MCP servers, mirror the LSP fix from #17312 — pass shell: true (or shell: 'cmd.exe') when process.platform === 'win32'. Same one-line change that worked for LSP should clear this entire category of plugin failures.
Activity
github-actions commentedon May 12, 2026
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
KyleSlusser commentedon May 13, 2026
This needs to stay open. Multiple other issues have been closed without resolution and marked as duplicates. You cannot allow items to be marked as duplicate if no fix is provided. This was supposed to have been fixed, but I can confirm it's still present in the current version (2.1.140 at time of writing).
testPerfDave commentedon May 19, 2026
upboat
h-yoda-web commentedon May 22, 2026
upboat
KyleSlusser commentedon May 26, 2026
Bump.
BlanckCarbon commentedon May 29, 2026
Still reproducing on v2.1.156. The original ENOENT on the LSP spawn path is back (or was never fully fixed). I never built the
.exeshim workaround, so I'm hitting Issue 1 from the original report, not the post-shim Issue 2 that v2.1.132 addressed.Environment
typescript-lsp@claude-plugins-official(v1.0.0)typescript-language-server@5.3.0, installed vianpm install -gRepro
Any LSP tool call against a
.tsfile:Same error for other symbols. Spawn is failing before any LSP handshake happens. This matches the original Issue 1 pattern: Node's
spawn()withoutshell: truecan't resolve.cmdshims on Windows.augchan42 commentedon Jun 8, 2026
Same root cause hits user-configured stdio MCP servers too, not only plugin-shipped ones. On Windows 11 with Claude Code 2.1.117, a plain
node(ornpx) ascommandfails to spawn — even whennode.exeis onPATHand resolvable from PowerShell/cmd. The only thing that works withoutshell: trueupstream is hardcoding the absolute path tonode.exeand the absolute path to the server entrypoint:{ "mcpServers": { "filesystem": { "command": "C:\Program Files\nodejs\node.exe", "args": [ "C:\Users\<user>\AppData\Roaming\npm\node_modules\@modelcontextprotocol\server-filesystem\dist\index.js", "C:\Users\<user>\Desktop", "C:\Users\<user>\Downloads", "C:\Users\<user>\Documents" ] } } }Reverting to the documented form (
"command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", ...]) reproduces thespawn ENOENTdescribed in the OP.Environment:
C:\Program Files\nodejs\and on systemPATHSo the suggested fix (mirror the LSP
shell: trueonwin32from #17312) needs to land in whichever module spawns stdio MCPs regardless of whether the config came from a plugin manifest or usermcpServers.docs(mcp-servers): correct Windows npx spawn generalization (claude-c…
feat(miro): ship bundled Miro MCP server as a dedicated plugin (#101)
github-actions commentedon Jul 14, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Sep 12, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.