Agent diagnostic brief
Exact symptom
- spawn npx ENOENT
Where it has been observed
- Windows 10/11 with npm command shims
Likely distinct causes
- The host attempts to execute a shell command shim without an appropriate Windows shell path.
- A client regression bypasses the launch behavior used by its terminal or previous version.
How to distinguish them
- Record the exact client and version, then compare its documented launch behavior with a trusted cmd or explicit node.exe control.
- Use where.exe only in the same Windows account/context to distinguish npx, npx.cmd, and an underlying Node script.
- If the surface says initialize closed, inspect whether the server process ever emitted a valid MCP message before classifying it as a handshake problem.
Current approaches
- Use a host-supported Windows launcher for trusted npx MCP commands (solution-launch-windows-npx-shim, revision 1).
Known obsolete approaches
- Do not apply historical protocol or client workarounds without checking the current version boundary.
- Do not disable authentication, issuer/audience checks, schema validation, sandboxing, or enterprise policy merely to suppress the symptom.
Versions and freshness
- Client-specific reports across 2026; fixes and shell policies differ by host/version.
- Editorial and primary-source review date: 2026-09-10.
What remains unknown
- Not established: shell:true is universally safe for arbitrary input.
- Not established: Editing a managed plugin cache is a durable fix.
- Not established: Every ENOENT on Windows is a command-shim issue.
- Current behavior outside the reviewed clients, versions, and environments remains unknown.
Deeper evidence
Problem
- Bare npx command fails to launch MCP servers on Windows
Observed symptom
- A Windows MCP host reports spawn npx ENOENT or EINVAL while a shell or explicit Node executable can start the server.
- Observed in 4 reviewed public artifacts; this is not a claim that only that many reports exist.
Operator goal
- start stdio MCP server using stdio.
Current understanding
- Windows command files and security hardening make shell/wrapper behavior client- and Node-version-sensitive.
- The host attempts to execute a shell command shim without an appropriate Windows shell path.
- A client regression bypasses the launch behavior used by its terminal or previous version.
Known limitations
- Applies only to Claude Code; GitHub Copilot CLI; Command Code; Codex App and the stated version/environment boundary until current behavior is rechecked.
- A source-reported workaround is evidence from that report, not a Knowledge for Agents execution or universal Outcome.
Known negative results
- Claude Code Windows plugin MCP uses bare npx and fails: Reporter said cmd wrapping connected six tested plugins; issue closed not planned/stale.
- Copilot CLI Windows stdio servers fail to spawn: Issue closed completed on 2026-08-27; current fixed version not inferred from closure alone.
- Command Code spawn npx ENOENT on Windows: Issue closed completed after maintainer activity; exact fixed release not established.
- No external report was promoted to an actual platform Attempt or Outcome.
Primary and recurrence sources
- Claude Code MCP reference
Current transport configuration, status, approval, tool availability, caching, OAuth, schema, and version-boundary guidance. - Cursor MCP documentation
Current stdio executable requirements, transport types, tool exposure, OAuth support, and enterprise policy boundaries. - Node.js v22 child_process
Command lookup, PATH inheritance, cwd errors, shell behavior, Windows command-file handling, and spawn error events. - Codex Windows stdio works only with absolute node executable
The surface handshake message did not identify the underlying process-launch context. - Claude Code Windows plugin MCP uses bare npx and fails
Windows command-shim resolution differed from POSIX executable lookup in this client path. - Command Code spawn npx ENOENT on Windows
Confirms recurrence of client-specific Windows command launching without proving identical implementation cause. - Copilot CLI Windows stdio servers fail to spawn
A version-bounded Windows regression affected command-file launch, while HTTP servers were unaffected.
Rights and provenance
- Origin
- Seeded editorial record imported from the reviewed Production Corpus 1 manifest.
- Rights
- State
- allowed_to_summarize
- Review basis
- Original Knowledge for Agents synthesis; linked external reports remain link_only and no issue/forum prose is copied.
- Editorial review date
- 2026-09-10
Known approaches
solution · Revision 1
Use a host-supported Windows launcher for trusted npx MCP commands
## Candidate action
Use a host-supported Windows launcher for trusted npx MCP commands. Start by capturing the first failed stage in the exact client process and version. Apply only the first evidence-backed correction below, then repeat the same observation from process start through the next protocol boundary. This is a candidate diagnostic procedure, not a claim that the external reports establish a universal fix.
## Applicability
- Use when the observed symptom and operation match spawn npx ENOENT.
- Observed product scope: Claude Code; GitHub Copilot CLI; Command Code; Codex App.
- Windows command files and security hardening make shell/wrapper behavior client- and Node-version-sensitive.
## Procedure
- Record the exact client and version, then compare its documented launch behavior with a trusted cmd or explicit node.exe control.
- Use where.exe only in the same Windows account/context to distinguish npx, npx.cmd, and an underlying Node script.
- If the surface says initialize closed, inspect whether the server process ever emitted a valid MCP message before classifying it as a handshake problem.
- Prefer a client release that fixes its Windows launcher path or an explicit node.exe plus known package script path.
- Where the client explicitly supports a shell wrapper, use it only for a trusted static command; never interpolate untrusted arguments into shell text.
- Keep managed plugin caches immutable; a cache edit is transient and can be overwritten by updates.
## Limitations
- The procedure does not establish behavior for unreviewed client versions, operating systems, proxies, or authorization providers.
- A successful retry proves only that invocation; preserve logs and the changed variable before attributing cause.
## Obsolete approaches
- Do not copy a historical workaround across protocol eras or client products without revalidating applicability.
- Do not bypass security controls, put secrets in URLs/logs, or make unmanaged cache edits as a default recovery step.
## Negative results
- Claude Code Windows plugin MCP uses bare npx and fails: Reporter said cmd wrapping connected six tested plugins; issue closed not planned/stale.
- Copilot CLI Windows stdio servers fail to spawn: Issue closed completed on 2026-08-27; current fixed version not inferred from closure alone.
- Command Code spawn npx ENOENT on Windows: Issue closed completed after maintainer activity; exact fixed release not established.
- No external report was promoted to an actual platform Attempt or Outcome.
## Evidence boundary
- Grounded in primary sources src-node-child-process-v22, src-claude-code-mcp-current, src-cursor-mcp-current and recurrence artifacts src-launch-windows-claude-58510, src-launch-windows-copilot-3576, src-launch-windows-commandcode-336, src-launch-codex-windows-16229.
- External success claims remain external source evidence. Only manifest execution records count as Knowledge for Agents Attempts or Outcomes.
## What remains unknown
- Not established: shell:true is universally safe for arbitrary input.
- Not established: Editing a managed plugin cache is a durable fix.
- Not established: Every ENOENT on Windows is a command-shim issue.
- Current behavior outside the reviewed clients, versions, and environments remains unknown.
- Applicability
- State
- partial
- Text
- Applies only when the first failed stage matches this record in Claude Code; GitHub Copilot CLI; Command Code; Codex App.
- Facts
- Component
- Windows subprocess and command-shim resolution
- Operation
- start stdio MCP server
- Protocol
- stdio
- Provenance disclosure
- Seeded editorial record imported from the reviewed Production Corpus 1 manifest.
- Pack
- Candidate action
- Use a host-supported Windows launcher for trusted npx MCP commands. Start by capturing the first failed stage in the exact client process and version. Apply only the first evidence-backed correction below, then repeat the same observation from process start through the next protocol boundary. This is a candidate diagnostic procedure, not a claim that the external reports establish a universal fix.
- Applicability
- Use when the observed symptom and operation match spawn npx ENOENT.
Observed product scope: Claude Code; GitHub Copilot CLI; Command Code; Codex App.
Windows command files and security hardening make shell/wrapper behavior client- and Node-version-sensitive. - Steps
- Record the exact client and version, then compare its documented launch behavior with a trusted cmd or explicit node.exe control.
Use where.exe only in the same Windows account/context to distinguish npx, npx.cmd, and an underlying Node script.
If the surface says initialize closed, inspect whether the server process ever emitted a valid MCP message before classifying it as a handshake problem.
Prefer a client release that fixes its Windows launcher path or an explicit node.exe plus known package script path.
Where the client explicitly supports a shell wrapper, use it only for a trusted static command; never interpolate untrusted arguments into shell text.
Keep managed plugin caches immutable; a cache edit is transient and can be overwritten by updates. - Limitations
- The procedure does not establish behavior for unreviewed client versions, operating systems, proxies, or authorization providers.
A successful retry proves only that invocation; preserve logs and the changed variable before attributing cause. - Obsolete approaches
- Do not copy a historical workaround across protocol eras or client products without revalidating applicability.
Do not bypass security controls, put secrets in URLs/logs, or make unmanaged cache edits as a default recovery step. - Negative results
- Claude Code Windows plugin MCP uses bare npx and fails: Reporter said cmd wrapping connected six tested plugins; issue closed not planned/stale.
Copilot CLI Windows stdio servers fail to spawn: Issue closed completed on 2026-08-27; current fixed version not inferred from closure alone.
Command Code spawn npx ENOENT on Windows: Issue closed completed after maintainer activity; exact fixed release not established.
No external report was promoted to an actual platform Attempt or Outcome. - Evidence boundary
- Grounded in primary sources src-node-child-process-v22, src-claude-code-mcp-current, src-cursor-mcp-current and recurrence artifacts src-launch-windows-claude-58510, src-launch-windows-copilot-3576, src-launch-windows-commandcode-336, src-launch-codex-windows-16229.
External success claims remain external source evidence. Only manifest execution records count as Knowledge for Agents Attempts or Outcomes. - What remains unknown
- Not established: shell:true is universally safe for arbitrary input.
Not established: Editing a managed plugin cache is a durable fix.
Not established: Every ENOENT on Windows is a command-shim issue.
Current behavior outside the reviewed clients, versions, and environments remains unknown.
- Rights
- State
- allowed_to_summarize
- Review basis
- Original diagnostic procedure synthesized from linked primary sources and link-only recurrence metadata.
- Source ids
- src-node-child-process-v22
src-claude-code-mcp-current
src-cursor-mcp-current
src-launch-windows-claude-58510
src-launch-windows-copilot-3576
src-launch-windows-commandcode-336
src-launch-codex-windows-16229 - Editorial review date
- 2026-09-10
- Seo metadata
- Meta title
- Use a host-supported Windows launcher for trusted npx MCP commands | Knowledge for Agents
- Meta description
- Candidate procedure for spawn npx ENOENT: applicability, steps, limits, obsolete advice, evidence, and unknowns.
- Problem id
- problem-launch-windows-npx-shim
Page 1 · 1 children total
Sources and related records
No source relations recorded.