From f1f58bd1d1810f267e23ed0462868126de89854e Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Tue, 30 Sep 2025 07:12:56 +0900 Subject: [PATCH 1/2] fix: resolve regression with duplicate Mcp-Protocol-Version header --- litellm/experimental_mcp_client/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/experimental_mcp_client/client.py b/litellm/experimental_mcp_client/client.py index 1176248d4f..225349b4e8 100644 --- a/litellm/experimental_mcp_client/client.py +++ b/litellm/experimental_mcp_client/client.py @@ -194,7 +194,7 @@ class MCPClient: def _get_auth_headers(self) -> dict: """Generate authentication headers based on auth type.""" - headers = {"MCP-Protocol-Version": "2025-06-18"} + headers = {} if self._mcp_auth_value: if isinstance(self._mcp_auth_value, str): From 5359a0d6a6d447078cd939d025087f7cb3e461f4 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Tue, 30 Sep 2025 07:25:32 +0900 Subject: [PATCH 2/2] fix: test --- tests/mcp_tests/test_mcp_client_unit.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/mcp_tests/test_mcp_client_unit.py b/tests/mcp_tests/test_mcp_client_unit.py index 12ed7a3024..cdeee679d1 100644 --- a/tests/mcp_tests/test_mcp_client_unit.py +++ b/tests/mcp_tests/test_mcp_client_unit.py @@ -44,7 +44,6 @@ class TestMCPClientUnitTests: headers = client._get_auth_headers() assert headers == { "Authorization": "Bearer test_token", - "MCP-Protocol-Version": "2025-06-18", } # Basic auth @@ -55,7 +54,6 @@ class TestMCPClientUnitTests: headers = client._get_auth_headers() assert headers == { "Authorization": f"Basic {expected_encoded}", - "MCP-Protocol-Version": "2025-06-18", } # API key @@ -65,7 +63,6 @@ class TestMCPClientUnitTests: headers = client._get_auth_headers() assert headers == { "X-API-Key": "api_key_123", - "MCP-Protocol-Version": "2025-06-18", } # Custom authorization header @@ -77,13 +74,12 @@ class TestMCPClientUnitTests: headers = client._get_auth_headers() assert headers == { "Authorization": "Token custom_token", - "MCP-Protocol-Version": "2025-06-18", } # No auth client = MCPClient("http://example.com") headers = client._get_auth_headers() - assert headers == {"MCP-Protocol-Version": "2025-06-18"} + assert headers == {} @pytest.mark.asyncio @patch("litellm.experimental_mcp_client.client.streamablehttp_client") @@ -112,7 +108,6 @@ class TestMCPClientUnitTests: call_args = mock_transport.call_args assert call_args[1]["headers"] == { "Authorization": "Bearer test_token", - "MCP-Protocol-Version": "2025-06-18", } # Verify session was initialized