MCP server for administering Keycloak users, roles, clients, sessions, and scopes through the Admin REST API.
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.
Inspect callable tools, capabilities, and parameters exposed to AI agents by MCP Keycloak Admin.
keycloak_user_searchSearch realm users by email, username or free text.
keycloak_user_getFetch a single user by id.
keycloak_user_sessions_listList a user's active sessions.
keycloak_user_createCreate a realm user.
keycloak_user_updateUpdate a user's email, name or enabled flag.
keycloak_user_set_enabledEnable or disable a user.
A Model Context Protocol (MCP) server to administer a Keycloak instance through its Admin REST API. Safe by default, configurable, and built with a clean, test-driven architecture.
Compatible with Keycloak 26.x (validated against 26.0.5).
No install needed โ run it straight from npm with npx:
The server speaks MCP over stdio, so you normally wire it into an MCP client rather than running it by hand โ see Usage with an MCP client. New to it? The Quickstart spins up a local Keycloak and a client config in a couple of minutes.
Administering Keycloak from an MCP client (an assistant, an IDE, a custom agent) means exposing day-to-day operations โ searching users, managing roles, reading events โ as MCP tools, without handing over a raw admin console. This server does that with strong guardrails so destructive actions never happen silently.
service_account โ a confidential client with a service account
(recommended; no admin password stored).password โ the admin-cli client with an admin username/password.READ_ONLY mode hides every write/destructive tool.ALLOWED_REALMS restricts which realms the server may operate on.confirm: true parameter fallback for clients that do
not support elicitation).Add the server to your MCP client configuration:
See docs/setup-keycloak.md to create the mcp-admin
client and grant it the least-privilege roles it needs.
Each server entry targets one Keycloak (one base URL + realm + auth). To manage several environments, add one entry per instance โ each fully isolated, with its own credentials and guardrails:
The client namespaces the tools per server (e.g. kc-prod:keycloak_user_delete),
so there's no risk of running an operation against the wrong environment. This
is the recommended pattern: you can, for example, keep production READ_ONLY
while preprod stays writable.
| Variable | Required | Description |
|---|---|---|
KEYCLOAK_BASE_URL | yes | Base URL of the Keycloak server (no trailing slash). |
KEYCLOAK_REALM | yes | Realm the server operates on. |
AUTH_MODE | yes | service_account or password. |
KC_CLIENT_ID | if service_account | Confidential client id (e.g. mcp-admin). |
KC_CLIENT_SECRET | if service_account | Client secret. |
KC_ADMIN_USERNAME | if password | Admin username. |
KC_ADMIN_PASSWORD | if password | Admin password. |
KC_ADMIN_REALM | no (default master) | Realm holding the admin user (password mode). |
READ_ONLY | no (default false) | When true, write/destructive tools are not registered. |
ALLOWED_REALMS | no | Comma-separated allow-list of realms. Empty = all. |
A full example lives in .env.example.
Levels: [R] read-only ยท [W] write ยท [D] destructive (requires
confirmation). Every tool carries the matching MCP annotations
(readOnlyHint / destructiveHint / idempotentHint).
Currently implemented:
Note: this table tracks the
mainbranch, which can run ahead of the latest npm release shown by the version badge above. To confirm what's available in your install, checknpm view mcp-keycloak-admin versionand pinmcp-keycloak-admin@latest.
Factual signals from GitHub, npm, and our automated checks โ not a rating.
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/mrz1880-mcp-keycloak-admin)<a href="https://allmcps.com/mcp/mrz1880-mcp-keycloak-admin"><img src="https://allmcps.com/api/badge/mrz1880-mcp-keycloak-admin?style=directory" alt="MCP Keycloak Admin on AllMCPs" /></a>