litellm/tests/e2e/mcp
devin-ai-integration[bot] 2d82915084
fix(mcp): bind OAuth clients to their upstream issuer (#37777)
* feat(mcp): advertise the SDK's latest spec revision and validate the RFC 9207 iss

MCPSpecVersion stopped at 2025-06-18 while the pinned SDK negotiates 2025-11-25, and the version LiteLLM puts on its own outbound initialize was a hardcoded historical member. Add the missing revision, name the highest revision we speak once, and pin it to the SDK's LATEST_PROTOCOL_VERSION with a test so the two cannot drift apart silently.

/authorize now seals the issuer it sent the user to into the OAuth state, and /callback holds the authorization response's RFC 9207 iss against it, refusing to forward a code that came back from an authorization server we never sent the user to. An absent iss, an unanchored server row and a state minted before the seal all keep their current behavior.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(mcp): keep params, query and fragment significant in issuer comparison

The shared canonicalizer drops all three, so two issuers differing only outside the path compared equal and a response from another tenant's authorization server would have continued through the flow.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(mcp): refresh generated API snapshots

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(mcp): cover OAuth client isolation and lint checks

* fix(mcp): preserve registered clients in the existing save payload

* test(mcp): cover optional OAuth registration metadata

* fix(mcp): preserve compatible OAuth registrations across edits

* fix(mcp): retain OAuth state through pending authorization

* fix(mcp): guard pending OAuth at form submission

* fix(mcp): discard canceled OAuth edit snapshots

* test(mcp): preserve complete OAuth registration assertions

* refactor(mcp): construct OAuth credential updates without mutation

* fix(mcp): simplify issuer binding and reject unverifiable callbacks

* fix(mcp): preserve replacement clients and pending redirect bindings

* fix(mcp): retain clients with replacement authentication methods

* fix(mcp): preserve cached clients and pin manual OAuth issuers

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com>
2026-10-05 10:25:47 -07:00
..
conftest.py test(e2e): harden stage flakes for batches, UI, and MCP (#33831) 2026-07-18 19:11:54 +00:00
datadog_mcp.py fix(mcp): honor an explicit null on toolset update, cover MCP lifecycle e2e (#40022) 2026-09-08 22:50:13 -07:00
linear_session_capture.py test(e2e): drive a real Linear OAuth MCP through chat completions under both ingress headers 2026-07-22 23:29:10 -07:00
mcp_client.py test(mcp): await registration on every configured replica 2026-09-17 10:13:45 -07:00
oauth_chat_client.py test(e2e): restore LIT-3467 implementation for rework 2026-09-19 16:21:53 -07:00
oauth_gateway.py feat(jwt): auto_register_map_existing_key maps JWT to the user's existing virtual key (#42375) 2026-10-02 12:11:33 -07:00
test_mcp_access_group_e2e.py test(e2e): poll MCP tools across multi-worker lag (#35047) 2026-07-28 22:15:21 -07:00
test_mcp_chat_completion_oauth_e2e.py test(e2e): restore existing OAuth chat test to baseline 2026-09-19 12:17:51 -07:00
test_mcp_datadog_e2e.py test(e2e): unskip four tests whose blockers no longer hold 2026-08-28 00:01:51 -07:00
test_mcp_guardrail_e2e.py test(e2e): unskip four tests whose blockers no longer hold 2026-08-28 00:01:51 -07:00
test_mcp_key_access_e2e.py test(mcp): reuse the registered server snapshot for alias grants 2026-09-17 10:03:36 -07:00
test_mcp_oauth_happy_path_e2e.py fix(mcp): bind OAuth clients to their upstream issuer (#37777) 2026-10-05 10:25:47 -07:00
test_mcp_toolset_enforcement_e2e.py fix(mcp): honor an explicit null on toolset update, cover MCP lifecycle e2e (#40022) 2026-09-08 22:50:13 -07:00