Skip to content

OpenCode integration writes invalid MCP config across wrap, mcp install, and persistent install #1380

Description

@rudironsoni

Problem

OpenCode integration config is inconsistent across wrap, mcp install, and persistent install.

1. wrap opencode writes remote /mcp

headroom wrap opencode writes:

"headroom": {
  "type": "remote",
  "url": "http://127.0.0.1:8787/mcp",
  "enabled": true
}

But the Headroom proxy does not expose MCP at /mcp; it returns 404. Headroom MCP is a stdio server launched with headroom mcp serve.

2. OpencodeRegistrar writes invalid local command config

headroom mcp install --agent opencode serializes stdio MCP as:

{
  "type": "remote",
  "url": "",
  "enabled": true,
  "command": ["headroom", "mcp", "serve"]
}

OpenCode's schema expects local MCP config to use:

{
  "type": "local",
  "command": ["headroom", "mcp", "serve"],
  "enabled": true
}

Environment variables belong under environment, not env.

3. --no-mcp still writes persistent MCP

headroom wrap opencode --no-mcp skips runtime MCP config but inject_opencode_provider_config() still writes mcp.headroom into opencode.json.

4. mcp uninstall/status are not symmetric with install

headroom mcp install supports multiple registrars, including OpenCode, but headroom mcp uninstall and headroom mcp status only handle Claude Code and ~/.claude/mcp.json.

5. Persistent install docs/CLI are inconsistent

Docs say:

headroom install apply --preset persistent-service --providers manual --target opencode

But --target opencode is not accepted by the CLI choice list.

Also, default scope is user, while OpenCode config mutation only happens in provider scope, so the documented command does not write OpenCode config.

Expected behavior

OpenCode MCP should be configured as local stdio:

"headroom": {
  "type": "local",
  "command": ["headroom", "mcp", "serve"],
  "enabled": true
}

For custom proxy ports:

"environment": {
  "HEADROOM_PROXY_URL": "http://127.0.0.1:9000"
}

--no-mcp should not write mcp.headroom.

mcp uninstall/status should use the same registrar set as install, or clearly document that they are Claude-only.

Persistent install should accept --target opencode and docs should show --scope provider when relying on direct OpenCode config mutation.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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