Browse Source

Merge pull request #902 from MuriloFP/fix-disabled-mcp-list

fix: ensure disabled MCP servers appear in settings UI
Matt Rubens 1 year ago
parent
commit
d8274aca70
2 changed files with 7 additions and 2 deletions
  1. 2 2
      src/core/webview/ClineProvider.ts
  2. 5 0
      src/services/mcp/McpHub.ts

+ 2 - 2
src/core/webview/ClineProvider.ts

@@ -628,7 +628,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
 						if (this.mcpHub) {
 							this.postMessageToWebview({
 								type: "mcpServers",
-								mcpServers: this.mcpHub.getServers(),
+								mcpServers: this.mcpHub.getAllServers(),
 							})
 						}
 
@@ -2256,7 +2256,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
 			autoApprovalEnabled: autoApprovalEnabled ?? false,
 			customModes: await this.customModesManager.getCustomModes(),
 			experiments: experiments ?? experimentDefault,
-			mcpServers: this.mcpHub?.getServers() ?? [],
+			mcpServers: this.mcpHub?.getAllServers() ?? [],
 		}
 	}
 

+ 5 - 0
src/services/mcp/McpHub.ts

@@ -67,6 +67,11 @@ export class McpHub {
 		return this.connections.filter((conn) => !conn.server.disabled).map((conn) => conn.server)
 	}
 
+	getAllServers(): McpServer[] {
+		// Return all servers regardless of state
+		return this.connections.map((conn) => conn.server)
+	}
+
 	async getMcpServersPath(): Promise<string> {
 		const provider = this.providerRef.deref()
 		if (!provider) {