Fixing 'spawn npx ENOENT' on Windows and Auditing mcp.json Configs (+ Zero-Dependency DevTools MCP Server)
Copy-pasting an mcp.json snippet meant for macOS into Claude Desktop or Cursor on Windows often fails silently or throws spawn npx ENOENT. Most of the failures come down to the same three configuration traps. 1
Copy-pasting an mcp.json snippet meant for macOS into Claude Desktop or Cursor on Windows often fails silently or throws spawn npx ENOENT. Most of the failures come down to the same three configuration traps.
1. Why "command": "npx" Fails with ENOENT on Windows
On macOS and Linux, npx resolves directly to an executable binary. On Windows, Node.js installs npx.cmdβa batch shim rather than a native PE binary. When an Electron host calls child_process.spawn("npx", ...) with shell: false, Windows cannot resolve npx without a shell wrapper.
Wrap the command with cmd /c:
{
"mcpServers": {
"filesystem": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@modelcontextprotocol/server-filesystem",
"C:/Users/me/projects"
]
}
}
}
Better yet, if you run a local script, point "command" directly at node and pass the script pathβstartup is faster and process termination does not orphan child Node processes under cmd.exe.
2. PATH Mismatches and Relative Args
GUI applications launched from the desktop frequently inherit an older PATH than your interactive shell (especially under nvm-windows). Using the full interpreter path and absolute script paths prevents ENOENT regardless of the IDE working directory.
3. Silent Duplicate Server Keys and Hardcoded env Secrets
Two subtle issues break teams when .cursor/mcp.json gets checked into Git:
- Standard
JSON.parsesilently lets a second"github"entry overwrite an earlier"github"block without raising a syntax error. - Leaving
sk-...,ghp_..., orAIza...tokens insideenvblocks leaks credentials into repository history.
Browser mcp.json Inspector & Zero-Dependency Local MCP Server
If you want to validate mcp.json completely in browser memory without sending your config or tokens to a remote backend:
-
Browser
mcp.jsonInspector (0 bytes uploaded): https://global-utils.com/en/mcp-inspector
I also packaged four offline engineering utilities into a zero-dependency Node.js (>=18) MCP stdio server with MIT license and node --test coverage:
-
Open-Source Repo (
nerdkit-mcp): https://github.com/JangYS0/nerdkit-mcp-
redact_har_secrets(Browser UI) -
analyze_postgres_explain(Browser Flamegraph) -
calculate_llm_vram(Browser Calculator) -
lint_mcp_config(Browser Inspector)
-
Clone it and run npm test to see real JSON-RPC 2.0 stdio test coverage across all four tools.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.