litellm/tests/unit/proxy/_experimental/mcp_server
yuneng-jiang ac6300f380
fix(mcp): stop proxy-started legacy listeners from consuming server rpm (#46968)
* fix(mcp): stop proxy-started legacy listeners from consuming server rpm

The listener the proxy opens on notifications/initialized for legacy MCP
sessions ran the server rate-limit admission once per target, so every
session spent an rpm slot before the client sent anything. Admission is
now injected into the listener and applied only to client-initiated
subscriptions (subscriptions/listen and resources/subscribe). Authorization
and its periodic recheck still run on every path.

* test(mcp): key the fake admission window by caller and server

* fix(mcp): stop subscription catalog refreshes from consuming server rpm

A subscription listener lists the caller's catalog to diff list_changed
events, at setup and on every upstream event. Those listings went through
the normal per-server admission, so against an upstream that declares
listChanged each legacy session spent several rpm slots before the client
asked for anything. The listener now marks its targets as already admitted
for its own lifetime, so its refreshes reuse the subscription's admission.
Client requests on the session are still metered.

* test(mcp): exercise subscription admission through the proxy rate limiter
2026-10-16 14:30:04 -07:00
..
auth feat(mcp): accept an ID-JAG as an RFC 7523 jwt-bearer grant on the gateway token endpoint (#46748) 2026-10-16 12:16:55 -07:00
faults fix(mcp): resolve /mcp/proxy tool_id from the owning server instead of relisting every server (#46545) 2026-10-15 22:46:50 +00:00
guardrail_translation test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
outbound_credentials feat(sso): retain the SAML assertion at login as the saml2 subject token for oauth2_id_jag (#46745) 2026-10-16 12:16:56 -07:00
__init__.py ci: move provider-independent MCP tests into tests/unit and run mcp-integration from litellm-tests (#42904) 2026-09-24 23:07:48 +00:00
conftest.py feat(mcp): add portable catalog pagination (#44446) 2026-10-06 18:54:50 -07:00
test_byok_credential_cache.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_byok_oauth_endpoints.py fix(mcp): keep worker MCP configurations consistent via a catalog revision (#42568) 2026-10-06 18:21:29 -07:00
test_callback_oauth_error_responses.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_capabilities.py feat(mcp): enable verified stateless protocol capabilities (#46264) 2026-10-15 23:18:18 +00:00
test_catalog.py fix(mcp): honor scoped cache freshness (#45165) 2026-10-07 17:19:24 -07:00
test_client_allowlist.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_contracts.py fix(mcp): scope gateway OAuth consent to x-mcp-servers and add explicit scope setting (#44957) 2026-10-15 15:58:34 -07:00
test_db_credentials.py feat(mcp): separate confidential client for ID-JAG leg 2 (#46211) 2026-10-14 10:04:31 -04:00
test_discoverable_endpoints.py feat(mcp): accept an ID-JAG as an RFC 7523 jwt-bearer grant on the gateway token endpoint (#46748) 2026-10-16 12:16:55 -07:00
test_gateway_dcr_flow.py feat(mcp): accept an ID-JAG as an RFC 7523 jwt-bearer grant on the gateway token endpoint (#46748) 2026-10-16 12:16:55 -07:00
test_id_jag_grant.py feat(mcp): accept an ID-JAG as an RFC 7523 jwt-bearer grant on the gateway token endpoint (#46748) 2026-10-16 12:16:55 -07:00
test_idp_token_exchange.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_interactions.py feat(mcp): translate input requests and bind continuations (#45464) 2026-10-08 20:10:10 -07:00
test_is_tool_name_prefixed.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_jwt_mcp_enforcement.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_jwt_mcp_simple.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_mcp_auth_header_extraction.py ci: move provider-independent MCP tests into tests/unit and run mcp-integration from litellm-tests (#42904) 2026-09-24 23:07:48 +00:00
test_mcp_auth_priority.py ci: move provider-independent MCP tests into tests/unit and run mcp-integration from litellm-tests (#42904) 2026-09-24 23:07:48 +00:00
test_mcp_block_recording.py fix(mcp): keep worker MCP configurations consistent via a catalog revision (#42568) 2026-10-06 18:21:29 -07:00
test_mcp_chat_completions.py refactor: expose core private helpers under public names (#44871) 2026-10-07 00:05:27 +00:00
test_mcp_client_unit.py test: update stale MCP call_tool and usage card assertions, add timeout headroom to request-log index boot test (#45523) 2026-10-08 23:44:46 -07:00
test_mcp_cost_calculator.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_mcp_custom_fields.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_mcp_debug.py fix(security): remove the publicly known master key from the repo (#44718) 2026-10-06 10:55:24 -07:00
test_mcp_discovery.py feat(mcp): add Microsoft 365 (Graph) server to the MCP catalog (#43099) 2026-10-02 02:50:29 +00:00
test_mcp_elicitation_handler.py fix(mcp): preserve elicitation context and report relay failures (#45255) 2026-10-08 10:18:25 -07:00
test_mcp_env_vars.py test: migrate proxy security, schema migration and MCP legacy tests (#45937) 2026-10-11 16:17:24 -07:00
test_mcp_guardrail_usage_monitor.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_mcp_header_alias_utils.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_mcp_hook_extra_headers.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_mcp_logging.py refactor(mcp): extract upstream preparation and support modern clients (#44232) 2026-10-02 16:04:11 -07:00
test_mcp_max_concurrent_requests.py fix(mcp)!: preserve scopes during managed OAuth reauthorization (#45886) 2026-10-12 17:10:05 -04:00
test_mcp_metadata_preservation.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_mcp_oauth_passthrough.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_mcp_oauth_passthrough_cold_start.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_mcp_oauth_passthrough_tools.py fix(mcp): accept validated JWT subjects after virtual-key mapping (#46549) 2026-10-15 15:15:20 -07:00
test_mcp_partial_update.py fix(security): remove the publicly known master key from the repo (#44718) 2026-10-06 10:55:24 -07:00
test_mcp_proxy_mode.py fix(mcp): resolve /mcp/proxy tool_id from the owning server instead of relisting every server (#46545) 2026-10-15 22:46:50 +00:00
test_mcp_sampling_completion_flow.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_mcp_sampling_model_access.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_mcp_sampling_model_resolution.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_mcp_sampling_priority_selection.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_mcp_sampling_request_builder.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_mcp_sampling_response_conversion.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_mcp_sampling_tool_conversion.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_mcp_server.py fix(mcp): resolve a bare tool name on a single-server scope against that server (#46225) 2026-10-13 14:39:52 -07:00
test_mcp_server_identity_env.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_mcp_server_manager.py feat(sso): retain the SAML assertion at login as the saml2 subject token for oauth2_id_jag (#46745) 2026-10-16 12:16:56 -07:00
test_mcp_server_tool_calls_and_headers.py fix(mcp): preserve progress and cancel upstream work promptly (#46134) 2026-10-15 14:53:36 -04:00
test_mcp_session_logging.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_mcp_sigv4_auth.py fix(mcp): keep one upstream MCP session per gateway session across tool calls (#42741) 2026-10-10 14:49:45 -07:00
test_mcp_stale_session.py feat(mcp): add mcp_disabled_capabilities to stop advertising prompts and resources (#46563) 2026-10-15 15:15:40 -07:00
test_mcp_tool_search.py fix(mcp): preserve progress and cancel upstream work promptly (#46134) 2026-10-15 14:53:36 -04:00
test_mcp_toolset_scope.py fix(mcp): scope gateway OAuth consent to x-mcp-servers and add explicit scope setting (#44957) 2026-10-15 15:58:34 -07:00
test_oauth2_flow_backfill.py fix(mcp): keep worker MCP configurations consistent via a catalog revision (#42568) 2026-10-06 18:21:29 -07:00
test_oauth2_mcp_config.yaml ci: move provider-independent MCP tests into tests/unit and run mcp-integration from litellm-tests (#42904) 2026-09-24 23:07:48 +00:00
test_oauth2_token_cache.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_oauth_identity_binding.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_oauth_issuer_stamp_backfill.py fix(mcp): keep worker MCP configurations consistent via a catalog revision (#42568) 2026-10-06 18:21:29 -07:00
test_openapi_spec_path_url.py ci: move provider-independent MCP tests into tests/unit and run mcp-integration from litellm-tests (#42904) 2026-09-24 23:07:48 +00:00
test_openapi_to_mcp_generator.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_openapi_tool_auth.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_operations.py feat(mcp): enable verified stateless protocol capabilities (#46264) 2026-10-15 23:18:18 +00:00
test_per_user_oauth_cache.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_proxy_api_credentials.py feat(mcp): accept an ID-JAG as an RFC 7523 jwt-bearer grant on the gateway token endpoint (#46748) 2026-10-16 12:16:55 -07:00
test_rest_endpoints.py fix(mcp): exclude gateway credentials from guardrail bearers (#45897) 2026-10-10 18:00:16 -07:00
test_result_conversion.py fix(mcp): honor scoped cache freshness (#45165) 2026-10-07 17:19:24 -07:00
test_semantic_tool_filter.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00
test_server_resolution.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_short_mcp_tool_prefix.py fix(mcp): keep worker MCP configurations consistent via a catalog revision (#42568) 2026-10-06 18:21:29 -07:00
test_state_tokens.py feat(mcp): add portable catalog pagination (#44446) 2026-10-06 18:54:50 -07:00
test_subscriptions.py fix(mcp): stop proxy-started legacy listeners from consuming server rpm (#46968) 2026-10-16 14:30:04 -07:00
test_ui_session_utils.py fix(mcp): resolve team-granted toolsets for non-admin keys and dashboard sessions (#43908) 2026-10-01 14:15:06 -07:00
test_utils.py test(proxy): move proxy_server, _experimental and db tests into tests/unit/proxy (#44012) 2026-10-01 18:14:24 +00:00