MCP server process leak

Hey, thanks for the report. This is a known issue. MCP child processes don’t get cleaned up when you close the window or restart the extension host.

Related reports:

The team is aware. There’s no ETA yet, but your report helps us prioritize, especially the numbers on process buildup and memory impact.

For now, a few workarounds:

  1. Periodically kill orphaned processes manually: pkill -f mongodb-mcp-server (or your server’s process name).
  2. Some MCP server authors added stdin POLLHUP handling. When Cursor exits, stdin closes and the server shuts down on its own. There’s a gist with this approach if you want to apply it to custom servers.

Not ideal, but it should help keep memory usage under control until we fix this properly.

1 Like