Skip to content

Conversation

@SoldierSacha
Copy link

@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
Author

…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
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 action Potentially serious issue - needs proactive fix and maintainer attention

7 participants