Skip to content

[Bug] MCP processes not terminated after session ends #6633

Closed

Description

@chadongmin

Environment

  • OS: macOS
  • opencode version: latest

Bug Description

MCP processes spawned by opencode are not terminated when the session ends. Over time, zombie processes accumulate and require manual cleanup.

Steps to Reproduce

  1. Start opencode session
  2. Use any MCP tool (e.g., interactive-review, postgresql-mcp)
  3. Exit opencode session (or start a new session)
  4. Check running processes: ps aux | grep mcp

Expected Behavior

MCP processes should be terminated when the opencode session ends.

Actual Behavior

MCP processes remain running indefinitely after session ends.

# Example: Multiple zombie processes from different sessions
trevari  5810  5:18PM  node postgresql-mcp-server/build/index.js
trevari  5809  5:18PM  node postgresql-mcp-server/build/index.js
trevari  5808  5:18PM  uv run interactive-review/mcp-server server.py
trevari  91128 11:45AM node postgresql-mcp-server/build/index.js  # 7 hours old
trevari  91127 11:45AM node postgresql-mcp-server/build/index.js  # 7 hours old

Workaround

Manual cleanup required:

pkill -f "interactive-review"
pkill -f "postgresql-mcp"

Additional Context

  • Confirmed this is NOT an issue with individual MCP servers
  • Multiple MCP types (interactive-review, postgresql-mcp) exhibit the same behavior
  • Different TTY sessions (ttys000, ttys004) have orphaned processes

Activity

  1. github-actions commented on Jan 2, 2026

    @github-actions
    Contributor

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

    Feel free to ignore if none of these address your specific case.

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