mcp: "enabled": false is dropped at parse, so the server still starts
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- backend
Hướng nghiên cứu
Bắt đầu bằng cách lần theo quá trình phân tích cấu hình máy chủ MCP và bước kiểm tra khi khởi động được mô tả trong báo cáo, sau đó kiểm tra schema cấu hình cho tùy chọn enabled đã được tài liệu hóa. Tái hiện bằng opencode --standalone debug config với bốn mục trong issue. Hoàn tất khi enabled: false được giữ nguyên hoặc được ánh xạ để máy chủ báo trạng thái đã tắt, còn các mục khác vẫn giữ hành vi được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
The docs list enabled as the way to turn a server off without deleting it ("You can also disable a server by setting enabled to false"), and both option tables carry enabled | Boolean | "Enable or disable the MCP server on startup". The key is dropped during config parsing, while startup gates on disabled, which the docs never mention. So "enabled": false is inert and the server connects.
// opencode.json
{
"mcp": { "servers": {
"a-enabled-only": { "type": "remote", "url": "http://127.0.0.1:1/mcp", "enabled": false },
"b-disabled-only": { "type": "remote", "url": "http://127.0.0.1:2/mcp", "disabled": true },
"c-both": { "type": "remote", "url": "http://127.0.0.1:3/mcp", "enabled": false, "disabled": true },
"d-plain": { "type": "remote", "url": "http://127.0.0.1:4/mcp" }
} }
}
opencode --standalone debug config prints a-enabled-only with no enabled key at all, and keeps disabled: true on the other two.
Plugins
none
OpenCode version
2.2.5
Steps to reproduce
- Write the config above into
opencode.jsonin an empty directory. opencode --standalone debug config—enabledis gone froma-enabled-only.opencode serve --hostname 127.0.0.1 --port 49399withOPENCODE_PASSWORDset, thencurl -u "opencode:$OPENCODE_PASSWORD" http://127.0.0.1:49399/api/mcp.
| entry in config | status from /api/mcp |
|---|---|
"enabled": false |
failed — it tried to connect |
"disabled": true |
disabled |
| both keys | disabled |
| neither key | failed — it tried to connect |
Expected: enabled: false behaves like disabled: true.
The published config schema carries enabled with the description "Enable or disable the MCP server on startup", while the MCP layer's config classes declare disabled and its startup loop tests config.disabled. Nothing maps one to the other, so the documented key does nothing and the undocumented one is the only lever. Not a duplicate of #55419, which covers invalid entries being dropped.
Operating System
Ubuntu 24.04 (container)
Terminal
xterm-256color
- Ngôn ngữ chính
- TypeScript
- Star
- 224k
- Fork
- 30k
- Merge trung bình
- 5 giờ 25 phút
- Pull request đã merge (30 ngày)
- 494
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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
anomalyco/opencode#62322 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pending close
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
anomalyco/opencode#62305 · 1 bình luận ·
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 76/100
anomalyco/opencode#62210 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tui: /models drops provider grouping when the session location differs from the default locationCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởreproduced
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
anomalyco/opencode#62105 · 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 65/100
anomalyco/opencode#62046 · 4 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ự
-
JSDelivr CDN is brokenĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
🐛 bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
LibreChat-AI/LibreChat#17875 ·
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 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
category:helper tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
LanternOps/breeze#11285 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: core area: docs good first issue help wanted lane: free-agent priority: P3 roadmap size: XS type: task
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
arminazimi/seaworthy#701 ·
Maintainer thường phản hồi trong vòng 1 ngày