Skip to content

fix: local MCP servers spawn twice, once for home dir #51709

Description

@dragon-Elec

Description

Each local MCP server spawns twice at startup under the same opencode serve --service parent. The log shows one mcp connected per server with directory=<project>, and a second with directory=/home/ray. Both stay alive for the whole session.

Only one session is open (session_v2 has a single row updated in the last hour, in the project dir). Killing the service and relaunching from the project dir does not fix it — the home pair comes back at launch ("starting bg server" on every start).

Plugins

opencode-magic-context, aft-opencode, oh-my-opencode-slim, local V2 adapter (file shim in ~/.config/opencode/plugins/)

OpenCode version

2.0.18

Steps to reproduce

  1. Configure a local MCP server (I have daisyui + skeleton-ui).
  2. cd <project> && opencode
  3. Check processes: ps -o pid,ppid,lstart,rss,args | grep mcp_server — two processes per server, started the same second.
  4. Check the log: two mcp connected lines per server, one with directory=<project>, one with directory=/home/ray.

Operating System

Ubuntu (Linux x64)

Terminal

opencode TUI

Activity

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