Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

config: V2 silently ignores MCP servers defined directly under `mcp` instead of `mcp.servers`

Đã đóng Phù hợp với người mới
#56,602 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

  1. 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"]
    }
  }
}
  1. Restart OpenCode (or restart the service).
  2. 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 mcp and is not servers/timeout, log a warning naming the key and the expected mcp.servers.<name> path. A one-line warning at config load would have saved hours here.
  • Related: opencode mcp list returning "No MCP servers configured" while a config file visibly contains an mcp block 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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/opencode

Tất cả issue của anomalyco/opencode

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.