litellm/tests/test_litellm/proxy/_experimental/mcp_server
mateo-berri 0511b76ada
Gate MCP OAuth pass-through on delegate_auth_to_upstream flag
Sameer's review on #28356/#28008 flagged that the new pass-through
behaviors (preemptive 401 challenges, /.well-known/oauth-protected-
resource proxying, upstream 401/403 propagation as MCPUpstreamAuthError,
and Authorization-stripping when no x-litellm-api-key is supplied)
were implicitly enabled for every server with auth_type=none plus
Authorization in extra_headers. Existing users doing static bearer
pass-through for non-OAuth reasons would have silently regressed.

Make the detection rule explicit: extend the existing
delegate_auth_to_upstream flag (previously oauth2-only) to also gate
is_oauth_passthrough. Now requires flag + auth_type=None + Authorization
in extra_headers, per Sameer's suggested detection rule. The UI toggle
now appears for both modes (oauth2 PKCE passthrough and auth_type=none
OAuth pass-through) with mode-appropriate copy.

Update test fixtures to set the flag where the test intent is to
exercise OAuth pass-through behavior, and add negative tests covering
the new default-false case.
2026-05-21 16:17:16 +00:00
..
auth Merge latest litellm_feat/v1.84.0-mcp-gateway-jwt-auth into local merge branch 2026-05-21 03:54:48 +00:00
guardrail_translation fix(tests): Add missing mocks for MCP IP filtering and updated APIs (#20652) 2026-02-07 11:30:49 -08:00
test_byok_oauth_endpoints.py feat(mcp): allow native MCP OAuth support for cursor (#28327) 2026-05-20 15:28:44 -07:00
test_db_credentials.py fix(mcp): re-encrypt user credentials during master-key rotation 2026-04-30 01:58:26 +00:00
test_discoverable_endpoints.py Merge latest litellm_feat/v1.84.0-mcp-gateway-jwt-auth into local merge branch 2026-05-21 03:54:48 +00:00
test_is_tool_name_prefixed.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_jwt_mcp_enforcement.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_jwt_mcp_simple.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_mcp_cost_calculator.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_mcp_custom_fields.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_mcp_debug.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_mcp_discovery.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_mcp_hook_extra_headers.py feat(mcp): add OBO MCP Auth (#27421) 2026-05-07 15:35:21 -07:00
test_mcp_metadata_preservation.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_mcp_oauth_passthrough.py Gate MCP OAuth pass-through on delegate_auth_to_upstream flag 2026-05-21 16:17:16 +00:00
test_mcp_oauth_passthrough_cold_start.py Gate MCP OAuth pass-through on delegate_auth_to_upstream flag 2026-05-21 16:17:16 +00:00
test_mcp_oauth_passthrough_tools.py Gate MCP OAuth pass-through on delegate_auth_to_upstream flag 2026-05-21 16:17:16 +00:00
test_mcp_server.py Gate MCP OAuth pass-through on delegate_auth_to_upstream flag 2026-05-21 16:17:16 +00:00
test_mcp_server_manager.py fix(mcp): JWT on tools/list and REST tools/call server resolution (#28227) 2026-05-20 13:31:44 -07:00
test_mcp_sigv4_auth.py style: black format test_mcp_sigv4_auth.py 2026-04-15 18:19:08 -07:00
test_mcp_stale_session.py feat(mcp): add delegate_auth_to_upstream flag for PKCE passthrough (#27834) 2026-05-13 12:06:13 -07:00
test_mcp_toolset_scope.py Litellm ishaan march23 - MCP Toolsets + GCP Caching fix (#25146) (#25155) 2026-04-04 16:23:21 -07:00
test_oauth2_token_cache.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_openapi_to_mcp_generator.py fix(mcp): static headers win over forwarded headers in OpenAPI MCP 2026-05-12 23:33:37 +03:00
test_openapi_tool_auth.py [Infra] Promote internal staging to main (#27245) 2026-05-05 16:15:03 -07:00
test_rest_endpoints.py fix(mcp): JWT on tools/list and REST tools/call server resolution (#28227) 2026-05-20 13:31:44 -07:00
test_semantic_tool_filter.py fix(mcp_semantic_tool_filter): match tools with client-side namespace prefix (#26078) (#26117) 2026-04-22 19:06:34 -07:00
test_short_mcp_tool_prefix.py fix(mcp): address greptile review on short tool prefix 2026-04-29 03:59:40 +00:00
test_ui_session_utils.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00