Skip to main content
Use the Clerk provider when Clerk is your identity system. MCP clients register directly with Clerk through Dynamic Client Registration, and your MCP server verifies Clerk-issued tokens. This guide covers the Clerk setup path. Use the auth providers API reference for exact oauthClerkProvider() options, defaults, and errors.

Configure Clerk

In the Clerk Dashboard:
  1. Create or open your Clerk application.
  2. Go to Configure > OAuth Applications.
  3. Enable Dynamic Client Registration.
  4. Enable the user:org:read scope if your tools need Clerk organization context.
  5. Go to API Keys and copy your Frontend API URL.
The Frontend API URL usually looks like one of these:

Set environment variables

Configure the MCP server

You can pass the Frontend API URL directly instead of using an environment variable:
If your tools need Clerk organization context, advertise the organization scope too:

Use organization claims

When you use Clerk Organizations, Clerk can include org_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.
The SDK preserves 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.
Confirm these cases:
  • 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.