GeezerVison is showing github.com — Local (stdio) MCP processes leak — new processes spawned per session, never cleaned up · Issue #19168 · anomalyco/opencode
Local (stdio) MCP processes leak — new processes spawned per session, never cleaned up #19168
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)perfIndicates a performance issue or need for optimization Description
Description
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.
Steps to reproduce
- Configure a local MCP in
opencode.json, e.g.:
"firefox-devtools": {
"type": "local",
"command": ["npx", "@padenot/firefox-devtools-mcp", "--firefox-path", "..."]
}
- 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.
Plugins
opencode-pty, opencode-wakatime
OpenCode version
v1.3.0
Operating System
macOS (Apple Silicon)
Terminal
Ghostty
Activity
added
coreAnything pertaining to core functionality of the application (opencode server stuff) perfIndicates a performance issue or need for optimization on Mar 25, 2026github-actions commented on Mar 25, 2026
This issue might be a duplicate of existing issues. Please check:
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 commented on Mar 26, 2026
ContributorAuthor
More actions
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: 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.
added 5 commits that reference this issue
on Mar 26, 2026This issue will close once commit 860a7b8 is merged into the 'dev' branch.860a7b8 This issue will close once commit 74d4ff1 is merged into the 'dev' branch.74d4ff1 This issue will close once commit 141d912 is merged into the 'dev' branch.141d912 This issue will close once commit ebdecf2 is merged into the 'dev' branch.ebdecf2 added a commit that references this issue
on Sep 19, 2026This issue will close once commit f4ef3b4 is merged into the 'dev' branch.f4ef3b4
Metadata
Metadata
coreAnything pertaining to core functionality of the application (opencode server stuff)perfIndicates a performance issue or need for optimization Development
No branches or pull requestsIssue actions