From 2782af34c8aa8ea656775bb5dde5ec74e3ee8688 Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Wed, 1 Jul 2026 13:26:22 +0200 Subject: [PATCH] feat: show MCP server icon in OAuth dialog title --- client/src/components/MCP/McpOAuthDialog.tsx | 26 ++++++++++++++++--- .../Tools/ItemDialog/sections/McpSection.tsx | 2 ++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/client/src/components/MCP/McpOAuthDialog.tsx b/client/src/components/MCP/McpOAuthDialog.tsx index 8b2cef955c..5eda5ebdf3 100644 --- a/client/src/components/MCP/McpOAuthDialog.tsx +++ b/client/src/components/MCP/McpOAuthDialog.tsx @@ -18,6 +18,8 @@ interface McpOAuthDialogProps { onOpenChange: (open: boolean) => void; serverName: string; oauthUrl: string; + /** The MCP server's icon, shown beside the title when the server provides one. */ + iconUrl?: string; } /** @@ -32,10 +34,12 @@ export default function McpOAuthDialog({ onOpenChange, serverName, oauthUrl, + iconUrl, }: McpOAuthDialogProps) { const localize = useLocalize(); const [isCopying, setIsCopying] = useState(false); const [showQR, setShowQR] = useState(false); + const [iconError, setIconError] = useState(false); const copyUrl = useCopyToClipboard({ text: oauthUrl }); if (!oauthUrl) { @@ -45,9 +49,25 @@ export default function McpOAuthDialog({ return ( - - {localize('com_nav_mcp_connect_server', { 0: serverName })} - +
+ {iconUrl && !iconError && ( + + )} + + {localize('com_nav_mcp_connect_server', { 0: serverName })} + +
{localize('com_ui_mcp_oauth_description')} diff --git a/client/src/components/SidePanel/Agents/Tools/ItemDialog/sections/McpSection.tsx b/client/src/components/SidePanel/Agents/Tools/ItemDialog/sections/McpSection.tsx index 81d48462b2..ca8c53952b 100644 --- a/client/src/components/SidePanel/Agents/Tools/ItemDialog/sections/McpSection.tsx +++ b/client/src/components/SidePanel/Agents/Tools/ItemDialog/sections/McpSection.tsx @@ -17,6 +17,7 @@ import MCPServerStatusIcon from '~/components/MCP/MCPServerStatusIcon'; import MCPConfigDialog from '~/components/MCP/MCPConfigDialog'; import McpOAuthDialog from '~/components/MCP/McpOAuthDialog'; import { useAgentPanelContext } from '~/Providers'; +import { getIconForItem } from '../../items/icons'; import MCPToolItem from '../../../MCPToolItem'; import { Collapse } from '~/components/ui'; import { useLocalize } from '~/hooks'; @@ -346,6 +347,7 @@ export default function McpSection({ item }: Props) { onOpenChange={setOauthOpen} serverName={serverName} oauthUrl={oauthUrl ?? getOAuthUrl(serverName) ?? ''} + iconUrl={getIconForItem(item).iconUrl} /> );