Skip to content

Bug: MCP server config has both enabled and enable fields, enable: false is silently ignored #139

Description

@lessore

问题描述

~/.zcode/cli/config.json 中 MCP server 配置同时存在 enabledenable 两个语义重复的字段,且系统实际读取了 enabled(值为 true),导致用户设置 enable: false 无法生效,MCP 连接仍然畅通。

复现步骤

  1. ~/.zcode/cli/config.json 中配置 SiYuan MCP server
  2. 设置 "enable": false 表示禁用
  3. 系统仍然连接 MCP,工具仍然可用,且没有任何报错或警告

实际配置

{
  "mcp": {
    "servers": {
      "siyuan": {
        "url": "http://127.0.0.1:6806/mcp",
        "headers": { "Authorization": "***" },
        "enabled": true,
        "enable": false
      }
    }
  }
}

预期行为

  • 两个字段应统一为一个标准字段名(建议保留 enabled
  • 或者如果两个字段都存在,enable: false 也应能生效
  • 如果存在冲突配置,应向用户给出错误提示

环境信息

  • ZCode CLI config v2
  • macOS arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions