From f755673c6f4d67fbaef27249d5f52a7f308e88a2 Mon Sep 17 00:00:00 2001 From: Aleksander Grygier Date: Sat, 3 Jan 2026 01:11:55 +0100 Subject: [PATCH] feat: Enhance MCP server dropdown with search, popularity sorting, and per-chat overrides --- .../ChatFormActions/ChatFormActions.svelte | 127 +++++++++++++++--- .../chat/ChatSettings/McpServerCard.svelte | 2 +- .../server/webui/src/lib/stores/mcp.svelte.ts | 9 ++ 3 files changed, 116 insertions(+), 22 deletions(-) diff --git a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte index 89698f5b51..0e224a7e42 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte @@ -1,6 +1,6 @@ - + {#if isEditing}
diff --git a/tools/server/webui/src/lib/stores/mcp.svelte.ts b/tools/server/webui/src/lib/stores/mcp.svelte.ts index c1ac4cf98b..17a0221af4 100644 --- a/tools/server/webui/src/lib/stores/mcp.svelte.ts +++ b/tools/server/webui/src/lib/stores/mcp.svelte.ts @@ -269,11 +269,20 @@ class MCPStore { /** * Execute a tool call via MCP host manager. * Automatically routes to the appropriate server. + * Also tracks usage statistics for the server. */ async executeTool(toolCall: MCPToolCall, signal?: AbortSignal): Promise { if (!this._hostManager) { throw new Error('MCP host manager not initialized'); } + + // Track usage for the server that provides this tool + const serverId = this.getToolServer(toolCall.function.name); + if (serverId) { + const updatedStats = incrementMcpServerUsage(config(), serverId); + settingsStore.updateConfig('mcpServerUsageStats', updatedStats); + } + return this._hostManager.executeTool(toolCall, signal); }