From 907e6534fa320bc636468a4553e49b830121e739 Mon Sep 17 00:00:00 2001 From: MokshaVora Date: Mon, 10 Aug 2026 17:07:49 +0530 Subject: [PATCH] fix(mcp): preserve strict lint budget --- .../_experimental/mcp_server/mcp_server_manager.py | 10 +++++----- litellm/proxy/_experimental/mcp_server/server.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py index 8c60caf9692..71c901a0b0e 100644 --- a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py +++ b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py @@ -4844,11 +4844,11 @@ class MCPServerManager: user_api_key_auth=user_api_key_auth, ) - for header in mcp_server.extra_headers: - if not isinstance(header, str): - continue - if _is_gateway_attribution_header(header): - continue + for header in ( + header + for header in mcp_server.extra_headers + if isinstance(header, str) and not _is_gateway_attribution_header(header) + ): if header.lower() == "authorization" and strip_caller_authorization: continue header_value = normalized_raw_headers.get(header.lower()) diff --git a/litellm/proxy/_experimental/mcp_server/server.py b/litellm/proxy/_experimental/mcp_server/server.py index fa863536c44..bacab883ace 100644 --- a/litellm/proxy/_experimental/mcp_server/server.py +++ b/litellm/proxy/_experimental/mcp_server/server.py @@ -1763,11 +1763,11 @@ if MCP_AVAILABLE: user_api_key_auth=user_api_key_auth, ) - for header in server.extra_headers: - if not isinstance(header, str): - continue - if _is_gateway_attribution_header(header): - continue + for header in ( + header + for header in server.extra_headers + if isinstance(header, str) and not _is_gateway_attribution_header(header) + ): if header.lower() == "authorization" and ( strip_caller_authorization or withhold_forwarded_authorization ):