Repository navigation
[internal copy of #28008] Support MCP OAuth passthrough and issuer-scoped JWT auth #28356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mateo-berri
merged 135 commits into
litellm_internal_staging
from
litellm_feat/v1.84.0-mcp-gateway-jwt-auth
Jun 2, 2026
Merged
Changes from 131 commits
Commits
Show all changes
135 commits
Select commit
Hold shift + click to select a range
d8beb7d
fix(proxy): point /metrics 401 at the opt-out flag
yuneng-berri 7e0347c
Merge pull request #27505 from BerriAI/cherry-pick-metrics-optout-hin…
yuneng-berri a0b2811
fix(proxy): bound budget reservation per request instead of pinning t…
yuneng-berri b347015
fix(proxy): reserve per-image cost for image-generation requests
yuneng-berri d50c98d
fix(proxy): gate image-gen reservation strictly on model mode
yuneng-berri 18c14d9
Merge pull request #27539 from BerriAI/litellm_/budget-reservation-rc…
yuneng-berri 82c8cb8
build(packaging): relax core runtime pins to ranges
yuneng-berri 5bb2803
Merge pull request #27545 from BerriAI/litellm_/charming-sammet-8d77c3
yuneng-berri a5cc4ff
build(packaging): raise jinja2 floor to 3.1.6
yuneng-berri 188875b
Merge pull request #27554 from BerriAI/litellm_/charming-sammet-8d77c3
yuneng-berri 38bc921
fix(mcp): forward extra_headers for OpenAPI MCP tools
milan-berri c31ead8
refactor(mcp): access has_client_credentials on MCPServer directly
milan-berri a1d1906
fix(mcp): static headers win over forwarded headers in OpenAPI MCP
cursoragent 4046cb1
Merge pull request #27768 from milan-berri/litellm_cherry-pick-27383-…
yuneng-berri 111ee52
fix(proxy): always merge caller-supplied tags into request metadata
yuneng-berri cd9d312
docs(proxy): refresh stale comments referencing removed tag strip
yuneng-berri 74bb525
Merge pull request #27789 from BerriAI/litellm_/wizardly-sammet-94baac
yuneng-berri 590bc83
chore: reject bare str at file-input sinks to prevent local-file read…
krrish-berri-2 037d4c5
Merge pull request #27794 from BerriAI/litellm_/fervent-archimedes-7e…
yuneng-berri 2675b50
Strip SERVER_ROOT_PATH before lazy-feature prefix match
yuneng-berri c14cab9
Cache normalized SERVER_ROOT_PATH at middleware init
yuneng-berri 069469c
chore(proxy): backport /key/regenerate ownership-rebind + premium-gat…
yuneng-berri 8b90a54
Merge pull request #27818 from BerriAI/litellm_backport_27812_to_1840rc2
yuneng-berri 2b189be
Merge pull request #27819 from BerriAI/litellm_backport_regenerate_gu…
yuneng-berri be37cf7
fix(proxy): expose db status on public /health/readiness
yuneng-berri be0526b
Merge pull request #27868 from BerriAI/backport-pr-27866-into-1.84.0rc2
yuneng-berri ab0267d
fix(ui): fetch version + debug flag from /health/readiness/details
yuneng-berri 51ed234
fix(ui): disable retries on readiness/details + cover token forwarding
yuneng-berri 305875f
Merge pull request #27899 from BerriAI/backport-pr-27896-into-1.84.0rc2
yuneng-berri 02c5e1c
chore: update Next.js build artifacts (2026-05-14 03:52 UTC, node v20…
yuneng-berri 50030e3
Merge pull request #27901 from BerriAI/yj_build_may13
yuneng-berri 974f5cd
Merge pull request #27898 from stuxf/chore/banned-params-extra-body-c…
yuneng-berri 3dd763d
Merge pull request #27801 from stuxf/chore/get-instance-fn-runtime-s3…
yuneng-berri 08ea016
Merge pull request #27902 from BerriAI/litellm_/eager-euler-fd3639
yuneng-berri fdb55ab
fix: block client-side pricing injection via request body
krrish-berri-2 b2c93b1
fix: block SSRF fields in RAG ingest vector_store config
krrish-berri-2 d35d2a7
fix: harden /key/update authorization checks (#27878)
krrish-berri-2 087003e
Merge pull request #27903 from BerriAI/backport/27892-litellm_1.84.0rc2
yuneng-berri fe18665
Merge remote-tracking branch 'origin/litellm_1.84.0rc2' into backport…
yuneng-berri 321d576
Merge pull request #27904 from BerriAI/backport/27878-litellm_1.84.0rc2
yuneng-berri 0f741fc
bump: version 0.4.71 → 0.4.72
yuneng-berri fcd63b0
uv lock
yuneng-berri e1fc955
Merge pull request #27909 from BerriAI/backport/27908-litellm_1.84.0rc2
yuneng-berri d0cc1a4
feat(mcp): support OAuth passthrough discovery
gym-cmd 0daeeab
fix(mcp): support OAuth browser auth
gym-cmd 8e864f3
fix(mcp): refine upstream OAuth metadata fallback
gym-cmd da24c89
feat(proxy): support issuer-scoped JWT auth
gym-cmd c279f4e
fix(mcp): validate oauth callback redirect sink
gym-cmd 1d731af
feat(proxy): support issuer-scoped JWT auth
gym-cmd dee5d55
test(mcp): align trusted proxy fixtures
gym-cmd dfb1e33
style(mcp): satisfy black formatting
gym-cmd b290416
chore(ui): bump next to 16.2.6
gym-cmd 8ca2f14
fix(mcp): address oauth passthrough review findings
gym-cmd 6079a5f
test(mcp): split oauth passthrough regressions
gym-cmd 409a005
fix(interactions): align openapi response fields
gym-cmd 3753970
security: prevent forwarding litellm api keys to upstream mcp servers
gym-cmd 3990165
fix(interactions): remove steps field not in google openapi spec
gym-cmd f6359cb
fix(mcp): forward Authorization in pass-through when x-litellm-api-ke…
artem-dudarev-jet 216e055
fix(interactions): align status enum with openapi spec
gym-cmd 806b8be
fix(mcp,jwt): address greptile review concerns
claude a119324
test: replace dall-e-3 with gpt-image-1 in health check and router te…
yuneng-berri 93d3ed7
fix(tests): drop dall-e-only test classes; route live image tests via…
yuneng-berri a0b61f6
test(fireworks): replace deprecated llama-v3p3-70b-instruct model
yuneng-berri 76700e7
test(fireworks): mock remaining live smoke tests
yuneng-berri c65e598
fix(tests): replace shut-down gpt-4o-audio-preview with gpt-audio-1.5…
yuneng-berri 37845ac
fix(tests): migrate realtime + rerank tests off shut-down upstream mo…
yuneng-berri 76c704b
fix(model_prices): register mistral/ministral-8b-2512
claude 298936f
fix(mcp,auth): address greptile review concerns
claude d42a66a
Merge branch 'litellm_internal_staging' into litellm_feat/v1.84.0-mcp…
claude fc31a07
Merge remote-tracking branch 'origin/litellm_feat/v1.84.0-mcp-gateway…
claude 087a4da
fix(tests): backfill local model_cost into remote-fetched map
claude 22e9064
fix(mcp,jwt): address greptile concurrency and code-quality concerns
claude b4df1a9
Merge remote-tracking branch 'upstream/litellm_internal_staging' into…
gym-cmd 488fcc2
fix(jwt,mcp): fall back to global JWKS on unknown issuer; prune fetch…
claude 1e5053a
fix(mcp,auth): restore client_ip in oauth2 target check, drop from de…
claude eae390b
fix(mcp): respect client ip for delegated auth
gym-cmd a6492bf
fix(auth): address remaining greptile style findings
claude 6f82537
Merge branch 'litellm_internal_staging' into litellm_feat/v1.84.0-mcp…
claude 5d8f74f
fix(jwt): strip internal _litellm_* claims in global JWKS auth path
cursoragent a86f6e7
fix(mcp): surface MCPUpstreamAuthError as 401 in SSE/HTTP transport h…
cursoragent 326c6bb
fix(mcp): add upstream auth pre-flight in SSE handler
claude 78cb412
fix(mcp): tighten cold-start bypass against CSV paths + dedupe upstre…
cursoragent ee38ba1
fix(mcp,tests): sync stubs and cold-start assertions with delegate-check
claude f0eb54e
fix(mcp): correct passthrough probe 401 + slashed-name cold start parser
cursoragent 96e4de3
style(mcp): format discoverable endpoints
gym-cmd d1d9ff0
refactor(mcp): dedupe MCPUpstreamAuthError->HTTPException + thread cl…
cursoragent 719adfd
fix(mcp): handle passthrough OAuth metadata and startup auth errors
cursoragent 7ba7815
fix(mcp): restrict passthrough probe challenge to OAuth passthrough s…
cursoragent 2636bbc
test(proxy): cover issuer-scoped JWT auth
gym-cmd 0447ba6
fix(mcp): use resource metadata for passthrough reauth
gym-cmd 31f8c56
fix(mcp,tests): assert cold-start helper directly for aggregate /mcp
mateo-berri 6697fdb
Merge PR #28008 (gym-cmd/litellm:feat/v1.84.0-mcp-gateway-jwt-auth) i…
cursoragent 7905e99
fix(mcp,jwt): drop unneeded async helper + suppress misleading unscop…
mateo-berri 91f44f3
fix(jwt,mcp): clarify issuers fallthrough + add TTL on mcp permission…
mateo-berri 86cf3ef
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
cursoragent 418e266
fix(tests): align merged JWT and MCP cold-start assertions
cursoragent 1434ad3
fix(jwt): guard litellm_jwtauth access in auth_jwt global path
mateo-berri e2e4f70
Merge latest litellm_feat/v1.84.0-mcp-gateway-jwt-auth into local mer…
cursoragent 026c237
Merge latest litellm_feat/v1.84.0-mcp-gateway-jwt-auth
cursoragent 0511b76
Gate MCP OAuth pass-through on delegate_auth_to_upstream flag
mateo-berri 22cfb55
fix(mcp): route org object_permission lookup through shared auth helpers
mateo-berri 123f0fd
fix(mcp): wrap get_object_permission call in shared try/except
cursoragent 0fada28
fix(jwt): validate issuer audience at config load + dedicated key-mis…
mateo-berri e9ff79c
fix(mcp): admit and forward Authorization for passthrough OAuth return
cursoragent 7dfef63
fix(mcp): consistent www-authenticate casing + SSE toolset scoping
cursoragent ec3c670
security(mcp): strip Authorization in call_tool when LiteLLM admissio…
mateo-berri b80a91f
refactor(mcp): centralize caller Authorization strip decision
cursoragent 457b21f
log MCP OAuth discovery diagnostics for unmatched paths and non-trans…
mateo-berri 4ddbb91
fix(jwt): include issuer-normalized team id in get_all_jwt_team_ids
cursoragent f5a193f
fix(mcp/jwt): dedupe cold-start path parser; reject conflicting audie…
mateo-berri ad8c9c2
fix(mcp): restrict passthrough cold-start bypass to 401 only
cursoragent 1b0b75c
fix(jwt/mcp): warn on unscoped JWT fallback; route agent permission l…
mateo-berri 064f31e
fix(mcp): fabricate resource_metadata challenge when upstream 401 omi…
mateo-berri 20e6447
fix(jwt): make _get_decode_options explicitly control verify_iss
cursoragent ca8e04c
fix(mcp): emit absolute resource_metadata URI in fabricated 401 chall…
mateo-berri 77206df
fix(mcp): correct 403 detail text and remove dead _list_tools_for_sin…
cursoragent c949c54
fix: address potential bugs in auth_utils, mcp discoverable endpoints…
cursoragent 0d999c0
test(vertex): tolerate transient InternalServerError in google maps t…
mateo-berri 4f3e79e
refactor(mcp): drop redundant has_client_credentials filter on passth…
cursoragent c6eafec
Merge origin/litellm_internal_staging into litellm_feat/v1.84.0-mcp-g…
mateo-berri 1bdeeec
fix: restore unreachable InternalServerError skip handler in vertex test
cursoragent ccea19d
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
mateo-berri 172c11b
feat(mcp): add dedicated oauth_passthrough flag for non-oauth2 pass-t…
mateo-berri 1d73f1b
fix(mcp): reconcile cold-start bypass with x-mcp-servers header and s…
cursoragent 9469ede
fix(mcp): fabricate path-aware resource_metadata URI for upstream 401
cursoragent 61c9a2f
fix(jwt+mcp): tighten issuer-scoped claim type handling, RFC-quote au…
cursoragent adc4a83
Merge origin/litellm_internal_staging into litellm_feat/v1.84.0-mcp-g…
mateo-berri 53806eb
chore(docker): align Dockerfile.non_root/Dockerfile.database to curre…
mateo-berri 98472c9
ci(docker): bump wolfi-base pin to current working digest
mateo-berri 5a8adc3
ci(docker): retry apk add in Dockerfile.database for apk.cgr.dev flakes
mateo-berri 625e3bc
fix(mcp): scope preemptive 401 to toolset-narrowed server set
cursoragent 9288f83
revert(docker): drop unrelated Wolfi bump and apk retry loop from MCP…
mateo-berri 06eb433
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
mateo-berri ec48d4d
fix(mcp): surface upstream 403 challenges from REST tools/list
mateo-berri 390f3aa
fix(mcp): fail closed for IP access control when XFF trusted ranges u…
mateo-berri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| # Base image for building | ||
| ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:3258be472764337fd13095bcbb3182da170243b5819fd67ad4c0754590588b31 | ||
| ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:5743937d521cbeb9e8c73bf1bd7ba2589c178940eb03d7b148efecc962be8587 | ||
|
|
||
| # Runtime image | ||
| ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:3258be472764337fd13095bcbb3182da170243b5819fd67ad4c0754590588b31 | ||
| ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:5743937d521cbeb9e8c73bf1bd7ba2589c178940eb03d7b148efecc962be8587 | ||
| ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a | ||
|
|
||
| FROM $UV_IMAGE AS uvbin | ||
|
|
@@ -15,16 +15,20 @@ USER root | |
| COPY --from=uvbin /uv /usr/local/bin/uv | ||
| COPY --from=uvbin /uvx /usr/local/bin/uvx | ||
|
|
||
| RUN apk add --no-cache \ | ||
| bash \ | ||
| gcc \ | ||
| python3 \ | ||
| python3-dev \ | ||
| openssl \ | ||
| openssl-dev \ | ||
| nodejs \ | ||
| npm \ | ||
| libsndfile | ||
| RUN for i in 1 2 3; do \ | ||
| apk add --no-cache \ | ||
| bash \ | ||
| gcc \ | ||
| python3 \ | ||
| python3-dev \ | ||
| openssl \ | ||
| openssl-dev \ | ||
| nodejs \ | ||
| npm \ | ||
| libsndfile && break; \ | ||
| [ $i = 3 ] && { echo "apk add failed after 3 retries" >&2; exit 1; }; \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again? Why do we need this change?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, reverted |
||
| sleep 5; \ | ||
| done | ||
|
|
||
| ENV UV_PROJECT_ENVIRONMENT=/app/.venv \ | ||
| UV_LINK_MODE=copy \ | ||
|
|
@@ -66,7 +70,11 @@ FROM $LITELLM_RUNTIME_IMAGE AS runtime | |
|
|
||
| USER root | ||
|
|
||
| RUN apk add --no-cache bash openssl tzdata nodejs npm python3 libsndfile && \ | ||
| RUN for i in 1 2 3; do \ | ||
| apk add --no-cache bash openssl tzdata nodejs npm python3 libsndfile && break; \ | ||
| [ $i = 3 ] && { echo "apk add failed after 3 retries" >&2; exit 1; }; \ | ||
| sleep 5; \ | ||
| done && \ | ||
| npm install -g npm@11.12.1 tar@7.5.11 glob@11.1.0 @isaacs/brace-expansion@5.0.1 minimatch@10.2.4 diff@8.0.3 && \ | ||
| GLOBAL="$(npm root -g)" && \ | ||
| find "$GLOBAL/npm" -type d -name "tar" -path "*/node_modules/tar" | while read d; do \ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...proxy_extras/migrations/20260526120000_add_oauth_passthrough_to_mcp_servers/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| -- AlterTable | ||
| ALTER TABLE "LiteLLM_MCPServerTable" ADD COLUMN IF NOT EXISTS "oauth_passthrough" BOOLEAN NOT NULL DEFAULT false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WHy do we need these changes for this PR?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted