[BUG] OpenCode MCP adapter rejects documented global user configuration
Describe the bug
APM rejects an explicit global MCP installation for OpenCode even when the user's documented global OpenCode configuration already exists.
To Reproduce
Run:
$ apm install -g --target opencode \
--mcp example --transport http --url https://example.com/mcp
Error: Selected targets are unavailable for user-scope MCP installation
(opencode; source: --target flag); choose a global-capable --target or omit --global
No OpenCode configuration is changed.
Expected behavior
apm install -g --target opencode should support MCP deployment to OpenCode's documented global configuration and preserve unrelated existing settings.
Project-scoped OpenCode installation should continue to use project opencode.json independently.
Environment (please complete the following information):
- OS: macOS
- Python Version: 3.14.7
- APM Version: 0.31.0 installed with Homebrew
- VSCode Version (if relevant): Not applicable
Logs
The complete relevant error is included in the reproduction above.
Additional context
APM's OpenCode adapter explicitly disables user scope, selects project-root opencode.json, and requires a project .opencode/ directory. The global MCP installer then rejects adapters without user-scope support.
OpenCode documents a supported user-level configuration model:
- Its global configuration is
~/.config/opencode/opencode.jsonand applies user-wide. - Its configuration locations are merged, preserving non-conflicting settings from each source.
- MCP servers are declared under the top-level
mcpkey. - A remote MCP entry uses
type: "remote",url, and optional fields such asenabledandheaders.
Triage recommendation: needs-design
Thanks for the detailed reproduction and the linked source references -- this is a well-evidenced gap. The OpenCode adapter currently hard-disables user scope and requires a project .opencode/ directory, so the global MCP installer correctly (if unhelpfully) rejects it as a global-capable target, even though OpenCode itself documents a supported, mergeable global ~/.config/opencode/opencode.json.
This isn't a simple flip of a flag: enabling user-scope for OpenCode means designing how project-scoped and global-scoped opencode.json configs coexist without clobbering each other, given OpenCode's documented config-merge behavior. That boundary (which settings are global vs. project, and how the two interact) needs to be settled before implementation.
Suggested next step: a maintainer familiar with the MCP integration/adapter layer should confirm whether OpenCode's merge model can be safely mapped onto APM's existing user/project scope split, or whether new scope semantics are needed.
This is advisory only -- a responsible maintainer still confirms scope and design direction per GOVERNANCE.md.
Automated triage advisory. Not a human scope decision.
Generated by Triage Panel · copilot · auto · 110.9 AIC · ⌖ 5.97 AIC · ⊞ 12K · ◷
Duplicate of #3104
Accepted as covered by the existing canonical work; closing this duplicate, not rejecting the capability or claiming the bug is fixed.
Daniel explicitly approved this consolidation. The human-approved scope on #3104 already covers OpenCode user-scope MCP installation and uninstallation, including apm install -g --mcp, preserving unrelated configuration and the existing parse, path and file-permission safeguards.
Preserve this report's explicit --target opencode --transport http reproduction as a regression case for that work. A cross-reference has been added to #3104 so the HTTP example remains visible in the canonical issue.
The canonical review contact remains @sergio-sisternes-epam, and @alvedder's existing PR #3100 remains the proposed implementation lane. This disposition does not assign work, approve that PR, authorize a competing implementation, or restart delivery.
Retain status/accepted. The GitHub closure reason is not_planned for the duplicate issue, not rejection of the accepted work in #3104.
Recorded with AI assistance on behalf of @danielmeppiel after his explicit instruction to consolidate and close this duplicate.