Skip to content

local MCP server child processes become orphaned on restart #30073

Closed as not planned

Description

@waterundman

Description

When opencode is restarted (e.g., during an update), its child MCP server
processes (configured as "local" type in opencode.json) are not always
killed. Over multiple restarts, orphan processes accumulate.

Steps to reproduce:

  1. Configure a local MCP server (e.g., blender-mcp)
  2. Restart opencode several times (e.g., via updates)
  3. Observe that old MCP processes remain running: Get-Process blender-mcp
    shows multiple instances with different start times

Expected: MCP child processes are terminated when opencode exits.
Actual: Orphan processes are left running, potentially causing port conflicts
and resource leaks.

Suggested fix: On Windows, use a Job Object to bind child process lifetime
to the parent. On Unix, use process groups.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on May 31, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. github-actions commented on Jul 31, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions