You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Local (stdio) MCP processes leak — new processes spawned per session, never cleaned up #19168
Local MCP servers configured with "type": "local" (stdio transport) spawn a new process for every session opened, but the processes are never terminated when the session ends. Over time this leads to a large number of orphaned processes consuming significant memory.
Open and close several sessions in OpenCode Desktop or the web UI
Check running processes: ps aux | grep firefox-devtools-mcp
Expected behaviour
When a session ends, the stdio MCP child process it spawned should be terminated.
Observed behaviour
Each session spawns a new npm exec + node process pair. After ~12 sessions, 24 orphaned processes were running consuming ~1.2GB RSS combined. They are never cleaned up until the host process is restarted or they are killed manually.
If your issue is distinct from these (e.g. specifically about the stdio/local transport teardown path rather than crash orphans or concurrent-session sharing), please clarify how it differs so it can be tracked separately.
The specific case here is: after a clean session close (no crash, single session), the stdio/local-transport child processes are not terminated. The teardown path for type: local MCP connections doesn't appear to send SIGTERM to the child before the session is destroyed. Keeping this open as it's a distinct and more precisely scoped bug.
Activity
github-actions commentedon Mar 25, 2026
This issue might be a duplicate of existing issues. Please check:
ps aux | grep)If your issue is distinct from these (e.g. specifically about the stdio/local transport teardown path rather than crash orphans or concurrent-session sharing), please clarify how it differs so it can be tracked separately.
athal7 commentedon Mar 26, 2026
Thanks for the references. Checking each:
The specific case here is: after a clean session close (no crash, single session), the stdio/local-transport child processes are not terminated. The teardown path for
type: localMCP connections doesn't appear to send SIGTERM to the child before the session is destroyed. Keeping this open as it's a distinct and more precisely scoped bug.fix(mcp): close transport on failed/timed-out connections
fix(mcp): close transport on failed/timed-out connections
fix(mcp): close transport on failed/timed-out connections
fix(mcp): close transport on failed/timed-out connections
fix(mcp): close transport on failed/timed-out connections