Changesets · Branches · Tags · Compare
| Changeset | 8d27d859265e0081584f31449cc69760e5fe96b9c52a3af03e666704d96a2c12 |
|---|---|
| Author | Dallin Romney <dallinromney@gmail.com> · 2025-09-18 12:17 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-09-18 12:17 -07:00 |
| Parents | 36262159272d, 0e8f78162e26 |
5 files changed
modified core/context/mcp/MCPConnection.ts +13 −0
| @@ -52,6 +52,7 @@ | ||
| 52 | 52 | public status: MCPConnectionStatus = "not-connected"; |
| 53 | 53 | public isProtectedResource = false; |
| 54 | 54 | public errors: string[] = []; |
| 55 | + public infos: string[] = []; | |
| 55 | 56 | public prompts: MCPPrompt[] = []; |
| 56 | 57 | public tools: MCPTool[] = []; |
| 57 | 58 | public resources: MCPResource[] = []; |
| @@ -93,6 +94,7 @@ | ||
| 93 | 94 | return { |
| 94 | 95 | ...this.options, |
| 95 | 96 | errors: this.errors, |
| 97 | + infos: this.infos, | |
| 96 | 98 | prompts: this.prompts, |
| 97 | 99 | resources: this.resources, |
| 98 | 100 | resourceTemplates: this.resourceTemplates, |
| @@ -122,6 +124,7 @@ | ||
| 122 | 124 | this.resources = []; |
| 123 | 125 | this.resourceTemplates = []; |
| 124 | 126 | this.errors = []; |
| 127 | + this.infos = []; | |
| 125 | 128 | this.stdioOutput = { stdout: "", stderr: "" }; |
| 126 | 129 | |
| 127 | 130 | this.abortController.abort(); |
| @@ -280,6 +283,16 @@ | ||
| 280 | 283 | if (msg.includes("spawn") && msg.includes("enoent")) { |
| 281 | 284 | const command = msg.split(" ")[1]; |
| 282 | 285 | errorMessage += `Error: command "${command}" not found. To use this MCP server, install the ${command} CLI.`; |
| 286 | + if (["uv", "uvx"].includes(command)) { | |
| 287 | + this.infos.push( | |
| 288 | + 'Please install uv by following the installation guide: <a href="https://docs.astral.sh/uv/getting-started/installation/">https://docs.astral.sh/uv/getting-started/installation/</a>', | |
| 289 | + ); | |
| 290 | + } | |
| 291 | + if (["node", "npx"].includes(command)) { | |
| 292 | + this.infos.push( | |
| 293 | + 'Please install npx by following the installation guide: <a href="https://docs.npmjs.com/downloading-and-installing-node-js-and-npm">https://docs.npmjs.com/downloading-and-installing-node-js-and-npm</a>', | |
| 294 | + ); | |
| 295 | + } | |
| 283 | 296 | } else { |
| 284 | 297 | errorMessage += "Error: " + error.message; |
| 285 | 298 | } |
modified core/context/mcp/MCPConnection.vitest.ts +1 −0
| @@ -142,6 +142,7 @@ | ||
| 142 | 142 | expect(status).toEqual({ |
| 143 | 143 | ...options, |
| 144 | 144 | errors: [], |
| 145 | + infos: [], | |
| 145 | 146 | isProtectedResource: false, |
| 146 | 147 | prompts: [], |
| 147 | 148 | resources: [], |
modified core/index.d.ts +1 −0
| @@ -1335,6 +1335,7 @@ | ||
| 1335 | 1335 | export interface MCPServerStatus extends MCPOptions { |
| 1336 | 1336 | status: MCPConnectionStatus; |
| 1337 | 1337 | errors: string[]; |
| 1338 | + infos: string[]; | |
| 1338 | 1339 | isProtectedResource: boolean; |
| 1339 | 1340 | |
| 1340 | 1341 | prompts: MCPPrompt[]; |
modified core/tools/mcpToolName.vitest.ts +1 −0
| @@ -5,6 +5,7 @@ | ||
| 5 | 5 | const createMcpServer = (name: string): MCPServerStatus => ({ |
| 6 | 6 | name, |
| 7 | 7 | errors: [], |
| 8 | + infos: [], | |
| 8 | 9 | prompts: [], |
| 9 | 10 | tools: [], |
| 10 | 11 | resources: [], |
modified gui/src/pages/config/sections/ToolsSection.tsx +21 −1
| @@ -5,7 +5,6 @@ | ||
| 5 | 5 | CircleStackIcon, |
| 6 | 6 | CommandLineIcon, |
| 7 | 7 | GlobeAltIcon, |
| 8 | - PlusIcon, | |
| 9 | 8 | UserCircleIcon, |
| 10 | 9 | WrenchScrewdriverIcon, |
| 11 | 10 | } from "@heroicons/react/24/outline"; |
| @@ -268,6 +267,27 @@ | ||
| 268 | 267 | ))} |
| 269 | 268 | </div> |
| 270 | 269 | )} |
| 270 | + | |
| 271 | + {server.infos && server.infos.length > 0 && ( | |
| 272 | + <div className="mt-3 space-y-2"> | |
| 273 | + {server.infos.map((info, infoIndex) => ( | |
| 274 | + <Alert | |
| 275 | + key={infoIndex} | |
| 276 | + type="info" | |
| 277 | + size="sm" | |
| 278 | + className="transition-all" | |
| 279 | + onClick={() => | |
| 280 | + void ideMessenger.ide.showVirtualFile(server.name, info) | |
| 281 | + } | |
| 282 | + > | |
| 283 | + <span | |
| 284 | + className="text-xs" | |
| 285 | + dangerouslySetInnerHTML={{ __html: info }} | |
| 286 | + /> | |
| 287 | + </Alert> | |
| 288 | + ))} | |
| 289 | + </div> | |
| 290 | + )} | |
| 271 | 291 | </div> |
| 272 | 292 | ); |
| 273 | 293 | } |