Repository navigation
fix(mcp): preserve upstream OAuth 401 challenge for stored per-user MCP tokens #31362
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
Closed
mateo-berri
wants to merge
9
commits into
litellm_internal_staging
from
litellm_mcp_auth_challenge_passthrough
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9d5bf52
fix(mcp): preserve upstream OAuth 401 challenge for stored per-user M…
mateo-berri b3ac360
chore(lint): use builtin generics in _check_oauth2_upstream_auth for …
mateo-berri cf5664a
perf(mcp): parallelize per-user OAuth2 upstream auth probes
mateo-berri f6e1b3b
test(mcp): cover stale stored DB OAuth2 token 401 passthrough
mateo-berri fa76b92
fix(mcp): correct delegate fallback, 403 handling, and SSE OAuth2 probe
cursoragent 0d709a0
test(mcp): cover 403, delegate-auth fallback, and SSE OAuth2 probe
mateo-berri 657e7c5
Merge branch 'litellm_internal_staging' into litellm_mcp_auth_challen…
mateo-berri 3479ec8
perf(mcp): share one allowed-servers lookup across preflight auth probes
mateo-berri e9dbf6d
refactor(mcp): resolve the oauth2 preflight probe token through the v…
tin-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
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
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.
High: Proxy API key forwarded to OAuth upstream
When clients authenticate normally through
Authorization,process_mcp_requesttreats this value as their LiteLLM API key and also places it inoauth2_headers. If the resolver returns no stored upstream token, this fallback sends that proxy credential toserver.url, allowing the upstream server to capture and reuse it. Keep the proxy admission credential separate from upstream OAuth credentials, and only use a caller-provided bearer here when the request authenticated through a distinctx-litellm-api-keyheader or the server explicitly delegates authentication upstream.