Skip to content

Commit 2bfce69

Browse files
committed
fix: prevent duplicate MCP resources from appearing
- Remove redundant resource fetching in toggleServerDisabled method - Resources are already fetched during initial connection in connectToServer - This fixes issue #8301 where resources appeared twice in the UI The duplicate fetching was happening when toggling server disabled state while the server was already connected. Since toggling disabled state doesn't affect the available resources/tools, we don't need to refresh them.
1 parent 2f1b94f commit 2bfce69

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

.tmp/Roo-Code

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 86debeef43acbea9bdc1aa4b38d514541e164c91

src/services/mcp/McpHub.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,15 +1376,9 @@ export class McpHub {
13761376
await this.deleteConnection(serverName, serverSource)
13771377
// When re-enabling, file watchers will be set up in connectToServer
13781378
await this.connectToServer(serverName, config, serverSource)
1379-
} else if (connection.server.status === "connected") {
1380-
// Only refresh capabilities if connected
1381-
connection.server.tools = await this.fetchToolsList(serverName, serverSource)
1382-
connection.server.resources = await this.fetchResourcesList(serverName, serverSource)
1383-
connection.server.resourceTemplates = await this.fetchResourceTemplatesList(
1384-
serverName,
1385-
serverSource,
1386-
)
13871379
}
1380+
// Note: We don't need to refresh resources when the server is already connected
1381+
// because toggling disabled state doesn't affect the resources/tools available
13881382
} catch (error) {
13891383
console.error(`Failed to refresh capabilities for ${serverName}:`, error)
13901384
}

0 commit comments

Comments
 (0)