From ebeb796e492679a3db929963b8026c2ff15b5ccf Mon Sep 17 00:00:00 2001 From: Roo Code Date: Mon, 14 Jul 2025 03:41:27 +0000 Subject: [PATCH] fix: prevent disabled MCP servers from starting processes - Add disabled checks in updateServerConnections() before calling connectToServer() - Ensures disabled servers do not consume system resources - Follows existing pattern used in readResource() and callTool() methods - Fixes issue #2797 --- src/services/mcp/McpHub.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/services/mcp/McpHub.ts b/src/services/mcp/McpHub.ts index 10a74712ef..0544e2ca4c 100644 --- a/src/services/mcp/McpHub.ts +++ b/src/services/mcp/McpHub.ts @@ -976,7 +976,9 @@ export class McpHub { // New server try { this.setupFileWatcher(name, validatedConfig, source) - await this.connectToServer(name, validatedConfig, source) + if (!validatedConfig.disabled) { + await this.connectToServer(name, validatedConfig, source) + } } catch (error) { this.showErrorMessage(`Failed to connect to new MCP server ${name}`, error) } @@ -985,7 +987,9 @@ export class McpHub { try { this.setupFileWatcher(name, validatedConfig, source) await this.deleteConnection(name, source) - await this.connectToServer(name, validatedConfig, source) + if (!validatedConfig.disabled) { + await this.connectToServer(name, validatedConfig, source) + } } catch (error) { this.showErrorMessage(`Failed to reconnect MCP server ${name}`, error) }