oauthClerkProvider() options, defaults, and errors.
Configure Clerk
In the Clerk Dashboard:- Create or open your Clerk application.
- Go to Configure > OAuth Applications.
- Enable Dynamic Client Registration.
- Enable the
user:org:readscope if your tools need Clerk organization context. - Go to API Keys and copy your Frontend API URL.
Set environment variables
Configure the MCP server
Use organization claims
When you use Clerk Organizations, Clerk can includeorg_id in the token. This requires Organizations to be enabled, the user:org:read scope to be available to the OAuth app, and the client to request that scope.
org_role and org_slug on ctx.auth.user. When Clerk includes org_permissions, the SDK maps them to ctx.auth.user.permissions. Treat these fields as optional and guard before using them.
Verify the setup
Run the server and connect with an OAuth-capable MCP client.- The client discovers Clerk OAuth metadata.
- The client registers with Clerk.
- Authenticated tool calls include
ctx.auth.user.userId. - Organization-scoped tools are tested with a client that requested
user:org:read. - Organization-scoped tools reject calls without organization context.
Next steps
Runnable Clerk example
Compare your setup with a working mcp-use Clerk server.
Clerk OAuth documentation
Review Clerk’s OAuth behavior.
User Context
Use Clerk identity and organization data inside tools.
Clerk provider API reference
Look up exact provider options and defaults.