pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: https://github.com/modelcontextprotocol/python-sdk/pull/882

17c7a1abb27f2d0.css" /> OAuth Update: Adding the Client Credentials & Token Exchange Grant Types by SoldierSacha · Pull Request #882 · modelcontextprotocol/python-sdk · GitHub
Skip to content

OAuth Update: Adding the Client Credentials & Token Exchange Grant Types#882

Closed
SoldierSacha wants to merge 225 commits into
modelcontextprotocol:mainfrom
sacha-development-stuff:main
Closed

OAuth Update: Adding the Client Credentials & Token Exchange Grant Types#882
SoldierSacha wants to merge 225 commits into
modelcontextprotocol:mainfrom
sacha-development-stuff:main

Conversation

@SoldierSacha
Copy link
Copy Markdown

@SoldierSacha SoldierSacha commented Jun 4, 2025

Motivation and Context

#881

In addition to implementing the Client Credentials grant (as referenced in the issue linked above), I have also integrated support for the Token Exchange grant.

Reasoning for Token Exchange: While the Client Credentials grant is suitable for machine-to-machine authorization, I realized that there are times where the client machine (acting as an MCP Client) might have to make requests on behalf of an end-user to the MCP Server. With that being said, in the current implementation, this did not exist because there was no way to securely identify the end-user.

Now it does through Token Exchange.

How Has This Been Tested?

Added test cases (all pass), and also currently using in my own mcp server and client. Everything is working as intended.

Breaking Changes

None

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

No

@SoldierSacha
Copy link
Copy Markdown
Author

@SoldierSacha
Copy link
Copy Markdown
Author

@Kludex @pcarleton

…ix-coverage-threshold-failure-1ymhhc

Revert "Add branch coverage tests for OAuth metadata and refresh handling"
…e-threshold-failure-ooo725

Add token exchange metadata fallbacks and refresh match coverage
…verage-failure-ymrkqj

Add unit tests for streamable HTTP SSE handling
…-inconsistent-test-coverage-on-windows

Add coverage pragmas for Windows resumption paths
…onflicts-in-oauth2.py-and-test_auth.py

Fix OAuth2 merge conflicts in auth flow
…or-in-legacy-server-tests

Fix OAuth discovery fallbacks for legacy servers
…tible-method-override-errors

Align OAuth metadata handler return types
…se-failure-in-oauth-flow

Fix OAuth metadata handler stub in auth flow test
@felixweinberger
Copy link
Copy Markdown
Contributor

Closing in favor of #1663

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auth Issues and PRs related to Authentication / OAuth needs maintainer Potentially serious issue - needs proactive fix and maintainer attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy