config: V2 silently ignores MCP servers defined directly under `mcp` instead of `mcp.servers`
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- cli, developer-experience
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện cấu hình V1 của mcp theo lược đồ JSON đã được tài liệu hóa, sau đó truy vết quá trình tải cấu hình và lệnh opencode mcp list. Thêm một kiểm tra hồi quy ghi nhận việc hỗ trợ cấu trúc hiện có hoặc một cảnh báo nêu rõ khóa không được nhận dạng và đường dẫn dự kiến mcp.servers.<name>. Hoàn tất nghĩa là máy chủ đã xác định không còn bị bỏ qua âm thầm và lỗi trở nên hiển thị.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 215k
- Fork
- 28.9k
- Merge trung bình
- 11 giờ 19 phút
- Pull request đã merge (30 ngày)
- 320
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của anomalyco/opencode
-
pending close triaging
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
anomalyco/opencode#57209 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
reproduced
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
anomalyco/opencode#57127 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pending close triaging
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
anomalyco/opencode#57070 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Plan mode leave reminder becomes the final user turn after a tool-driven agent switch, models refuseCó thể đã có người làm @Veld101 đã nhận 1 ngày trước. Đang mởreproduced
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
anomalyco/opencode#57013 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
anomalyco/opencode#56891 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của anomalyco/opencode
Issue tương tự
-
area: app type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ExpidetGames/code-reviewer#585 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 83/100
module-federation/core#5205 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
LanternOps/breeze#9392 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
engine-rs P3 review-deferral wasm
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
maniator/verticopolis#1154 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày