From 659871135415774ddaed9e729cfeeebb0b066e4a Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 25 Aug 2025 15:27:39 -0700 Subject: [PATCH] feat: show MCP section but with a disabled message if org policy disables MCP servers --- .../mainInput/Lump/sections/SelectedSection.tsx | 7 ------- .../mainInput/Lump/sections/mcp/MCPSection.tsx | 12 ++++++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gui/src/components/mainInput/Lump/sections/SelectedSection.tsx b/gui/src/components/mainInput/Lump/sections/SelectedSection.tsx index f8e6a52e1..29feb6680 100644 --- a/gui/src/components/mainInput/Lump/sections/SelectedSection.tsx +++ b/gui/src/components/mainInput/Lump/sections/SelectedSection.tsx @@ -1,5 +1,3 @@ -import { useAppSelector } from "../../../../redux/hooks"; -import { selectCurrentOrg } from "../../../../redux/slices/profilesSlice"; import { useLump } from "../LumpContext"; import { ContextSection } from "./ContextSection"; import { ErrorSection } from "./errors/ErrorSection"; @@ -14,8 +12,6 @@ import { ToolPoliciesSection } from "./tool-policies/ToolPoliciesSection"; */ export function SelectedSection() { const { displayedSection } = useLump(); - const currentOrg = useAppSelector(selectCurrentOrg); - const hideMcp = currentOrg?.policy?.allowMcpServers === false; switch (displayedSection) { case "models": @@ -29,9 +25,6 @@ export function SelectedSection() { case "tools": return ; case "mcp": - if (hideMcp) { - return null; - } return ; case "error": return ; diff --git a/gui/src/components/mainInput/Lump/sections/mcp/MCPSection.tsx b/gui/src/components/mainInput/Lump/sections/mcp/MCPSection.tsx index 24fedb53c..98fa7b56c 100644 --- a/gui/src/components/mainInput/Lump/sections/mcp/MCPSection.tsx +++ b/gui/src/components/mainInput/Lump/sections/mcp/MCPSection.tsx @@ -15,6 +15,7 @@ import { useAuth } from "../../../../../context/Auth"; import { IdeMessengerContext } from "../../../../../context/IdeMessenger"; import { useAppDispatch, useAppSelector } from "../../../../../redux/hooks"; import { updateConfig } from "../../../../../redux/slices/configSlice"; +import { selectCurrentOrg } from "../../../../../redux/slices/profilesSlice"; import { fontSize } from "../../../../../util"; import { ToolTip } from "../../../../gui/Tooltip"; import { Button } from "../../../../ui"; @@ -235,10 +236,12 @@ function MCPServerPreview({ server, serverFromYaml }: MCPServerStatusProps) { } function MCPSection() { + const currentOrg = useAppSelector(selectCurrentOrg); const servers = useAppSelector( (store) => store.config.config.mcpServerStatuses, ); const { selectedProfile } = useAuth(); + const disableMcp = currentOrg?.policy?.allowMcpServers === false; const mergedBlocks = useMemo(() => { const parsed = selectedProfile?.rawYaml @@ -250,6 +253,15 @@ function MCPSection() { })); }, [servers, selectedProfile]); + if (true) { + return ( +
+ + MCP Servers are disabled in your organization. + +
+ ); + } return (