diff --git a/core/context/mcp/MCPConnection.ts b/core/context/mcp/MCPConnection.ts index 320a3e0e5..bdd3279a0 100644 --- a/core/context/mcp/MCPConnection.ts +++ b/core/context/mcp/MCPConnection.ts @@ -52,6 +52,7 @@ class MCPConnection { public status: MCPConnectionStatus = "not-connected"; public isProtectedResource = false; public errors: string[] = []; + public infos: string[] = []; public prompts: MCPPrompt[] = []; public tools: MCPTool[] = []; public resources: MCPResource[] = []; @@ -93,6 +94,7 @@ class MCPConnection { return { ...this.options, errors: this.errors, + infos: this.infos, prompts: this.prompts, resources: this.resources, resourceTemplates: this.resourceTemplates, @@ -122,6 +124,7 @@ class MCPConnection { this.resources = []; this.resourceTemplates = []; this.errors = []; + this.infos = []; this.stdioOutput = { stdout: "", stderr: "" }; this.abortController.abort(); @@ -280,6 +283,16 @@ class MCPConnection { if (msg.includes("spawn") && msg.includes("enoent")) { const command = msg.split(" ")[1]; errorMessage += `Error: command "${command}" not found. To use this MCP server, install the ${command} CLI.`; + if (["uv", "uvx"].includes(command)) { + this.infos.push( + 'Please install uv by following the installation guide: https://docs.astral.sh/uv/getting-started/installation/', + ); + } + if (["node", "npx"].includes(command)) { + this.infos.push( + 'Please install npx by following the installation guide: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm', + ); + } } else { errorMessage += "Error: " + error.message; } diff --git a/core/context/mcp/MCPConnection.vitest.ts b/core/context/mcp/MCPConnection.vitest.ts index 3f69d8f23..873805052 100644 --- a/core/context/mcp/MCPConnection.vitest.ts +++ b/core/context/mcp/MCPConnection.vitest.ts @@ -142,6 +142,7 @@ describe("MCPConnection", () => { expect(status).toEqual({ ...options, errors: [], + infos: [], isProtectedResource: false, prompts: [], resources: [], diff --git a/core/index.d.ts b/core/index.d.ts index aba479e77..ae2633595 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -1335,6 +1335,7 @@ export interface MCPTool { export interface MCPServerStatus extends MCPOptions { status: MCPConnectionStatus; errors: string[]; + infos: string[]; isProtectedResource: boolean; prompts: MCPPrompt[]; diff --git a/core/tools/mcpToolName.vitest.ts b/core/tools/mcpToolName.vitest.ts index ad3815a9a..6a7042d8f 100644 --- a/core/tools/mcpToolName.vitest.ts +++ b/core/tools/mcpToolName.vitest.ts @@ -5,6 +5,7 @@ import { getMCPToolName } from "./mcpToolName"; const createMcpServer = (name: string): MCPServerStatus => ({ name, errors: [], + infos: [], prompts: [], tools: [], resources: [], diff --git a/gui/src/pages/config/sections/ToolsSection.tsx b/gui/src/pages/config/sections/ToolsSection.tsx index 101a7e9e5..c94c97a9e 100644 --- a/gui/src/pages/config/sections/ToolsSection.tsx +++ b/gui/src/pages/config/sections/ToolsSection.tsx @@ -5,7 +5,6 @@ import { CircleStackIcon, CommandLineIcon, GlobeAltIcon, - PlusIcon, UserCircleIcon, WrenchScrewdriverIcon, } from "@heroicons/react/24/outline"; @@ -268,6 +267,27 @@ function MCPServerPreview({ server, serverFromYaml }: MCPServerStatusProps) { ))} )} + + {server.infos && server.infos.length > 0 && ( +
+ {server.infos.map((info, infoIndex) => ( + + void ideMessenger.ide.showVirtualFile(server.name, info) + } + > + + + ))} +
+ )} ); }