config: V2 silently ignores MCP servers defined directly under `mcp` instead of `mcp.servers`
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 半天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
首先根据文档中的 JSON schema 复现 V1 mcp 配置,然后跟踪配置加载过程和 opencode mcp list 命令。添加回归检查,以覆盖对现有结构的支持,或发出警告,指出无法识别的键和预期的 mcp.servers.<name> 路径。完成的标准是已定义的服务器不再被静默忽略,并且失败能够被看到。
由索引模型根据 Issue 内容生成。
描述
Summary
V2 config silently ignores an MCP server placed directly under mcp instead of mcp.servers, with no warning. opencode mcp list reports "No MCP servers configured" while the config file clearly contains one, so a broken integration looks like a working config.
Environment
- opencode version: 2.0.32
- OS: Windows_NT 10.0.26300 (win32 x64)
- Terminal: desktop app (OpenCode.exe) +
opencode-cli.exe - Shell: n/a (desktop app)
- Install/channel: latest (desktop,
@opencodedesktop) - Active plugins: none configured
Reproduction
- Put an MCP server under
mcp(the V1 shape):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"roam": {
"type": "local",
"command": ["node", "/path/to/server.mjs", "serve"]
}
}
}
- Restart OpenCode (or restart the service).
- Run
opencode mcp list.
Expected Behavior
Either the server connects, or OpenCode tells me the key is wrong — for example a warning that mcp.roam is not a recognised shape and that V2 expects mcp.servers.roam. The V1-to-V2 migration guide notes V1 config files "are intended to remain compatible", so silently dropping an entire server definition leaves the user with a config file that looks correct and a tool that has been unavailable for weeks.
Actual Behavior
No error, no warning, no migration hint:
$ opencode mcp list
No MCP servers configured
The agent simply has no tools from that server. In my case this went unnoticed for a long time because the missing tool's absence looked like the agent choosing a different approach, rather than a config mistake.
For contrast, moving the identical block one level deeper made it appear immediately:
"mcp": { "servers": { "roam": { "type": "local", "command": [...] } } }
Additional Context
- Reproducible every time; 100% deterministic.
- Worth considering: when an object key sits directly under
mcpand is notservers/timeout, log a warning naming the key and the expectedmcp.servers.<name>path. A one-line warning at config load would have saved hours here. - Related:
opencode mcp listreturning "No MCP servers configured" while a config file visibly contains anmcpblock could echo which files were loaded, which would also help when config is present but ignored for other reasons.
- 主要语言
- TypeScript
- 星标
- 215k
- 派生
- 28.9k
- 平均合并
- 6 小时 8 分钟
- 30 天内合并 PR
- 411
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
pending close triaging
难度 2/5 1-3 小时 新手友好度 65/100
anomalyco/opencode#57939 · 1 条评论 ·
维护者通常 1 天内回复
-
Opencde Github Actions Bot Cannot Install可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭reproduced
难度 2/5 1-3 小时 新手友好度 65/100
anomalyco/opencode#57911 · 2 条评论 ·
维护者通常 1 天内回复
-
pending close triaging
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#57907 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
anomalyco/opencode#57855 · 1 条评论 ·
维护者通常 1 天内回复
-
opencode api truncates large output when stdout is a pipe (un-awaited write before process.exit)未关闭pending close triaging
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#57816 · 1 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
createAI: the ai peer range allows ai@6, which the provider cannot work with可能已有人在做 @akhil9tiet 今天认领。 未关闭bug
难度 1/5 1 小时以内 新手友好度 83/100
cloudflare/agents#2690 · 3 条评论 ·
维护者通常 1 天内回复
-
[fullsend] E2E: theme — global-header ignores app.branding.fullLogo (RHDHBUGS-3670)可能已有人在做 @fullsend-ai-coder 今天认领。 未关闭e2e-failure ready-to-code
难度 1/5 1 小时以内 新手友好度 78/100
redhat-developer/rhdh-plugin-export-overlays#4503 · 1 条评论 ·
维护者通常 1 天内回复
-
needs triage 📥
难度 1/5 1 小时以内 新手友好度 86/100
ethereum/ethereum-org-website#19601 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
cloudscape-design/components#5184 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
agilepathway/label-checker#805 ·
维护者通常 1 天内回复