-
Notifications
You must be signed in to change notification settings - Fork 179
Allow Agent instance to supply custom OAuth provider. #298
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
base: main
Are you sure you want to change the base?
Allow Agent instance to supply custom OAuth provider. #298
Conversation
🦋 Changeset detectedLatest commit: 58de61d The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Kindly bumping to request review or feedback on this PR. |
For context here, I'm working on making the underlying Instantiating such an implementation from within an |
I’ll have a look tomorrow, cheers
Sunil Pai
…On Thu, 29 May 2025 at 22:28, Jared Hanson ***@***.***> wrote:
*jaredhanson* left a comment (cloudflare/agents#298)
<#298 (comment)>
For context here, I'm working on making the underlying OAuthClientProvider
interface from @modelcontextprotocol/sdk more extensible, allowing it to
implement more secure forms of authentication that don't rely on shared
secrets. A PR is in progress here: modelcontextprotocol/typescript-sdk#531
<modelcontextprotocol/typescript-sdk#531>
Instantiating such an implementation from within an Agent is driving the
requirement for this PR.
—
Reply to this email directly, view it on GitHub
<#298 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAES6E4M52BZPGA22JU55D3A44CFAVCNFSM6AAAAAB5UIAEQSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMRQGAYDSMRXGI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
…uth-client-provider
I am implementing agents that use alternative ways to register and authenticate with OAuth authorization servers. These mechanisms are based on early draft OAuth specifications, and will hopefully see more widespread adoption as MCP's use of OAuth matures beyond dynamic client registration (which has many downsides).
To facilitate this, supplying a different
AgentsOAuthProvider
is necessary. This pull request proposes acreateOAuthProvider
function on theAgent
class, which by default returns the currentDurableObjectOAuthClientProvider
instance. This function can be overridden byAgent
subclasses that need to use an alternative implementation.An example of a agent that has a custom OAuth provider is as follows:
Let me know if I can supply any additional details. Any and all feedback is welcome! Thanks!