published fresh until

How do I set up Clerk auth with Claude Code and the Clerk MCP?

Summary As of October 2026, Clerk documents a hosted MCP server at mcp.clerk.com/mcp that gives a coding agent Clerk SDK snippets and account tools, added to Claude Code with one claude mcp add command and an in-session OAuth sign-in.

Not for Better Auth or Auth.js login (see better-auth-or-clerk-or-authjs-for-nextjs-auth-cost-lock-in-own-postgres)

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

You ask an agent to add Clerk sign-in to your app. Without current docs it tends to write sign-in code from memory, which can be out of date for your SDK version.

What Clerk's docs say

Clerk documents a hosted MCP server (https://clerk.com/docs/mcp/overview), as read in October 2026:

  • URL is https://mcp.clerk.com/mcp, Streamable HTTP only (no Server-Sent Events).
  • Add it to Claude Code with claude mcp add clerk --transport http https://mcp.clerk.com/mcp, then run /mcp, pick clerk and choose Authenticate.
  • It offers account tools (create and configure applications, manage users, set up production instances) and SDK snippet tools (clerk_sdk_snippet, list_clerk_sdk_snippets) with ready code patterns.

Things to know before you connect it

  • Signing in acts as you: the server can do only what your workspace role allows, so use a role you are comfortable letting an agent borrow.
  • Creating a production instance cannot be undone and requires confirm: true.
  • Secret keys are redacted in configuration responses; creating an application or production instance can return a new key encrypted to an agent-supplied public key. For existing instances, add a new key from the dashboard API keys page or run clerk env pull.
  • Each tool call sends Clerk the tool name, success status, error type on failure, your Clerk user ID and client details, plus the application ID and dry-run status when applicable, but no other tool inputs or results; submit_feedback includes your user and workspace IDs.
  • An internal server error usually means a network or transport problem: reconnect and check your client supports Streamable HTTP.

A prompt that keeps the agent on the docs

Use the clerk MCP snippet tools for the current pattern before writing any Clerk code. Do not create a production instance. Never print secret keys.

Limits

The page does not label the server as beta, and I did not run any of these commands. The source is Clerk's own documentation, with no measurement of how much the MCP reduces mistakes.

Sources

  • Clerk docs, MCP overview: https://clerk.com/docs/mcp/overview (read in full)

Started from a post by @Clerk docs, packaged by the editor. Original post

Subjects

More in claude code

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# How do I set up Clerk auth with Claude Code and the Clerk MCP?
Summary: As of October 2026, Clerk documents a hosted MCP server at mcp.clerk.com/mcp that gives a coding agent Clerk SDK snippets and account tools, added to Claude Code with one claude mcp add command and an in-session OAuth sign-in.
Copy for agent
get the whatworks thread clerk-mcp-server-claude-code-next-js-auth-setup and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread clerk-mcp-server-claude-code-next-js-auth-setup
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks