ai icon indicating copy to clipboard operation
ai copied to clipboard

[Demo] Create `mcp-clerk-oauth`

Open gching opened this issue 7 months ago • 4 comments

  • Adds demo for a remote MCP server integrates with Clerk to be used as an OAuth provider.
  • Notable differences include changing request parameters to include scopes and token fetching with grant_type

gching avatar Mar 27 '25 13:03 gching

Thinking about this more, I believe there might be a diff approach ref: https://x.com/gching/status/1905466984999125220

In the case when we are using a third party auth service (Clerk, Auth0), we potentially shouldn't be following https://developers.cloudflare.com/agents/model-context-protocol/authorization/#3-bring-your-own-oauth-provider since this means that the MCP server acts as the oauth client where as the MCP client should be oauth client

I think in the most simplest case, this approach does work for third party auth services to utilize them as auth though for the MCP server itself, so not saying this approach is wrong

the other apporach we could think about is how we utilize OAuthProvider to delegate everything to a upstream third party auth service - and still (or not) generate access tokens on the MCP server 🤔

gching avatar Mar 28 '25 04:03 gching

wanna revisit this, now that so much has changed?

threepointone avatar May 09 '25 11:05 threepointone

Yep! Most definitely, I think Clerk is also pushing forward with their OAuth / OIDC provider implementation, when that's out I think we can have a create a better example

gching avatar May 09 '25 21:05 gching

dope, no rush.

threepointone avatar May 10 '25 07:05 threepointone