From e8bbc3c14d14d853559a2787e68517d2348b7684 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Tue, 10 Mar 2026 11:07:35 -0700 Subject: [PATCH] fix(mcp): allow re-approval of rejected MCP server submissions --- .../management_endpoints/mcp_management_endpoints.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/litellm/proxy/management_endpoints/mcp_management_endpoints.py b/litellm/proxy/management_endpoints/mcp_management_endpoints.py index cbf32fbb53b..3c9feee8d1f 100644 --- a/litellm/proxy/management_endpoints/mcp_management_endpoints.py +++ b/litellm/proxy/management_endpoints/mcp_management_endpoints.py @@ -782,7 +782,7 @@ if MCP_AVAILABLE: user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth), ): """ - Admin approves a pending MCP server — sets approval_status=active and loads it into the runtime registry. + Admin approves a pending or previously-rejected MCP server — sets approval_status=active and loads it into the runtime registry. """ if LitellmUserRoles.PROXY_ADMIN != user_api_key_dict.user_role: raise HTTPException( @@ -800,12 +800,10 @@ if MCP_AVAILABLE: status_code=status.HTTP_404_NOT_FOUND, detail={"error": f"MCP server '{server_id}' not found."}, ) - if existing.approval_status != MCPApprovalStatus.pending_review: + if existing.approval_status == MCPApprovalStatus.active: raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST, - detail={ - "error": f"MCP server is not pending review (approval_status={existing.approval_status})." - }, + detail={"error": "MCP server is already active."}, ) approved = await approve_mcp_server(