MCP 设置页打开开关后,曾出现不可连接 server 初始显示为绿色,随后真实连接失败才变红的状态流转。为了稳定复现该问题,需要默认启用、但不会连通的 ZCode Agent MCP server,分别覆盖 HTTP 连接失败和 STDIO 进程启动失败。
测试配置写入用户级 ZCode Agent MCP 配置:
{
"mcp": {
"servers": {
"zcode-unreachable-http-test": {
"type": "http",
"url": "http://127.0.0.1:9/mcp",
"timeoutMs": 3000
},
"zcode-unreachable-stdio-test": {
"type": "stdio",
"command": "zcode-mcp-stdio-server-that-does-not-exist-for-test",
"args": [],
"timeoutMs": 3000
}
}
}
}
说明:
enable: false,保持默认启用,用于观察初始状态和连接失败后的状态变化。127.0.0.1:9,请求只落在本机回环地址,不访问外网。zcode-unreachable-http-test 和 zcode-unreachable-stdio-test 应出现在 ZCode Agent MCP 列表中。该配置只用于本地诊断,不应作为默认产品配置下发。