import React from 'react' import { FiPlus, FiServer } from 'react-icons/fi' import { Button } from '../ui/Button' import { Spinner } from '../ui/Spinner' import Typography from '../ui/Typography' import { MCPServerCard } from './MCPServerCard' import { MCPServerListProps } from '../../types/mcp' /** * List component for displaying all MCP servers * @param props - Server list props including servers array and handlers * @returns List of server cards with add button and loading states */ export const MCPServerList: React.FC = ({ servers, loading = false, onToggle, onEdit, onDelete, onTest, onAdd }) => { if (loading) { return (
Loading MCP servers...
) } if (servers.length === 0) { return (
No servers configured Add MCP servers to extend your agent with new capabilities {onAdd && ( )}
) } const connectedServers = servers.filter(server => server.status === 'connected' && server.enabled) const totalTools = connectedServers.reduce((acc, server) => acc + (server.tools?.length || 0), 0) return (
{servers.map(server => ( ))}
) }