From 6905f05ef03964cb17135dff02eb72aec58cfed8 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 23 Apr 2026 12:53:51 +0000 Subject: [PATCH] feat(ui): mcp_connection_status to shadcn - antd Button/Spin/Alert/Collapse + @tremor Card/Title/Text + @ant-design Check/Exclamation/Reload/Tool \u2192 shadcn Card/Button/ Accordion + lucide CheckCircle2/AlertTriangle/RefreshCcw/Wrench/ Loader2. - Error state renders a destructive-tinted panel with Retry button and collapsible stack trace inside an Accordion. - Categorical blue (info/connecting), emerald (connected), and destructive (failed) palettes are already covered by existing overrides. Gates: TS \u2713 | Build \u2713. Co-authored-by: yuneng-jiang --- .../mcp_tools/mcp_connection_status.tsx | 152 ++++++++++-------- 1 file changed, 81 insertions(+), 71 deletions(-) diff --git a/ui/litellm-dashboard/src/components/mcp_tools/mcp_connection_status.tsx b/ui/litellm-dashboard/src/components/mcp_tools/mcp_connection_status.tsx index d6d6c07c1d7..142bce03c6c 100644 --- a/ui/litellm-dashboard/src/components/mcp_tools/mcp_connection_status.tsx +++ b/ui/litellm-dashboard/src/components/mcp_tools/mcp_connection_status.tsx @@ -1,10 +1,24 @@ import React from "react"; -import { Button, Spin, Alert, Collapse } from "antd"; -import { CheckCircleOutlined, ExclamationCircleOutlined, ReloadOutlined, ToolOutlined } from "@ant-design/icons"; -import { Card, Title, Text } from "@tremor/react"; +import { + Accordion, + AccordionContent, + AccordionItem, + AccordionTrigger, +} from "@/components/ui/accordion"; +import { Button } from "@/components/ui/button"; +import { Card } from "@/components/ui/card"; +import { + AlertTriangle, + CheckCircle2, + Loader2, + RefreshCcw, + Wrench, +} from "lucide-react"; interface MCPConnectionStatusProps { + // eslint-disable-next-line @typescript-eslint/no-explicit-any formValues: Record; + // eslint-disable-next-line @typescript-eslint/no-explicit-any tools: any[]; isLoadingTools: boolean; toolsError: string | null; @@ -22,26 +36,26 @@ const MCPConnectionStatus: React.FC = ({ canFetchTools, fetchTools, }) => { - - // Don't show anything if required fields aren't filled if (!canFetchTools && !formValues.url && !formValues.spec_path) { return null; } return ( - +
- - Connection Status + +

Connection Status

{!canFetchTools && (formValues.url || formValues.spec_path) && ( -
- - Complete required fields to test connection -
- Fill in URL, Transport, and Authentication to test MCP server connection +
+ +
Complete required fields to test connection
+
+ Fill in URL, Transport, and Authentication to test MCP server + connection +
)} @@ -49,7 +63,7 @@ const MCPConnectionStatus: React.FC = ({
- +
{isLoadingTools ? "Testing connection to MCP server..." : tools.length > 0 @@ -57,91 +71,87 @@ const MCPConnectionStatus: React.FC = ({ : toolsError ? "Connection failed" : "Ready to test connection"} - -
- Server: {formValues.url || formValues.spec_path} +
+
+ Server: {formValues.url || formValues.spec_path} +
{isLoadingTools && ( -
- - Connecting... +
+ + Connecting...
)} {!isLoadingTools && !toolsError && tools.length > 0 && ( -
- - Connected +
+ + Connected
)} {toolsError && ( -
- - Failed +
+ + Failed
)}
{isLoadingTools && ( -
- - Testing connection and loading tools... +
+ + Testing connection and loading tools...
)} {toolsError && ( - -
{toolsError}
- {toolsErrorStackTrace && ( - +
+
+
+ +
+
+ Connection Failed +
+
{toolsError}
+ {toolsErrorStackTrace && ( + + + Stack Trace + +
                                 {toolsErrorStackTrace}
                               
- ), - }, - ]} - style={{ marginTop: "12px" }} - /> - )} +
+
+
+ )} +
- } - type="error" - showIcon - action={ - - } - /> +
+
)} {!isLoadingTools && tools.length === 0 && !toolsError && ( -
- - Connection successful! -
- No tools found for this MCP server +
+ +
+ Connection successful! +
+
+ No tools found for this MCP server +
)}