- {renderIcon()}
+ {renderMCPIcon({
+ iconPath: server.config?.iconPath,
+ serverName: server.serverName,
+ displayName,
+ className: 'h-8 w-8 rounded-lg object-cover',
+ wrapDefault: true,
+ })}
{/* Status dot - decorative, status is announced via aria-label on MenuItem */}
{
- if (icon.iconPath === 'clickhouse') {
- return (
-
- );
- }
-
- if (icon.iconPath) {
- return (
-

- );
- }
-
- return
;
- };
-
return (
{icons.map((icon, index) => (
@@ -97,7 +74,12 @@ export default function StackedMCPIcons({
)}
style={{ zIndex: icons.length - index }}
>
- {renderIcon(icon)}
+ {renderMCPIcon({
+ iconPath: icon.iconPath,
+ serverName: icon.serverName,
+ displayName: icon.displayName,
+ className: cn('rounded-full object-cover', sizes.icon),
+ })}
))}
{overflowCount > 0 && (
diff --git a/client/src/components/MCP/mcpServerUtils.ts b/client/src/components/MCP/mcpServerUtils.ts
index bce5ba5e08..baca7f745a 100644
--- a/client/src/components/MCP/mcpServerUtils.ts
+++ b/client/src/components/MCP/mcpServerUtils.ts
@@ -40,7 +40,7 @@ export function getSelectedServerIcons(
clickhouseServers.push({
key: server.serverName,
serverName: server.serverName,
- iconPath: 'clickhouse',
+ iconPath: null,
displayName,
});
} else {
diff --git a/client/src/components/MCP/renderMCPIcon.tsx b/client/src/components/MCP/renderMCPIcon.tsx
new file mode 100644
index 0000000000..18e73edb38
--- /dev/null
+++ b/client/src/components/MCP/renderMCPIcon.tsx
@@ -0,0 +1,60 @@
+import type { ReactNode } from 'react';
+import { MCPIcon } from '@librechat/client';
+import ClickHouseIcon from './ClickHouseIcon';
+import { cn } from '~/utils';
+
+export interface RenderMCPIconOptions {
+ iconPath?: string | null;
+ serverName?: string;
+ name?: string;
+ displayName?: string;
+ className?: string;
+ alt?: string;
+ fallbackIcon?: ReactNode;
+ wrapDefault?: boolean;
+}
+
+export function renderMCPIcon({
+ iconPath,
+ serverName,
+ name,
+ displayName,
+ className = 'h-8 w-8 rounded-lg object-cover',
+ alt,
+ fallbackIcon,
+ wrapDefault = false,
+}: RenderMCPIconOptions): ReactNode {
+ const altText = alt || displayName || name || serverName || '';
+ const isClickHouse = serverName?.toLowerCase().includes('clickhouse') ?? false;
+
+ if (iconPath) {
+ return

;
+ }
+
+ if (isClickHouse) {
+ return
;
+ }
+
+ if (fallbackIcon) {
+ return fallbackIcon;
+ }
+
+ const defaultIcon =
;
+
+ if (wrapDefault) {
+ return (
+
+
+
+ );
+ }
+
+ return defaultIcon;
+}
diff --git a/client/src/components/SidePanel/MCPBuilder/MCPServerCard.tsx b/client/src/components/SidePanel/MCPBuilder/MCPServerCard.tsx
index 99f9eee567..5b846633e0 100644
--- a/client/src/components/SidePanel/MCPBuilder/MCPServerCard.tsx
+++ b/client/src/components/SidePanel/MCPBuilder/MCPServerCard.tsx
@@ -1,8 +1,7 @@
import { useState, useRef } from 'react';
-import { MCPIcon } from '@librechat/client';
import { PermissionBits, hasPermissions } from 'librechat-data-provider';
import type { MCPServerStatusIconProps } from '~/components/MCP/MCPServerStatusIcon';
-import ClickHouseIcon from '~/components/MCP/ClickHouseIcon';
+import { renderMCPIcon } from '~/components/MCP/renderMCPIcon';
import type { MCPServerDefinition } from '~/hooks';
import { getStatusDotColor } from './MCPStatusBadge';
import MCPServerDialog from './MCPServerDialog';
@@ -71,29 +70,6 @@ export default function MCPServerCard({
setDialogOpen(true);
};
- const renderIcon = () => {
- if (server.config?.iconPath) {
- return (
-

- );
- }
-
- if (server.serverName.toLowerCase().includes('clickhouse')) {
- return
;
- }
-
- return (
-
-
-
- );
- };
-
// Determine status text for accessibility
const getStatusText = () => {
if (isInitializing) return localize('com_nav_mcp_status_initializing');
@@ -121,7 +97,14 @@ export default function MCPServerCard({
>
{/* Server Icon with Status Dot */}
- {renderIcon()}
+ {renderMCPIcon({
+ iconPath: server.config?.iconPath,
+ serverName: server.serverName,
+ displayName,
+ className: 'size-8 rounded-lg object-cover',
+ alt: '',
+ wrapDefault: true,
+ })}
{/* Status dot - color indicates connection state */}
{
- if (icon) {
- return (
-

- );
- }
-
- if (name.toLowerCase().includes('clickhouse')) {
- return
;
- }
-
- return (
-
-
-
- );
- };
-
return (
- {renderIcon()}
+ {renderMCPIcon({
+ iconPath: icon,
+ serverName: name,
+ displayName: name,
+ className: 'h-full w-full rounded-[5px] object-cover',
+ alt: localize('com_ui_logo', { 0: name }),
+ fallbackIcon: (
+
+
+
+ ),
+ })}