Clerk MCP Server
Provides comprehensive user management tools for Clerk, including listing users with pagination, permanently deleting users, and locking/unlocking user accounts to control login access.
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 last 5 users who signed up"
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
Servidor MCP (Model Context Protocol) para gerenciamento completo de usuários do Clerk. Este projeto permite que você integre facilmente as funcionalidades do Clerk com qualquer cliente MCP compatível, incluindo Cursor AI, Claude Desktop e VS Code.
✨ Funcionalidades
Este servidor MCP expõe 4 ferramentas essenciais para gerenciar usuários do Clerk:
🛠️ Ferramentas Disponíveis
Ferramenta | Descrição | Parâmetros |
| Lista usuários com paginação |
|
| Deleta permanentemente um usuário |
|
| Bloqueia um usuário (impede login) |
|
| Desbloqueia um usuário (permite login) |
|
⚠️ ATENÇÃO: A operação
delete-useré irreversível! Use com muito cuidado.
Related MCP server: WorkOS MCP Server
🚀 Instalação Rápida
1. Clone o Repositório
git clone https://github.com/correaito/mcp_clerk.git
cd mcp_clerk2. Instale as Dependências
npm install3. Configure as Variáveis de Ambiente
Opção A: Copie o arquivo de exemplo
cp env.example .env.localOpção B: Crie manualmente o arquivo .env.local
# Clerk API Keys
CLERK_SECRET_KEY=your_secret_key_here
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_publishable_key_here
# Server Configuration
PORT=50004. Obtenha suas Chaves do Clerk
Acesse Clerk Dashboard
Selecione seu projeto
Vá em API Keys
Copie:
Secret Key (começa com
sk_live_ousk_test_)Publishable Key (começa com
pk_live_oupk_test_)
5. Compile o Projeto
npm run build⚙️ Configuração por Cliente MCP
🎯 Cursor AI (Recomendado)
Abra as configurações do Cursor (
Ctrl/Cmd + ,)Procure por "MCP" na barra de pesquisa
Adicione a configuração:
{
"mcpServers": {
"Clerk": {
"command": "node",
"args": ["caminho/para/mcp_clerk/dist/server-stdio.js"],
"env": {
"CLERK_SECRET_KEY": "your_secret_key_here",
"NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY": "your_publishable_key_here"
}
}
}
}Exemplo com caminho completo:
{
"mcpServers": {
"Clerk": {
"command": "node",
"args": ["C:\\projetos\\mcp_clerk\\dist\\server-stdio.js"],
"env": {
"CLERK_SECRET_KEY": "your_secret_key_here",
"NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY": "your_publishable_key_here"
}
}
}
}Reinicie o Cursor
Teste: Digite
@Clerkno chat para ver as ferramentas disponíveis
🤖 Claude Desktop
Abra o arquivo de configuração:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Adicione a configuração:
{
"mcpServers": {
"Clerk": {
"command": "node",
"args": ["caminho/para/mcp_clerk/dist/server-stdio.js"],
"env": {
"CLERK_SECRET_KEY": "your_secret_key_here",
"NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY": "your_publishable_key_here"
}
}
}
}Reinicie o Claude Desktop
💻 VS Code
Instale a extensão MCP (se disponível)
Configure via settings.json:
{
"mcp.servers": {
"Clerk": {
"command": "node",
"args": ["caminho/para/mcp_clerk/dist/server-stdio.js"],
"env": {
"CLERK_SECRET_KEY": "your_secret_key_here",
"NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY": "your_publishable_key_here"
}
}
}
}🌐 Modo HTTP (Para Desenvolvimento)
Se preferir usar o servidor HTTP para testes:
1. Inicie o Servidor HTTP
npm start2. Teste com MCP Inspector
npx @modelcontextprotocol/inspectorConecte em:
http://localhost:5000/mcp
3. Teste com cURL
Health Check:
curl http://localhost:5000Listar Usuários:
curl -X POST http://localhost:5000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "list-users",
"arguments": {
"limit": 10,
"offset": 0
}
},
"id": 1
}'Bloquear Usuário:
curl -X POST http://localhost:5000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "lock-user",
"arguments": {
"userId": "user_xxxxxxxxxxxxx"
}
},
"id": 2
}'📚 Exemplos de Uso
No Cursor AI
@Clerk list-users limit=5
@Clerk lock-user userId=user_2abc123def456
@Clerk unlock-user userId=user_2abc123def456No Claude Desktop
Use a ferramenta Clerk para listar os últimos 10 usuários cadastrados
Bloqueie o usuário com ID user_2abc123def456🔧 Scripts Disponíveis
# Desenvolvimento
npm run dev # Servidor HTTP em modo dev
npm run dev:stdio # Servidor STDIO em modo dev
# Produção
npm run build # Compila o projeto
npm start # Servidor HTTP (porta 5000)
npm run start:stdio # Servidor STDIO📁 Estrutura do Projeto
mcp_clerk/
├── src/
│ ├── server.ts # Servidor HTTP (porta 5000)
│ ├── server-stdio.ts # Servidor STDIO (para Cursor/VS Code)
│ └── clerk-tools.ts # Implementação das ferramentas
├── dist/ # Arquivos compilados
├── env.example # Exemplo de configuração
├── .env.local # Suas credenciais (NÃO commitado)
├── .gitignore # Arquivos ignorados pelo Git
├── package.json # Dependências e scripts
├── tsconfig.json # Configuração TypeScript
└── README.md # Este arquivo🛡️ Segurança
✅ Nenhuma chave hardcoded no código
✅ Arquivo
.env.localprotegido pelo.gitignore✅ Variáveis de ambiente carregadas via
dotenv⚠️ Nunca compartilhe suas credenciais do Clerk
⚠️ Operação
delete-useré irreversível - use com cuidado!
🐛 Troubleshooting
Problema: "CLERK_SECRET_KEY não encontrada"
Solução: Verifique se o arquivo .env.local existe e contém a chave correta.
Problema: "Erro ao conectar com Clerk"
Solução: Verifique se suas chaves do Clerk estão corretas e ativas.
Problema: "Ferramentas não aparecem no Cursor"
Solução:
Verifique o caminho no arquivo de configuração
Reinicie o Cursor completamente
Verifique se o projeto foi compilado (
npm run build)
Problema: "Porta 5000 já está em uso"
Solução: Altere a porta no arquivo .env.local:
PORT=3001🤝 Contribuindo
Fork o projeto
Crie uma branch para sua feature (
git checkout -b feature/AmazingFeature)Commit suas mudanças (
git commit -m 'Add some AmazingFeature')Push para a branch (
git push origin feature/AmazingFeature)Abra um Pull Request
📄 Licença
Este projeto está sob a licença MIT. Veja o arquivo LICENSE para mais detalhes.
🙏 Agradecimentos
Clerk - Autenticação e gerenciamento de usuários
Model Context Protocol - Protocolo para integração com IAs
Cursor AI - Editor de código com IA integrada
Feito com ❤️ para a comunidade de desenvolvedores
Available Tools
4 toolsdelete-userDeletar UsuárioA
Deleta permanentemente um usuário do Clerk pelo ID. Esta ação é irreversível!
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| error | No | |
| message | No | |
| success | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses critical behavioral traits: the action is permanent and irreversible, which is essential for a destructive operation. However, it doesn't mention authentication requirements, rate limits, or what happens to associated data, leaving some gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the core action and followed by a critical warning. Every word earns its place, with no redundancy or unnecessary details, making it highly efficient and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (destructive operation), no annotations, and an output schema present, the description is mostly complete. It covers the irreversible nature but lacks details on permissions, error handling, or output format. The output schema reduces the need to explain return values, but more behavioral context would help.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 1 parameter with 0% description coverage, so the description must compensate. It adds meaning by specifying that the parameter is the user ID for deletion, though it doesn't detail format or constraints. Since there's only one parameter, the baseline is high, and the description provides adequate context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('deleta permanentemente') and the resource ('um usuário do Clerk'), specifying it's done by ID. It distinguishes from siblings like list-users, lock-user, and unlock-user by focusing on permanent deletion rather than listing or state changes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when permanent deletion is needed, but doesn't explicitly state when to use this tool versus alternatives like lock-user for temporary deactivation or list-users for checking users first. No explicit exclusions or prerequisites are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list-usersListar UsuáriosB
Lista todos os usuários cadastrados no Clerk com paginação
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No | ||
| orderBy | No | created_at |
Output Schema
| Name | Required | Description |
|---|---|---|
| data | No | |
| error | No | |
| success | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions pagination, which is useful, but fails to address critical aspects like authentication requirements, rate limits, error handling, or the structure of returned data. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core purpose ('Lista todos os usuários') and adds essential context ('cadastrados no Clerk com paginação'). There is no wasted verbiage, making it highly concise and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (3 parameters, pagination), no annotations, and the presence of an output schema (which handles return values), the description is minimally adequate. It covers the basic purpose but lacks details on behavioral traits, usage context, and parameter semantics, leaving room for improvement in completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds no parameter-specific information beyond implying pagination (related to limit and offset). With 0% schema description coverage and 3 parameters, the schema documents constraints (e.g., min/max, enums, defaults), but the description doesn't compensate by explaining parameter meanings or usage. Baseline 3 is appropriate as the schema handles documentation, but the description adds minimal value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Lista') and resource ('usuários cadastrados no Clerk'), specifying pagination as a key feature. It distinguishes from siblings like delete-user, lock-user, and unlock-user by focusing on retrieval rather than modification, though it doesn't explicitly name alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for retrieving all users with pagination, but provides no explicit guidance on when to use this tool versus alternatives or any prerequisites. The context suggests it's for read operations, but lacks clear exclusions or comparisons with sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lock-userBloquear UsuárioA
Bloqueia um usuário do Clerk, impedindo que ele faça login
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| error | No | |
| message | No | |
| success | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states the action (blocks user, prevents login) which implies a destructive/mutative operation, but doesn't disclose important behavioral traits like whether this is reversible, what permissions are required, if it affects existing sessions, or what the response looks like. For a mutation tool with zero annotation coverage, this is insufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that communicates the core functionality without any wasted words. It's appropriately sized for a simple tool and front-loads the essential information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given this is a mutation tool with no annotations but with an output schema (which handles return values), the description provides the basic purpose but lacks important context about behavioral implications, permissions, and reversibility. It's minimally adequate but has clear gaps for a tool that modifies user access.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage and only 1 parameter, the description doesn't explicitly mention the 'userId' parameter. However, the context ('um usuário do Clerk') implies what needs to be identified. For a single-parameter tool, this provides adequate semantic context despite not naming the parameter directly.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Bloqueia' - blocks) and resource ('um usuário do Clerk'), and distinguishes it from sibling tools like 'unlock-user' by specifying it prevents login. It goes beyond just restating the name/title by explaining the functional outcome.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context (when you need to prevent a user from logging in), but doesn't explicitly state when to use this vs alternatives like 'delete-user' or 'unlock-user'. It provides clear functional intent but lacks explicit comparative guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
unlock-userDesbloquear UsuárioB
Desbloqueia um usuário do Clerk, permitindo que ele faça login novamente
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| error | No | |
| message | No | |
| success | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It states the action is to unlock a user, implying a mutation, but doesn't disclose behavioral traits like required permissions, whether it's reversible, side effects, or rate limits. The description is minimal and lacks crucial operational context for a mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that states the action and outcome without unnecessary words. It's front-loaded with the core purpose and appropriately sized for the tool's complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has an output schema (which handles return values) and minimal parameters, the description covers the basic purpose. However, as a mutation tool with no annotations, it lacks details on permissions, error cases, or behavioral nuances, making it incomplete for safe operation despite the output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage and only 1 parameter, the description doesn't add specific parameter details, but the tool's purpose inherently clarifies that 'userId' identifies the user to unlock. Since there's only one required parameter and the action is straightforward, the description provides adequate semantic context without needing explicit parameter explanation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Desbloqueia' - unlocks) and the resource ('um usuário do Clerk'), specifying that it allows the user to log in again. It distinguishes from 'lock-user' by being the opposite operation, though it doesn't explicitly differentiate from other siblings like 'delete-user' or 'list-users'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when a user needs to be unlocked to regain login access, but doesn't provide explicit guidance on when to use this versus alternatives like 'delete-user' or prerequisites. It mentions the outcome ('permite que ele faça login novamente') which gives some context, but lacks clear when/when-not instructions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose: delete-user removes users permanently, list-users retrieves user data, lock-user blocks login access, and unlock-user restores it. There is no overlap in functionality, making tool selection straightforward for an agent.
All tool names follow a consistent verb_noun pattern (delete-user, list-users, lock-user, unlock-user), using hyphen separation and clear action verbs. This uniformity enhances readability and predictability.
With 4 tools, the count is reasonable for user management, but it feels slightly thin as it lacks create-user and get-user operations. This may limit full CRUD coverage, though the existing tools are well-scoped.
The tool set covers deletion, listing, locking, and unlocking users, which handles lifecycle management well. However, there are notable gaps: no create-user or get-user tools, which are essential for a complete user management surface, potentially causing agent workarounds.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Authenticated, user-scoped MCP connectors for 30+ business systems.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Connect MCP clients to 2,000+ AI models without managing provider API keys.
Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables secure MCP server functionality with Clerk authentication and user-specific API key management. Provides Next.js documentation tools through protected endpoints with multiple authentication methods including OAuth 2.1 with PKCE.1
- AlicenseNot gradedqualityDmaintenanceMCP server for WorkOS User Management API. Enables Claude to manage users, organizations, memberships, invitations, and sessions in WorkOS.15MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server for managing Okta users (CRUD operations) with full OAuth 2.1 compliance, enabling secure integration with Claude Desktop and other MCP clients.
- AlicenseNot gradedqualityAmaintenanceMCP server for managing Ory Kratos identities, sessions, and authentication flows, enabling AI assistants to perform identity management tasks via natural language.101MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/correaito/mcp_clerk'
If you have feedback or need assistance with the MCP directory API, please join our Discord server