Skip to content

[BUG] Windows: plugin-shipped MCP servers using bare npx fail with spawn ENOENT (LSP fix from #17312 missed the MCP spawn path) #58510

Closed as not planned

Description

@JohnOBiner

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

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 -e invocation)
  • 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

  1. added
    bug
    has repro
    platform:windows
    on May 12, 2026
  2. github-actions commented on May 12, 2026

    @github-actions

    Found 2 possible duplicate issues:

    1. [BUG] Local stdio MCP servers not loaded on native Windows #32951
    2. Windows: claude mcp add breaks /c flag, Playwright MCP plugin fails — working workaround #46360

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  3. KyleSlusser commented on May 13, 2026

    @KyleSlusser

    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).

  4. testPerfDave commented on May 19, 2026

    @testPerfDave

    upboat

  5. h-yoda-web commented on May 22, 2026

    @h-yoda-web

    upboat

  6. KyleSlusser commented on May 26, 2026

    @KyleSlusser

    Bump.

  7. BlanckCarbon commented on May 29, 2026

    @BlanckCarbon

    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 .exe shim workaround, so I'm hitting Issue 1 from the original report, not the post-shim Issue 2 that v2.1.132 addressed.

    Environment

    • Claude Code: 2.1.156
    • OS: Windows 11 Enterprise
    • Plugin: typescript-lsp@claude-plugins-official (v1.0.0)
    • LSP server: typescript-language-server@5.3.0, installed via npm install -g
    • Confirmed that the typescript-language-server correctly resolves from PATH

    Repro

    Any LSP tool call against a .ts file:

    LSP { operation: "documentSymbol", filePath: "src/main/traceDelay.ts", line: 1, character: 1 }
    → Error performing documentSymbol: ENOENT: no such file or directory, uv_spawn 'typescript-language-server'
    

    Same error for other symbols. Spawn is failing before any LSP handshake happens. This matches the original Issue 1 pattern: Node's spawn() without shell: true can't resolve .cmd shims on Windows.

  8. augchan42 commented on Jun 8, 2026

    @augchan42

    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 (or npx) as command fails to spawn — even when node.exe is on PATH and resolvable from PowerShell/cmd. The only thing that works without shell: true upstream is hardcoding the absolute path to node.exe and 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 the spawn ENOENT described in the OP.

    Environment:

    • Claude Code 2.1.117 (Windows native, not WSL)
    • Windows 11 Home 10.0.26200
    • Node 22.x installed to C:\Program Files\nodejs\ and on system PATH
    • Same failure across PowerShell 7 and Git Bash launch contexts

    So the suggested fix (mirror the LSP shell: true on win32 from #17312) needs to land in whichever module spawns stdio MCPs regardless of whether the config came from a plugin manifest or user mcpServers.

  9. added
    stale
    on Jun 30, 2026
  10. github-actions commented on Jul 14, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  11. github-actions commented on Sep 12, 2026

    @github-actions

    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.

  12. locked as resolved and limited conversation to collaborators on Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mcparea:pluginsbughas reproplatform:windowsstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions