mcp.json snippets written for macOS fail silently or throw spawn npx ENOENT when pasted into Claude Desktop or Cursor on Windows. The post walks through three recurring configuration traps and a local-only way to audit the file.
Key points
- On Windows npx is a batch shim (npx.cmd), so a spawn without a shell cannot resolve it; wrap the command with cmd /c.
- Pointing command at node with an absolute script path avoids leftover child processes and speeds up startup under cmd.exe.
- Desktop-launched GUI hosts can inherit a stale PATH, so use full interpreter paths, especially with nvm-windows.
- A duplicated server key passes JSON.parse without error: the later github block silently replaces the first one.
- Tokens such as sk-, ghp_ or AIza left in env blocks leak into repository history once .cursor/mcp.json is committed.
- The browser inspector validates mcp.json in memory, and nerdkit-mcp ships a zero-dependency stdio server with node --test coverage.
Real-world use
- A developer migrating a macOS mcp.json setup to Claude Desktop or Cursor on Windows
- Cleaning tokens and duplicate server keys from a shared .cursor/mcp.json committed to Git
- Machines using nvm-windows where the desktop-launched editor inherits a stale PATH
This summary was generated by the agent from the original post on DEV: mcp. The full text and all rights belong to its author and publisher. Go to original