From 90521bfb4ee843115fc6c46edabb4ab22f102b2f Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Mon, 12 Jan 2026 19:01:45 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20fix:=20MCP=20Panel=20Regressions?= =?UTF-8?q?=20after=20UI=20refactor=20(#11312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Revoke OAuth and Vars. Config Regressions in MCP Panel - Introduced a new Trash2 icon button in MCPCardActions for revoking OAuth access on connected OAuth servers. - Updated MCPServerCard to handle the revoke action, allowing users to revoke OAuth for specific servers. - Enhanced user experience by ensuring the revoke option is available regardless of the server's connection state. * refactor: Reorganize Revoke Button Logic in MCPCardActions and Update Toast Messages - Moved the Revoke button for OAuth servers to a new position in MCPCardActions for improved visibility. - Updated the success message logic in useMCPServerManager to differentiate between uninstall and variable update actions, enhancing user feedback. * i18n: Add new translation for MCP server access revocation message * refactor: Centralize Deselection Logic in updateUserPluginsMutation - Updated the success handler in useUpdateUserPluginsMutation to manage deselection of MCP server values when revoking access, improving code clarity and reducing redundancy. - Simplified message assignment logic for user feedback during plugin updates. --- .../SidePanel/MCPBuilder/MCPCardActions.tsx | 19 ++++++++++++++- .../SidePanel/MCPBuilder/MCPServerCard.tsx | 14 ++++++++++- client/src/hooks/MCP/useMCPServerManager.ts | 23 +++++++++++++------ client/src/locales/en/translation.json | 1 + 4 files changed, 48 insertions(+), 9 deletions(-) diff --git a/client/src/components/SidePanel/MCPBuilder/MCPCardActions.tsx b/client/src/components/SidePanel/MCPBuilder/MCPCardActions.tsx index 015dfce014..7185185132 100644 --- a/client/src/components/SidePanel/MCPBuilder/MCPCardActions.tsx +++ b/client/src/components/SidePanel/MCPBuilder/MCPCardActions.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Pencil, PlugZap, SlidersHorizontal, RefreshCw, X } from 'lucide-react'; +import { Pencil, PlugZap, SlidersHorizontal, RefreshCw, X, Trash2 } from 'lucide-react'; import { Spinner, TooltipAnchor } from '@librechat/client'; import type { MCPServerStatus } from 'librechat-data-provider'; import { useLocalize } from '~/hooks'; @@ -17,6 +17,7 @@ interface MCPCardActionsProps { onConfigClick: (e: React.MouseEvent) => void; onInitialize: () => void; onCancel: (e: React.MouseEvent) => void; + onRevoke?: () => void; } /** @@ -26,6 +27,7 @@ interface MCPCardActionsProps { * - Pencil: Edit server definition (Settings panel only) * - PlugZap: Connect/Authenticate (for disconnected/error servers) * - SlidersHorizontal: Configure custom variables (for connected servers with vars) + * - Trash2: Revoke OAuth access (for connected OAuth servers) * - RefreshCw: Reconnect/Refresh (for connected servers) * - Spinner: Loading state (with X on hover for cancel) */ @@ -41,6 +43,7 @@ export default function MCPCardActions({ onConfigClick, onInitialize, onCancel, + onRevoke, }: MCPCardActionsProps) { const localize = useLocalize(); @@ -162,6 +165,20 @@ export default function MCPCardActions({