🛠️ refactor: Only Show Agents MCP UI When Configured (#9471)

This commit is contained in:
Danny Avila 2025-09-05 12:28:00 -04:00 committed by GitHub
parent 65c83317aa
commit a4a174b3dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 14 additions and 7 deletions

View file

@ -140,6 +140,7 @@ export function AgentPanelProvider({ children }: { children: React.ReactNode })
pluginTools,
activePanel,
agentsConfig,
startupConfig,
setActivePanel,
endpointsConfig,
setCurrentAgentId,

View file

@ -239,6 +239,7 @@ export type AgentPanelContextType = {
setActivePanel: React.Dispatch<React.SetStateAction<Panel>>;
setCurrentAgentId: React.Dispatch<React.SetStateAction<string | undefined>>;
agent_id?: string;
startupConfig?: t.TStartupConfig | null;
agentsConfig?: t.TAgentsEndpoint | null;
endpointsConfig?: t.TEndpointsConfig | null;
/** Pre-computed MCP server information indexed by server key */

View file

@ -49,6 +49,7 @@ export default function AgentConfig({ createMutation }: Pick<AgentPanelProps, 'c
actions,
setAction,
agentsConfig,
startupConfig,
mcpServersMap,
setActivePanel,
endpointsConfig,
@ -308,6 +309,14 @@ export default function AgentConfig({ createMutation }: Pick<AgentPanelProps, 'c
{fileSearchEnabled && <FileSearch agent_id={agent_id} files={knowledge_files} />}
</div>
)}
{/* MCP Section */}
{startupConfig?.mcpServers != null && (
<MCPTools
agentId={agent_id}
mcpServerNames={mcpServerNames}
setShowMCPToolDialog={setShowMCPToolDialog}
/>
)}
{/* Agent Tools & Actions */}
<div className="mb-4">
<label className={labelClass}>
@ -375,12 +384,6 @@ export default function AgentConfig({ createMutation }: Pick<AgentPanelProps, 'c
</div>
</div>
</div>
{/* MCP Section */}
<MCPTools
agentId={agent_id}
mcpServerNames={mcpServerNames}
setShowMCPToolDialog={setShowMCPToolDialog}
/>
{/* Support Contact (Optional) */}
<div className="mb-4">
<div className="mb-1.5 flex items-center gap-2">