Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Cursor does not clean up MCP server child processes when the extension host restarts or a window closes. Over multiple days, dozens of orphaned node and npm exec processes accumulate and leak ~3-5 GB of memory.
Each MCP config entry spawns 2 processes (npm exec wrapper + node server). With 3 entries, that is 6 processes per session. After 3 days: 30+ orphans, ~3-5 GB RSS total.
Steps to Reproduce
- Configure MCP servers in
.cursor/mcp.json - Use Cursor normally over 2-3 days (open/close windows, restart the IDE)
- Run
ps aux | grep mongodb-mcp-serverand observe processes from previous sessions still alive
Expected Behavior
When the extension host dies or a window closes, all MCP child processes (including npm exec grandchildren) should receive SIGTERM.
Operating System
MacOS
Version Information
IDE 2.4.31
Does this stop you from using Cursor
No - Cursor works, but with this issue
Probably related Exiting the cursor will not kill the mcp process