Queries Clerk data sources and performs actions on organizations, members, users, and metadata via an MCP server for AI assistants.
Configuration
View docs{
"mcpServers": {
"balajisriraman-mcp-server-clerk": {
"url": "https://clerk-mcp.vercel.app/mcp",
"headers": {
"CLERK_SECRET_KEY": "YOUR_SECRET_KEY"
}
}
}
}You can run a dedicated MCP server to query and manage your Clerk organizations, members, users, roles, and metadata from AI assistants and tooling. This server supports secure, flexible access patterns and lets you choose between hosting a single Clerk secret on the server or passing keys per request, making it suitable for personal use, internal teams, or multi-tenant deployments.
Connect your preferred MCP client to the Clerk MCP Server endpoint to start querying and managing Clerk data. You can operate in either Hosted mode, where the server stores and uses a single Clerk secret key, or Public mode, where each request carries its own key. Once connected, you can list organizations, inspect members, manage invitations, and retrieve user details through the available MCP tools. Use the health check endpoint to verify the server is reachable and report mode/connection status.
Choose the mode that matches your deployment needs. Hosted mode is simpler to configure and ideal for personal or internal deployments. Public mode supports multi-tenant setups by passing the Clerk key with every request, keeping the key off the server.
Prerequisites: you need Node.js installed on your machine. You will also need an active Clerk account to obtain an API key for development and production use.
Step-by-step setup and run flow from a clean environment.
# 1. Clone the project
git clone https://github.com/BalajiSriraman/Clerk-MCP.git
cd Clerk-MCP
# 2. Install dependencies
npm install
# 3. Prepare for Hosted mode by copying the example env file
cp .env.example .env
# Edit .env and paste your Clerk Secret Key:
# CLERK_SECRET_KEY=sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# 4. Start in Hosted mode
npm run devIf you prefer Public mode (per-request keys) you do not need to place a secret on the server. Start the server with the same command and supply keys per request via the client configurations.
Your MCP endpoint will be available at the default server URL path once the server starts.
Security and best practices: Never commit your secret keys to version control. In Hosted mode, place the Clerk secret in a server environment variable (for example, CLERK_SECRET_KEY). In Public mode, keys are supplied by clients in the X-Clerk-Secret-Key header for every request.
Health check and status: You can verify connectivity and mode by hitting the health endpoint. Hosted mode returns status ok with mode hosted and clerkConnected true, while Public mode returns status ok with mode public and clerkConnected null.
The server exposes tools to manage Clerk organizations, members, invitations, and users. You can list, get, create, update, and delete resources as described in the tool references.
List all organizations and inspect their member counts.
Create a new organization named Design Team with slug design-team and add public metadata.
Show all pending invitations for a specific organization.
Find users by email domain and update a user’s public metadata to reflect a plan change.
To run in production, build the Nuxt/Node.js app and serve it with your preferred hosting platform. You can also deploy via Docker. If you self-host, use your own deployment URL in client configurations instead of the example URL.
List organizations with optional filtering by name/slug, pagination, and member counts
Retrieve details for a specific organization including metadata and timestamps
Create a new organization with a name, slug, and metadata
Update an organization’s public/private metadata
Delete an organization permanently
List members of an organization with roles, user data, and metadata
Change a member's role within an organization (e.g. org:admin, org:member)
Update membership metadata (public/private)
Remove a member from an organization
List invitations by status (pending/accepted/revoked)
Invite a user to an organization by email
List all instance users with search by name/email/phone
Get full user profile including emails, phones, and metadata
Update user public/private/unsafe metadata