Provides tools to query and manage Clerk organizations, members, users, roles, invitations, and metadata directly from AI assistants.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Clerk MCP Serverlist the 5 most recently joined users"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Clerk MCP Server
A Model Context Protocol (MCP) server for Clerk
Query and manage your Clerk organizations, members, users, roles, and metadata directly from AI assistants like Claude, Cursor, VS Code Copilot, Windsurf, and more.
Getting Your Clerk API Key
You need a Clerk Secret Key to use this server.
Go to dashboard.clerk.com and sign in (or create an account)
Select your application (or create one)
Navigate to Configure → API Keys
Copy the Secret Key — it starts with
sk_test_(development) orsk_live_(production)
Never commit your secret key to git. Use environment variables or pass it via headers.
Two Operating Modes
The server supports two modes, auto-detected at startup:
Hosted Mode (Private)
The server owns the Clerk secret key. Set CLERK_SECRET_KEY in your .env file and all requests use that single key. No headers needed from clients.
Best for: Personal use, internal teams, self-hosted deployments.
Public Mode (Per-Request Key)
No secret key on the server. Each client passes their own key via the X-Clerk-Secret-Key HTTP header on every request. The server creates a fresh Clerk client per request.
Best for: Shared deployments, multi-tenant setups, or when you don't want the key stored on the server.
Hosted Mode | Public Mode | |
Key stored on server | Yes (in | No |
Key sent per request | No | Yes (via header) |
Setup complexity | Simpler | Slightly more config |
Multi-user support | Single Clerk account | Multiple Clerk accounts |
Quick Start
1. Clone & install
2. Configure & run
Hosted mode — set the key once on the server:
Public mode — no .env needed, clients provide the key:
Your MCP endpoint is now live at http://localhost:3000/mcp.
3. Verify
Hosted mode:
{"status":"ok","mode":"hosted","clerkConnected":true}Public mode:
{"status":"ok","mode":"public","clerkConnected":null}
Connect to AI Assistants
Claude Code (CLI)
Hosted mode:
Public mode:
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Hosted mode:
Public mode:
Cursor
Go to Settings → MCP → Add Server:
Hosted mode:
Public mode:
VS Code (GitHub Copilot)
Add to your workspace .vscode/mcp.json:
Hosted mode:
Public mode:
Windsurf
Add to MCP settings:
Hosted mode:
Public mode:
Docker
Build the image
Run in hosted mode
Run in public mode
Docker Compose
Both modes are defined in docker-compose.yml:
Available Tools
Organizations
Tool | Description |
| List orgs with filtering by name/slug, pagination, and member counts |
| Get org details by ID or slug (includes metadata, timestamps) |
| Create a new organization with name, slug, and metadata |
| Update org public/private metadata |
| Delete an organization permanently (irreversible) |
Members
Tool | Description |
| List org members with roles, user data, and metadata |
| Change a member's role (e.g. |
| Update membership public/private metadata |
| Remove a member from an organization |
Invitations
Tool | Description |
| List invitations by status (pending/accepted/revoked) |
| Invite a user to an org by email |
Users
Tool | Description |
| List all instance users with search by name/email/phone |
| Get full user profile: emails, phones, external accounts, metadata |
| Update user public/private/unsafe metadata |
Example Prompts
Once connected, try asking your AI assistant:
Deploying to Production
Build and deploy as any Nuxt/Node.js app:
Or use Docker:
After deploying, replace http://localhost:3000/mcp with your production URL in all client configs.
Compatible with: Vercel, Netlify, Cloudflare Workers (with nitro preset), Railway, Fly.io, or any Node.js host.
Adding New Tools
Create a new file in server/mcp/tools/ — it's automatically discovered by the MCP toolkit:
Tech Stack
Nuxt 4 — Full-stack Vue framework
@nuxtjs/mcp-toolkit — MCP server module for Nuxt
@clerk/backend — Clerk Backend SDK
Zod — Schema validation
License
MIT