mcp-keycloak
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| KEYCLOAK_URL | Yes | Base URL of your Keycloak server (e.g., https://keycloak.example.com). Required for authentication to Keycloak. | |
| KEYCLOAK_MODE | No | Access mode for the server: read-only (default), read-write, or admin. Higher modes expose additional tools. | read-only |
| KEYCLOAK_DRY_RUN | No | When true, write/admin tools validate and log intent without calling Keycloak. | false |
| KEYCLOAK_AUDIT_LOG | No | Emits a JSON line to stderr per guarded operation (ALLOW / DENY / DRY_RUN). | true |
| KEYCLOAK_CLIENT_ID | No | Client ID for the confidential-client service account authentication strategy. | |
| KEYCLOAK_ALLOW_DELETE | No | Set to true to enable delete_* tools (requires admin mode). | false |
| KEYCLOAK_CLIENT_SECRET | No | Client secret for the confidential-client service account authentication strategy. | |
| KEYCLOAK_ADMIN_PASSWORD | No | Password for the admin username/password authentication strategy. | |
| KEYCLOAK_ADMIN_USERNAME | No | Username for the admin username/password authentication strategy. | |
| KEYCLOAK_REALM_ALLOWLIST | No | Comma-separated allowlist of realms that can be accessed. If not set, all realms are allowed. | |
| KEYCLOAK_PROTECTED_REALMS | No | Comma-separated list of realms that are read-only forever and cannot be mutated or deleted, regardless of mode. | master |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_realmsA | List all realms visible to the configured credentials. Realms outside the allowlist are filtered out. |
| get_realmA | Fetch the configuration of a single realm. Secrets (SMTP password, codeSecret, identity-provider and LDAP credentials, secret-shaped attributes) are replaced with [REDACTED]. |
| list_usersA | List users in a realm. Supports free-text search and pagination. Secret-shaped attribute values and credentials are replaced with [REDACTED]. |
| get_userA | Fetch a single user representation by their Keycloak id. Secret-shaped attribute values and credentials are replaced with [REDACTED]. |
| count_usersA | Return the number of users in a realm, optionally matching a search term. |
| list_clientsA | List OAuth/OIDC clients configured in a realm. Client secrets, registration access tokens, rotated secrets, private keys and other secret-shaped fields are replaced with [REDACTED]. |
| list_realm_rolesA | List the realm-level roles defined in a realm. Secret-shaped attribute values are replaced with [REDACTED]. |
| list_groupsB | List groups in a realm. Secret-shaped attribute values are replaced with [REDACTED]. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 8 tools
Each tool maps to a distinct resource+action pair: list_realms/get_realm differ by scope, list_users/get_user/count_users differ by granularity and verb, and groups, clients, and realm roles are clearly separate resources. The only near-neighbors (list_groups vs list_realm_roles) are well differentiated by Keycloak's domain semantics and the descriptions reinforce it.
All eight tools follow a strict snake_case verb_noun convention (get_realm, list_users, count_users, list_clients, list_realm_roles). No camelCase or verb-style mixing anywhere in the set.
Eight tools is well within the ideal 3-15 range and each one corresponds to a meaningful inspection target (realms, groups, users, clients, roles). Nothing looks redundant or bolted on.
The surface is purely read-only: there is no way to create, update, or delete users, groups, clients, or roles, nor to assign/remove role mappings, which are core Keycloak admin operations. There are also smaller gaps such as no get_group, get_client, or group-membership listing, so agents needing any mutation will hit a dead end.