MongoDB MCP fails outside Editor window mode: npm prefix resolves to Cursor app resources path (ENOENT), and MCP tools may not register

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When starting MongoDB MCP in non-Editor window mode, MCP startup can fail with npm ENOENT errors pointing to a Cursor app internal path. In some runs, MongoDB tools are also missing from the available MCP tool list.
Switching to Editor window mode makes MCP startup work normally with the same workspace.

Steps to Reproduce

Configure MongoDB MCP in workspace .cursor/mcp.json using stdio + npx (or a launcher script that calls npx mongodb-mcp-server).
Start Cursor in a non-Editor window mode.
Trigger any MongoDB MCP call (e.g. list databases).
Observe startup failure / missing tool registration.
Switch to Editor window mode and retry with same config.
Observe MCP starts normally.

Expected Behavior

MCP should start reliably in all Cursor window/session modes.
npm runtime should not resolve prefix to Cursor internal app resources.
MongoDB MCP tools should be consistently registered and callable.

Operating System

MacOS

Version Information

Cursor version: 3.3.16
Cursor build: 3.3.16
OS: macOS 26.4.1 (25E253)
Kernel: Darwin 25.4.0 arm64

Additional Information

Error Logs:
npm error code ENOENT
npm error syscall lstat
npm error path /Applications/Cursor.app/Contents/Resources/app/resources/lib
npm error errno -2
npm error enoent ENOENT: no such file or directory, lstat ‘/Applications/Cursor.app/Contents/Resources/app/resources/lib’
npm error enoent This is related to npm not being able to find a file.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Thanks for the feedback @Haiwei_Wang! This is a known bug that’s gaining traction pretty quickly.

Two known workarounds:

  1. Set command to the absolute path of system npx (e.g., /Users/<user>/.nvm/versions/node/<version>/bin/npx)
  2. Add "env": { "NPM_CONFIG_PREFIX": "<npm config get prefix value>" } to each MCP server entry in mcp.json

Thank you for your reply. I’ll try these methods later.