Skip to main content
Glama
correaito
by correaito

🔐 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

list-users

Lista usuários com paginação

limit (1-100), offset, orderBy

delete-user

Deleta permanentemente um usuário

userId (obrigatório)

lock-user

Bloqueia um usuário (impede login)

userId (obrigatório)

unlock-user

Desbloqueia um usuário (permite login)

userId (obrigatório)

⚠️ 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_clerk

2. Instale as Dependências

npm install

3. Configure as Variáveis de Ambiente

Opção A: Copie o arquivo de exemplo

cp env.example .env.local

Opçã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=5000

4. Obtenha suas Chaves do Clerk

  1. Acesse Clerk Dashboard

  2. Selecione seu projeto

  3. Vá em API Keys

  4. Copie:

    • Secret Key (começa com sk_live_ ou sk_test_)

    • Publishable Key (começa com pk_live_ ou pk_test_)

5. Compile o Projeto

npm run build

⚙️ Configuração por Cliente MCP

🎯 Cursor AI (Recomendado)

  1. Abra as configurações do Cursor (Ctrl/Cmd + ,)

  2. Procure por "MCP" na barra de pesquisa

  3. 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"
      }
    }
  }
}
  1. Reinicie o Cursor

  2. Teste: Digite @Clerk no chat para ver as ferramentas disponíveis

🤖 Claude Desktop

  1. Abra o arquivo de configuração:

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  2. 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"
      }
    }
  }
}
  1. Reinicie o Claude Desktop

💻 VS Code

  1. Instale a extensão MCP (se disponível)

  2. 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 start

2. Teste com MCP Inspector

npx @modelcontextprotocol/inspector
  • Conecte em: http://localhost:5000/mcp

3. Teste com cURL

Health Check:

curl http://localhost:5000

Listar 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_2abc123def456

No 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.local protegido 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:

  1. Verifique o caminho no arquivo de configuração

  2. Reinicie o Cursor completamente

  3. 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

  1. Fork o projeto

  2. Crie uma branch para sua feature (git checkout -b feature/AmazingFeature)

  3. Commit suas mudanças (git commit -m 'Add some AmazingFeature')

  4. Push para a branch (git push origin feature/AmazingFeature)

  5. Abra um Pull Request

📄 Licença

Este projeto está sob a licença MIT. Veja o arquivo LICENSE para mais detalhes.

🙏 Agradecimentos


Feito com ❤️ para a comunidade de desenvolvedores

Available Tools

4 tools
delete-userDeletar UsuárioA

Deleta permanentemente um usuário do Clerk pelo ID. Esta ação é irreversível!

ParametersJSON Schema
NameRequiredDescriptionDefault
userIdYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNo
messageNo
successYes

TDQS

A4.2/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
orderByNocreated_at

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataNo
errorNo
successYes

TDQS

B3.3/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
userIdYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNo
messageNo
successYes

TDQS

A3.9/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
userIdYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNo
messageNo
successYes

TDQS

B3.4/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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

A3.6/5.0
Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count3/5

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.

Completeness3/5

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

ActivityInactive
ResponsivenessSyncing

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

Related MCP Servers

  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables 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
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server for WorkOS User Management API. Enables Claude to manage users, organizations, memberships, invitations, and sessions in WorkOS.
    15
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    An MCP server for managing Okta users (CRUD operations) with full OAuth 2.1 compliance, enabling secure integration with Claude Desktop and other MCP clients.
  • A
    license
    Not graded
    quality
    A
    maintenance
    MCP server for managing Ory Kratos identities, sessions, and authentication flows, enabling AI assistants to perform identity management tasks via natural language.
    10
    1
    MIT

Latest Blog Posts

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