litellm/tests/test_litellm/proxy/_experimental/mcp_server
user bf935a556c
fix(mcp): remove auto-promote of unknown client IP to internal sentinel
Previously _get_allowed_mcp_servers fell back to INTERNAL_REQUEST when
both the explicit client_ip and the auth-context IP were missing,
defeating the new fail-closed gate at the wrapper layer. An external
request with no attributable client IP could reach internal-only MCP
servers via tool/list/resource calls.

Drop the auto-promote: pass None through, which now fails closed in
filter_server_ids_by_ip_with_info. Internal callers must opt in to
INTERNAL_REQUEST explicitly.

Update test_mcp_routing_with_conflicting_alias_and_group_name to mock
_get_client_ip_from_context with a real internal IP — the unit test has
no HTTP request context so it would otherwise be filtered out by the
fail-closed gate.

Update test_mcp_ip_filtering tests to assert the new fail-closed
behavior on missing IP and the INTERNAL_REQUEST escape hatch.
2026-05-11 20:14:48 +00:00
..
auth feat(mcp): add OBO MCP Auth (#27421) 2026-05-07 15:35:21 -07: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 [litellm-agent] Staging → litellm_internal_staging (5/7/2026) (#27375) 2026-05-07 21:29:47 +00: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 chore(mcp): close redirect-bypass + name-lookup variants of the SSRF/IP gating 2026-05-11 20:14: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_server.py fix(mcp): remove auto-promote of unknown client IP to internal sentinel 2026-05-11 20:14:48 +00:00
test_mcp_server_manager.py chore(mcp): close fail-open variants in get_filtered_registry and filter_server_ids_by_ip 2026-05-11 20:14:48 +00: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 Merge pull request #26032 from BerriAI/litellm_mcp_pkce_fix_v2 2026-04-18 14:52:31 -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): forward extra_headers for OpenAPI MCP tools (#27383) 2026-05-09 15:10:54 -04:00
test_openapi_tool_auth.py fix(mcp): use canonical proxy_logging_obj, deny when MCP server is unresolvable 2026-05-01 22:28:46 +00:00
test_rest_endpoints.py chore(mcp): close redirect-bypass + name-lookup variants of the SSRF/IP gating 2026-05-11 20:14:48 +00: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