Keycloak admin for AI agents β realms, users, clients, roles; safe-by-default governance.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
A Model Context Protocol server for Keycloak. It lets an MCP-capable client (Claude Desktop, Claude Code, etc.) inspect and manage Keycloak realms, users, clients, roles, and groups β with security controlled entirely by flags.
The design goal is safe by default: it starts read-only, scopes to an allowlist of realms, protects sensitive realms from mutation, and gates destructive operations behind an explicit opt-in.
realm argument; scope it with an allowlist.read-only β read-write β admin, layered so a mode never exposes tools above its level.| Concern | Flag | Default | Effect |
|---|---|---|---|
| What can the server do at all? | KEYCLOAK_MODE | read-only | read-only exposes only read tools; read-write adds mutations; admin adds destructive tools. Tools above the mode are never registered. |
| Which realms are in scope? | KEYCLOAK_REALM_ALLOWLIST | (all) | Comma-separated. When set, any operation on a realm outside the list is refused. |
| Which realms are read-only forever? | KEYCLOAK_PROTECTED_REALMS | master | Protected realms can be read but never mutated or deleted, regardless of mode. |
| Can it delete? | KEYCLOAK_ALLOW_DELETE | false | delete_* tools require this and admin mode. |
| Preview without touching Keycloak | KEYCLOAK_DRY_RUN | false | Write/admin tools validate + log intent, then return without calling Keycloak. |
| Audit trail | KEYCLOAK_AUDIT_LOG | true | Emits a JSON line to stderr per guarded operation (ALLOW / DENY / DRY_RUN). |
These layers are independent β for example admin mode with KEYCLOAK_ALLOW_DELETE=false can create and update users but cannot delete them.
Read (read-only+): list_realms, get_realm, list_users, get_user, count_users, list_clients, list_realm_roles, list_groups
Write (read-write+): create_user, update_user, reset_password, logout_user
Admin (admin): delete_user
Published on npm as @dockndevai/mcp-keycloak. No clone or build needed β your MCP client runs it on demand with npx. Start in read-only mode; see .env.example for every variable and docs/CLIENTS.md for the full per-client guide.
Claude Code (CLI)
Claude Desktop Β· Cursor Β· Windsurf β same block in claude_desktop_config.json, .cursor/mcp.json, or ~/.codeium/windsurf/mcp_config.json:
OpenAI Codex CLI β in ~/.codex/config.toml:
VS Code (GitHub Copilot, Agent mode) β in .vscode/mcp.json:
Copy .env.example and fill it in, or set the variables directly in your MCP client config. A confidential client with the realm-management roles you need is the recommended credential.
Prefer the published package above. To run from a clone:
This server ships a server.json for the official MCP registry and an mcpName for npm ownership validation. See PUBLISHING.md for publishing to npm and listing on the MCP registry, Smithery, Glama, Cursor, and PulseMCP.
MIT
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mcp-keycloak)<a href="https://allmcps.com/mcp/mcp-keycloak"><img src="https://allmcps.com/api/badge/mcp-keycloak?style=directory" alt="MCP Keycloak on AllMCPs" /></a>