import React from 'react'; import UninitializedMCPTool from './UninitializedMCPTool'; import UnconfiguredMCPTool from './UnconfiguredMCPTool'; import { useAgentPanelContext } from '~/Providers'; import { useLocalize } from '~/hooks'; import MCPTool from './MCPTool'; export default function MCPTools({ agentId, mcpServerNames, setShowMCPToolDialog, }: { agentId: string; mcpServerNames?: string[]; setShowMCPToolDialog: React.Dispatch>; }) { const localize = useLocalize(); const { mcpServersMap } = useAgentPanelContext(); return (
{/* Render servers with selected tools */} {mcpServerNames?.map((mcpServerName) => { const serverInfo = mcpServersMap.get(mcpServerName); if (!serverInfo?.isConfigured) { return ( ); } if (!serverInfo) { return null; } if (serverInfo.isConnected) { return ( ); } return ( ); })}
); }