mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
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
This commit is contained in:
parent
a163053430
commit
ebeb796e49
1 changed files with 6 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue