First of all, thanks for this nice MCP server! Great work.
Description / Problem Statement
When deploying the rohlik-mcp server under Claude Desktop, it fails with the error:
spawn npx ENOENT
Server disconnected. Transport closed unexpectedly.
Even though npx, node, and npm are correctly installed and available in the user shell (which npx returns a valid path). This indicates that the Claude Desktop runtime environment’s PATH does not include the directory where npx resides.
Steps to Reproduce
- Use default MCP server config pointing
"command": "npx"
- Run Claude Desktop (or invoke the MCP)
- Observe
spawn npx ENOENT errors in the logs
- Change config to use absolute path to
npx (e.g. /Users/adam/.local/share/mise/installs/node/22.14.0/bin/npx)
- Restart Claude Desktop
- MCP server initializes correctly and connects
Observed Behavior
- The system errors out with
spawn npx ENOENT.
- The MCP server never properly launches via the wrapper.
- After overriding
command with absolute path, the MCP server works.
Expected Behavior
- The MCP wrapper should resolve/locate
npx correctly within the environment where Claude Desktop invokes it.
- Fallback or detection logic should allow using an absolute path if
npx isn’t in the default PATH.
Suggested Fix / Improvements
- Inform about this in the README
- Add logic to detect
npx via environment variables or a fallback search (e.g. which npx) if spawn "npx" fails.
- Allow specifying an absolute path for the
command in config (already working as workaround).
Environment Details
- macOS (or environment using Claude Desktop)
- Node.js v22.14.0
- npm 10.9.2
npx is located at /Users/adam/.local/share/mise/installs/node/22.14.0/bin/npx
- MCP config works when overriding
"command" to that absolute path
Full Stack / Log Snippet
2025-10-11T08:17:57.102Z [info] [rohlik] Using MCP server command: npx with args and path: { … }
2025-10-11T08:17:57.103Z [error] [rohlik] spawn npx ENOENT
2025-10-11T08:17:57.104Z [error] [rohlik] spawn npx ENOENT
2025-10-11T08:17:57.105Z [info] [rohlik] Server transport closed
…
2025-10-11T08:18:37.323Z [error] [rohlik] spawn npx ENOENT
…
Server disconnected. For troubleshooting guidance, see debugging docs.
First of all, thanks for this nice MCP server! Great work.
Description / Problem Statement
When deploying the
rohlik-mcpserver under Claude Desktop, it fails with the error:Even though
npx,node, andnpmare correctly installed and available in the user shell (which npxreturns a valid path). This indicates that the Claude Desktop runtime environment’sPATHdoes not include the directory wherenpxresides.Steps to Reproduce
"command": "npx"spawn npx ENOENTerrors in the logsnpx(e.g./Users/adam/.local/share/mise/installs/node/22.14.0/bin/npx)Observed Behavior
spawn npx ENOENT.commandwith absolute path, the MCP server works.Expected Behavior
npxcorrectly within the environment where Claude Desktop invokes it.npxisn’t in the default PATH.Suggested Fix / Improvements
npxvia environment variables or a fallback search (e.g.which npx) ifspawn "npx"fails.commandin config (already working as workaround).Environment Details
npxis located at/Users/adam/.local/share/mise/installs/node/22.14.0/bin/npx"command"to that absolute pathFull Stack / Log Snippet