diff --git a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx index 126df985..5f6c632b 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx @@ -1355,7 +1355,7 @@ Use Model Context Protocol to provide Agent mode with more tools. `} chatMessageLocation={undefined} />
- { await mcpService.revealMCPConfigFile() }}> + { await mcpService.revealMCPConfigFile() }}> Add MCP Server
diff --git a/src/vs/workbench/contrib/void/common/mcpService.ts b/src/vs/workbench/contrib/void/common/mcpService.ts index ca6d94a1..d6a77a74 100644 --- a/src/vs/workbench/contrib/void/common/mcpService.ts +++ b/src/vs/workbench/contrib/void/common/mcpService.ts @@ -205,14 +205,6 @@ class MCPService extends Disposable implements IMCPService { return allTools; } - // toggle MCP server and update isOn in void settings - public async toggleServerIsOn(serverName: string, isOn: boolean): Promise { - await this.voidSettingsService.setMCPServerState(serverName, { isOn }); - this.channel.call('toggleMCPServer', { serverName, isOn }) - } - - // utility functions - private async _getMCPConfigFilePath(): Promise { const appName = this.productService.dataFolderName const userHome = await this.pathService.userHome(); @@ -274,11 +266,7 @@ class MCPService extends Disposable implements IMCPService { // set all servers to loading for (const serverName in newConfigFileJSON.mcpServers) { - if (serverName in this.state.mcpServerOfName) continue - this._setMCPServerState(serverName, { - status: 'loading', - tools: [], - }) + this._setMCPServerState(serverName, { status: 'loading', tools: [] }) } const updatedServerNames = Object.keys(newConfigFileJSON.mcpServers).filter(serverName => !addedServerNames.includes(serverName) && !removedServerNames.includes(serverName)) @@ -292,6 +280,15 @@ class MCPService extends Disposable implements IMCPService { } + // toggle MCP server and update isOn in void settings + public async toggleServerIsOn(serverName: string, isOn: boolean): Promise { + this._setMCPServerState(serverName, { status: 'loading', tools: [] }) + + await this.voidSettingsService.setMCPServerState(serverName, { isOn }); + this.channel.call('toggleMCPServer', { serverName, isOn }) + } + + public async callMCPTool(toolData: MCPToolCallParams): Promise<{ result: MCPGenericToolResponse }> { const result = await this.channel.call('callTool', toolData); return { result };