
Keycloak Admin
io.github.mrz1880Published by GitHub account mrz1880v0.2.3Updated Oct 24, 2026
Administer Keycloak via its Admin REST API: users, roles, clients, groups, IdP, events.
Overview
Local MCP server that lets an assistant administer a Keycloak 26.x realm through its Admin REST API: users, roles, clients, groups, IdPs and events.
- What you can do
- Search, read, create, update, enable/disable and delete realm users, list their sessions, send action emails, reset passwords and revoke sessions
- List, assign and revoke realm roles and client roles for users and groups
- List, create, update and delete clients, read or regenerate client secrets, and manage default scopes and protocol mappers
- List, create and delete groups, add or remove members, and grant roles to groups
- List, create and delete identity providers and their mappers, list user federation providers and trigger syncs
- Read authentication flows, required actions, authorization resources, policies and permissions, login and admin events, realm config and server version
- When to use it
- Useful when an assistant or IDE agent needs to do routine Keycloak administration — looking up users, managing roles, clients and groups, or reading events — without handing over the raw admin console. Best for teams that want guardrails such as read-only mode and realm allow-lists around those operations.
- Requirements
- Node.js 20 or newer and a reachable Keycloak 26.x server. Required environment variables: KEYCLOAK_BASE_URL, KEYCLOAK_REALM and AUTH_MODE. In service_account mode, KC_CLIENT_ID and KC_CLIENT_SECRET; in password mode, KC_ADMIN_USERNAME and KC_ADMIN_PASSWORD, with optional KC_ADMIN_REALM. Optional READ_ONLY and ALLOWED_REALMS. Runs locally over stdio, typically via npx.
Installation
In SourceWeft
- Open Keycloak Admin in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
mcp-keycloak-admin
[npm version] [CI] [CodeQL] [License: MIT]
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).
Install
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.
Why
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.
Features
- Two authentication modes, selectable by configuration:
service_account— a confidential client with a service account (recommended; no admin password stored).password— theadmin-cliclient with an admin username/password.
- Safe by default:
READ_ONLYmode hides every write/destructive tool.ALLOWED_REALMSrestricts which realms the server may operate on.- Destructive operations require explicit confirmation (native MCP
elicitation, with a
confirm: trueparameter fallback for clients that do not support elicitation).
- Clean Architecture: a framework-free domain, application use cases, and infrastructure adapters. No business concept travels as a raw string or number — every one is a validated value object.
Requirements
- Node.js >= 20
- A reachable Keycloak 26.x server
Usage with an MCP client
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.
Multiple Keycloak instances
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.
Configuration
A full example lives in .env.example.
Tools
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.
See docs/users.md, docs/roles.md, docs/clients.md, docs/groups.md and docs/events-realm.md for parameters and examples, and docs/security.md for the safety model.
Roadmap
The architecture is designed to keep growing as thin use cases + tools. Remaining candidates: authorization policy/permission CRUD and evaluation, authentication flow mutation (copy/add executions), and advanced federation and identity-provider configuration. See docs/development.md for how to add one.
Development
Releases are automated — see docs/releasing.md.
Contributing
Contributions are welcome — please read CONTRIBUTING.md.
License
Source: README.md at commit 8f97751
Tools
0Version history
1- v0.2.3LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts