From a4a174b3dcad09a2e0639c287dbb2eb02aea2a49 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 5 Sep 2025 12:28:00 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20refactor:=20Only=20Show?= =?UTF-8?q?=20Agents=20MCP=20UI=20When=20Configured=20(#9471)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/server/routes/config.js | 4 +++- client/src/Providers/AgentPanelContext.tsx | 1 + client/src/common/types.ts | 1 + .../components/SidePanel/Agents/AgentConfig.tsx | 15 +++++++++------ 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/api/server/routes/config.js b/api/server/routes/config.js index 4240a6eb2..ec38593fe 100644 --- a/api/server/routes/config.js +++ b/api/server/routes/config.js @@ -122,7 +122,6 @@ router.get('/', async function (req, res) { payload.minPasswordLength = minPasswordLength; } - payload.mcpServers = {}; const getMCPServers = () => { try { if (appConfig?.mcpConfig == null) { @@ -136,6 +135,9 @@ router.get('/', async function (req, res) { if (!mcpServers) return; const oauthServers = mcpManager.getOAuthServers(); for (const serverName in mcpServers) { + if (!payload.mcpServers) { + payload.mcpServers = {}; + } const serverConfig = mcpServers[serverName]; payload.mcpServers[serverName] = removeNullishValues({ startup: serverConfig?.startup, diff --git a/client/src/Providers/AgentPanelContext.tsx b/client/src/Providers/AgentPanelContext.tsx index eb64011b3..135066c78 100644 --- a/client/src/Providers/AgentPanelContext.tsx +++ b/client/src/Providers/AgentPanelContext.tsx @@ -140,6 +140,7 @@ export function AgentPanelProvider({ children }: { children: React.ReactNode }) pluginTools, activePanel, agentsConfig, + startupConfig, setActivePanel, endpointsConfig, setCurrentAgentId, diff --git a/client/src/common/types.ts b/client/src/common/types.ts index 3156ccb44..b03a80f07 100644 --- a/client/src/common/types.ts +++ b/client/src/common/types.ts @@ -239,6 +239,7 @@ export type AgentPanelContextType = { setActivePanel: React.Dispatch>; setCurrentAgentId: React.Dispatch>; agent_id?: string; + startupConfig?: t.TStartupConfig | null; agentsConfig?: t.TAgentsEndpoint | null; endpointsConfig?: t.TEndpointsConfig | null; /** Pre-computed MCP server information indexed by server key */ diff --git a/client/src/components/SidePanel/Agents/AgentConfig.tsx b/client/src/components/SidePanel/Agents/AgentConfig.tsx index 86f9cc6dc..a48a37259 100644 --- a/client/src/components/SidePanel/Agents/AgentConfig.tsx +++ b/client/src/components/SidePanel/Agents/AgentConfig.tsx @@ -49,6 +49,7 @@ export default function AgentConfig({ createMutation }: Pick} )} + {/* MCP Section */} + {startupConfig?.mcpServers != null && ( + + )} {/* Agent Tools & Actions */}
- {/* MCP Section */} - {/* Support Contact (Optional) */}