From 1a2d7fd7f69c56f2ee798cfa9145b9c6e70a6511 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Tue, 10 Mar 2026 12:11:26 -0700 Subject: [PATCH] fix(mcp): match auth_type required-field validation to UI compliance check (reject 'none') --- .../mcp_management_endpoints.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/litellm/proxy/management_endpoints/mcp_management_endpoints.py b/litellm/proxy/management_endpoints/mcp_management_endpoints.py index 2ebd8df78b6..70060a92568 100644 --- a/litellm/proxy/management_endpoints/mcp_management_endpoints.py +++ b/litellm/proxy/management_endpoints/mcp_management_endpoints.py @@ -173,9 +173,19 @@ if MCP_AVAILABLE: if not required_fields: return - missing = [ - f for f in required_fields if not getattr(payload, f, None) - ] + # Mirror the UI's compliance checks (MCPStandardsSettings.tsx FIELD_GROUPS): + # auth_type requires a real value — "none" is treated as absent. + _AUTH_TYPE_SENTINEL = "none" + + def _field_present(field_name: str) -> bool: + value = getattr(payload, field_name, None) + if not value: + return False + if field_name == "auth_type" and value == _AUTH_TYPE_SENTINEL: + return False + return True + + missing = [f for f in required_fields if not _field_present(f)] if missing: raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST,