litellm/tests/test_litellm/proxy/_experimental/mcp_server
Sameer Kankute fe309ea0b0
fix(mcp): remove auth gate from OAuth broker authorize and token endpoints
Browser-initiated OAuth flows cannot send an API key, so requiring
user_api_key_auth on /server/oauth/{id}/authorize and /server/oauth/{id}/token
caused a 401 for all end users. Remove the dependency from both endpoints and
make user_api_key_dict optional in _get_cached_temporary_mcp_server_or_404 so
unauthenticated OAuth browser flows skip the admin-view gate.

Add regression tests:
- unit tests for loopback validation, state round-trip, and token validation
- respx HTTP integration tests covering the full authorize → callback → token flow
- Playwright E2E: Layer 1 directly asserts /authorize returns !401 without an API key; Layer 2 asserts the full UI OAuth form flow succeeds
- extend test-mcp.yml CI job to run both new test files

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-05 20:28:51 +05:30
..
auth feat(mcp): resolve team/key MCP permissions by server name or alias 2026-04-23 11:13:30 -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 fix(mcp): fail closed on DB outage in BYOK credential check 2026-04-24 18:44:57 +00:00
test_discoverable_endpoints.py fix(mcp): revalidate loopback at /callback + no-store on /token 2026-04-23 03:16:37 +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 style: run black formatter on files from main merge 2026-04-17 13:02:59 -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_flow_http_respx.py fix(mcp): remove auth gate from OAuth broker authorize and token endpoints 2026-05-05 20:28:51 +05:30
test_mcp_oauth_security_unit.py fix(mcp): remove auth gate from OAuth broker authorize and token endpoints 2026-05-05 20:28:51 +05:30
test_mcp_server.py style: black format test_mcp_server.py 2026-04-15 18:19:21 -07:00
test_mcp_server_manager.py style: apply black formatting 2026-04-23 16:00:28 -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 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 style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_rest_endpoints.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -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_ui_session_utils.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00