diff --git a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py index bd7d2636848..f94df33c90b 100644 --- a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py +++ b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py @@ -1177,8 +1177,10 @@ class MCPServerManager: # raw_headers may have lowercase keys depending on the ASGI server normalized = {k.lower(): v for k, v in raw_headers.items()} auth_value = normalized.get("authorization") - if auth_value and auth_value.startswith("Bearer "): - return auth_value[len("Bearer "):] + if auth_value: + if auth_value.startswith("Bearer "): + return auth_value[len("Bearer "):] + return auth_value return None def _build_stdio_env(