Gene Library Courses Download Pricing Contact Sign in
clerk logo
developer-tools Official Website

Clerk MCP Server – Auth SDK Code Snippets

Clerk's official MCP server gives AI coding assistants access to current Clerk SDK snippets and implementation patterns. Use it when building authentication, user management, session flows, organizations, B2B SaaS features, waitlists, and route protection with Clerk.

#authentication#user-management#sdk-snippets

Overview

Clerk's official MCP server connects AI coding agents to Clerk-specific
development guidance. It is intended to help assistants produce accurate Clerk
code by retrieving current SDK snippets, implementation patterns, and
framework-specific examples directly from Clerk instead of relying only on
static model knowledge.

What the MCP server enables

Clerk MCP provides focused tools for authentication development:

  • clerk_sdk_snippet retrieves SDK code snippets and patterns for specific
    Clerk features.
  • list_clerk_sdk_snippets lists the available snippets and snippet bundles.
  • Framework-specific examples help agents work with supported Clerk SDKs such
    as Next.js, React, Expo, Express, JavaScript backends, Python, Ruby, Vue,
    Svelte, Angular, Go, Java, and other documented SDKs.
  • Snippet bundles cover common implementations such as B2B SaaS with
    organizations, waitlists, core authentication hooks, custom sign-in and
    sign-up flows, organization management, and server-side authentication
    patterns.
  • Agents can answer implementation questions about route protection,
    organizations, waitlists, authentication hooks, and other Clerk development
    workflows.

When to use it

Use Clerk MCP when an AI assistant is helping implement or review Clerk
authentication code. Practical examples include setting up useUser, protecting
routes in a Next.js app, implementing B2B SaaS organizations, adding a waitlist,
building a custom sign-in flow, applying server-side authentication patterns, or
checking the current recommended Clerk SDK approach for a supported framework.

Connection and authentication

The official Streamable HTTP endpoint is https://mcp.clerk.com/mcp. Clerk
documents direct configuration for clients such as Cursor, Claude Code,
Claude.ai, VS Code, Windsurf, Zed, Codex, and other MCP-compatible tools.
Examples include adding the endpoint directly for HTTP-capable clients or using
npx mcp-remote https://mcp.clerk.com/mcp for clients that require a local
stdio bridge.

Clerk's MCP server is a documentation and snippet server. It does not require
Clerk application secret keys in the MCP configuration and should not be given
production Clerk secrets.

Key considerations

Clerk MCP is currently documented as beta, so its API may change before general
availability. Clerk explicitly states that the server only supports Streamable
HTTP and does not support Server-Sent Events. If a client reports an internal
server error, Clerk recommends checking transport support and reconnecting.
The server helps with code snippets and patterns; it does not manage Clerk
dashboard resources, rotate secrets, or administer production applications.
Review generated authentication code for security, route coverage, framework
version compatibility, and production environment configuration before
deployment.

Supported Transports

streamable_http

URL: https://mcp.clerk.com/mcp

stdio

Command: npx

Args:

  • -y
  • mcp-remote
  • https://mcp.clerk.com/mcp

Frequently Asked Questions

When should an AI agent use the Clerk MCP server?
Use it when a coding assistant is building or reviewing Clerk authentication code, such as route protection, sign-in and sign-up flows, user hooks, server-side authentication, organizations, waitlists, and B2B SaaS patterns.
What does the Clerk MCP server add to an AI agent's capabilities?
It gives the agent access to current Clerk SDK snippets, implementation guides, framework-specific examples, and snippet bundles, reducing outdated or hallucinated authentication code in supported frameworks.
What can an AI agent access or manage through Clerk MCP?
The agent can retrieve Clerk snippets and implementation patterns through tools such as `clerk_sdk_snippet` and `list_clerk_sdk_snippets`. It does not administer Clerk dashboard resources, rotate application secrets, or manage production Clerk instances.
How is authentication configured for the Clerk MCP server?
Clerk's MCP server is used as a remote documentation and snippet endpoint at https://mcp.clerk.com/mcp. The MCP configuration does not require Clerk application secret keys, and production Clerk credentials should not be placed in MCP client configuration.
Which transport should be used for the Clerk MCP server?
Use Streamable HTTP with https://mcp.clerk.com/mcp. Clerk states that SSE is not supported. For clients that require a local command, use the documented `npx mcp-remote https://mcp.clerk.com/mcp` bridge.