Skip to content

Commit 4fd9392

Browse files
authored
fix(doctor): ignore disabled MCP servers in warnings (#131352)
1 parent 249c248 commit 4fd9392

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

‎src/commands/doctor/shared/plugin-tool-allowlist-warnings.test.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,26 @@ describe("collectPluginToolAllowlistWarnings", () => {
139139
]);
140140
});
141141

142+
it("does not warn when all configured MCP servers are disabled", () => {
143+
const warnings = collectPluginToolAllowlistWarnings({
144+
cfg: {
145+
agents: { defaults: { sandbox: { mode: "all" } } },
146+
mcp: {
147+
servers: {
148+
supabase: {
149+
url: "http://localhost:54321/mcp",
150+
enabled: false,
151+
},
152+
},
153+
},
154+
tools: { sandbox: { tools: { alsoAllow: ["web_search"] } } },
155+
},
156+
manifestRegistry,
157+
});
158+
159+
expect(warnings).toStrictEqual([]);
160+
});
161+
142162
it("uses a config-path source label when sandbox allowlist is unset", () => {
143163
const warnings = collectPluginToolAllowlistWarnings({
144164
cfg: {

‎src/commands/doctor/shared/plugin-tool-allowlist-warnings.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function collectConfiguredMcpServerNames(cfg: OpenClawConfig): string[] {
142142
return [];
143143
}
144144
return Object.entries(servers)
145-
.filter(([, value]) => hasRecord(value))
145+
.filter(([, value]) => hasRecord(value) && value.enabled !== false)
146146
.map(([name]) => name.trim())
147147
.filter(Boolean)
148148
.toSorted((left, right) => left.localeCompare(right));

0 commit comments

Comments
 (0)