-
Notifications
You must be signed in to change notification settings - Fork 583
Add Proxy OAuth Server Provider #159
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
Add Proxy OAuth Server Provider #159
Conversation
da8bb7e
to
8d7b387
Compare
@allenzhou101 was testing this with Entra ID. Thank you for putting this together! It mostly works with vanilla endpoints, but I feel like there are some gaps. Let me know what the best way you want to collaborate on this (happy to contribute to the PR).
For Entra ID specifically, this would kind of work with the public client flow, but is a bit more problematic because the server is responsible for getting the token rather than the client, which means that things like integration with authentication brokers (e.g., WAM) is not possible. This probably is more of a client conversation anyway, but thought I'd call it out here as well. |
@localden Thanks for your review! I’d definitely appreciate any contributions.
Would love to collaborate if you’re interested in contributing a PR here. |
Love this! Basically what I need! |
@allenzhou101 @localden What's the status on this one? Has the work been moved elsewhere? Just looking to clean up / move along old PRs. |
@cliffhall the work hasn't been moved elsewhere to my knowledge, just needing to be officially reviewed. |
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.
Looks good. Updated branch and tests still pass locally. I think it would be good if we had some documentation on use of this class, perhaps in the Advanced Usage section?
Sure! Added a code sample of the intended usage to the readme. |
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.
LGTM! 👍
@localden this is ready to merge now, could you give it a look? |
Introduces a new
ProxyOAuthServerProvider
class that enables proxying OAuth operations to an upstream OAuth server, allowing delegation of OAuth flows while maintaining our interface contract.Motivation and Context
In many deployment scenarios, we need to integrate with existing OAuth infrastructure (like corporate identity providers or third-party auth services) rather than implementing OAuth flows directly. This proxy implementation provides a clean abstraction layer that allows applications to delegate OAuth operations to an upstream server while maintaining a consistent interface to plug into other parts of the MCP sdk (eg. routing).
How Has This Been Tested?
Using Descope as the external/upstream OAuth IdP and MCP Inspector as the client, the below cases were tested:
token
endpoint and explicitly definingauthorize
)Breaking Changes
None
Types of changes
Checklist
Additional context
Considerations
Usage