keycloak-mcp-server
Provides comprehensive management tools for Keycloak, enabling administrators to manage users, realms, clients, roles, groups, organizations, identity providers, protocol mappers, user attributes, client scopes, sessions, and events.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@keycloak-mcp-server Create a new user named alice in the dev realm"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Keycloak Model Context Protocol Server
A comprehensive Model Context Protocol (MCP) server for Keycloak administration, providing 80+ tools to manage users, realms, clients, roles, groups, sessions, events, organizations, protocol mappers, user attributes, client scopes, and identity providers directly from AI assistants like Claude Desktop or Cursor AI.
๐ Features
๐ค User Management
โ Create, update, and delete users
โ List, search, and get user details
โ Reset user passwords
โ Logout user sessions
โ Manage user roles and groups
โ NEW: User attributes management (critical for organization data)
๐๏ธ Realm Management
โ List, create, update, and delete realms
โ Get detailed realm settings and configurations
โ Manage realm-level security policies
๐ง Client Management
โ Register, update, and delete clients/applications
โ List all clients in realms
โ Configure client settings and redirect URIs
โ NEW: Protocol mappers management (critical for JWT claims)
๐ญ Role Management
โ Create, update, and delete roles (realm and client-level)
โ Assign and remove roles from users and groups
โ List all roles and user role assignments
โ NEW: Composite roles and role hierarchies
โ NEW: Advanced role operations by ID
โ NEW: Find users with specific roles
๐ฅ Group Management
โ Create, update, and delete user groups
โ Add and remove users from groups
โ Manage hierarchical group structures
โ NEW: Group attributes management
โ NEW: Child groups and subgroup management
โ NEW: Group member listing and management
๐ข Organization Management โญ NEW
โ Create, update, and delete organizations
โ Add and remove organization members
โ List organizations and members
โ Organization attributes management
๐ Identity Provider Management โญ NEW
โ Create, update, and delete identity providers (SSO)
โ Identity provider mapper management
โ SAML and OIDC provider configuration
โ External user attribute mapping
๐ฏ Client Scopes Management โญ NEW
โ Create, update, and delete client scopes
โ Protocol mappers for client scopes
โ Token scope management
๐ Session & Event Management
โ List active user sessions
โ Monitor authentication and admin events
โ Clear event logs and manage session lifecycles
๐ก๏ธ Advanced Features
โ Bulletproof authentication with fresh client instances
โ Comprehensive error handling with detailed logging
โ Cross-platform support (Windows, macOS, Linux)
โ Production-ready with TypeScript and robust architecture
โ Organization JWT Claims - Solve organization visibility in tokens
โ 80+ Tools - Complete Keycloak administration coverage
Related MCP server: keycloak-source-mcp
๐ Prerequisites
Node.js 18 or higher
Running Keycloak instance (local or remote)
Keycloak admin credentials with appropriate permissions
AI Assistant that supports MCP (Claude Desktop, Cursor AI, etc.)
๐ฆ Installation
Global Installation (Recommended)
npm install -g keycloak-mcp-serverUsing NPX (No Installation Required)
npx keycloak-mcp-serverLocal Project Installation
npm install keycloak-mcp-serverLocal Development
git clone https://github.com/M0-AR/keycloak-mcp-server.git
cd keycloak-mcp-server
npm install
npm run buildโ๏ธ Configuration
For Cursor AI
Add to your Cursor MCP configuration file (~/.cursor/mcp.json):
Option 1: Using NPX (Recommended)
{
"mcpServers": {
"keycloak": {
"command": "npx",
"args": ["keycloak-mcp-server"],
"env": {
"KEYCLOAK_URL": "https://your-keycloak-instance.com",
"KEYCLOAK_ADMIN": "your-admin-username",
"KEYCLOAK_ADMIN_PASSWORD": "your-admin-password"
}
}
}
}Option 2: If Installed Globally
{
"mcpServers": {
"keycloak": {
"command": "keycloak-mcp-server",
"env": {
"KEYCLOAK_URL": "https://your-keycloak-instance.com",
"KEYCLOAK_ADMIN": "your-admin-username",
"KEYCLOAK_ADMIN_PASSWORD": "your-admin-password"
}
}
}
}For Claude Desktop
Add to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"keycloak": {
"command": "npx",
"args": ["keycloak-mcp-server"],
"env": {
"KEYCLOAK_URL": "https://your-keycloak-instance.com",
"KEYCLOAK_ADMIN": "your-admin-username",
"KEYCLOAK_ADMIN_PASSWORD": "your-admin-password"
}
}
}
}๐ Environment Variables
Variable | Description | Default | Required |
| The base URL of your Keycloak instance |
| โ |
| Admin username |
| โ |
| Admin password |
| โ |
๏ฟฝ๏ฟฝ๏ธ Available Tools (80+ Tools)
๐ค User Management Tools
create-user
Creates a new user in a specified realm.
Create a user in "master" realm: username "john.doe", email "john@example.com", first name "John", last name "Doe"update-user
Updates user information (email, names, enabled status).
Update user "user-id-123" in "master" realm to change email to "newemail@example.com"delete-user
Deletes a user from a realm.
Delete user with ID "user-id-123" from "master" realmlist-users
Lists all users in a realm.
List all users in the "master" realmsearch-users
Search users with filters (username, email, firstName, lastName).
Search for users with email containing "wateen.io" in "master" realm, limit 10 resultsget-user
Get detailed information about a specific user.
Get details for user ID "user-id-123" in "master" realmreset-user-password
Reset a user's password.
Reset password for user "user-id-123" in "master" realm to "newPassword123", make it temporarylogout-user
Logout all sessions for a specific user.
Logout all sessions for user "user-id-123" in "master" realmset-user-attributes โญ NEW
Set user attributes (critical for organization data storage).
Set organization attribute for user "user-id-123" in "master" realm: {"organization": ["wateen-corp"]}get-user-attributes โญ NEW
Get user attributes including unmanaged attributes.
Get all attributes for user "user-id-123" in "master" realm๐๏ธ Realm Management Tools
list-realms
Lists all available realms.
Show me all available realms in Keycloakcreate-realm
Creates a new realm with configurable settings.
Create a new realm called "company" with display name "Company Realm", enabledupdate-realm
Updates realm settings and configurations.
Update realm "company" to change display name to "Updated Company"delete-realm
Deletes an existing realm.
Delete the realm "test-realm"get-realm-settings
Retrieves detailed settings of a realm.
Get detailed settings for the "master" realm๐ง Client Management Tools
create-client
Registers a new client/application in a realm.
Create client "my-app" in "master" realm with redirect URIs ["http://localhost:3000/*"]update-client
Updates client settings (redirect URIs, protocol mappers, etc.).
Update client "my-app" in "master" realm to add new redirect URI "https://app.example.com/*"delete-client
Removes a client from a realm.
Delete client "old-app" from "master" realmlist-clients
Lists all clients in a realm.
List all clients in the "master" realmcreate-protocol-mapper โญ NEW
Create protocol mappers for clients (critical for JWT organization claims).
Create organization group mapper for client "my-app" in "master" realm to include "organization" claim in JWTupdate-protocol-mapper โญ NEW
Update existing protocol mappers.
Update protocol mapper "mapper-id-123" for client "my-app" in "master" realmdelete-protocol-mapper โญ NEW
Delete protocol mappers from clients.
Delete protocol mapper "mapper-id-123" from client "my-app" in "master" realmlist-protocol-mappers โญ NEW
List all protocol mappers for a client.
List all protocol mappers for client "my-app" in "master" realm๐ฏ Client Scopes Management Tools โญ NEW
create-client-scope
Create a new client scope for managing token scopes.
Create client scope "organization-scope" in "master" realm for organization claimsupdate-client-scope
Update existing client scope.
Update client scope "scope-id-123" in "master" realm to change descriptiondelete-client-scope
Delete a client scope.
Delete client scope "scope-id-123" from "master" realmlist-client-scopes
List all client scopes in a realm.
List all client scopes in the "master" realmget-client-scope
Get details of a specific client scope.
Get details for client scope "scope-id-123" in "master" realmcreate-client-scope-protocol-mapper โญ NEW
Create protocol mappers for client scopes.
Create organization mapper for client scope "organization-scope" in "master" realmupdate-client-scope-protocol-mapper โญ NEW
Update protocol mappers in client scopes.
Update protocol mapper "mapper-id-123" in client scope "scope-id-456" in "master" realmdelete-client-scope-protocol-mapper โญ NEW
Delete protocol mappers from client scopes.
Delete protocol mapper "mapper-id-123" from client scope "scope-id-456" in "master" realmlist-client-scope-protocol-mappers โญ NEW
List protocol mappers for a client scope.
List all protocol mappers for client scope "scope-id-123" in "master" realm๐ข Organization Management Tools โญ NEW
create-organization
Create a new organization.
Create organization "wateen-corp" with description "Wateen Corporation" in "master" realmupdate-organization
Update existing organization.
Update organization "org-id-123" in "master" realm to change name to "Updated Corp"delete-organization
Delete an organization.
Delete organization "org-id-123" from "master" realmlist-organizations
List all organizations in a realm.
List all organizations in "master" realm with search "wateen", limit 10get-organization
Get details of a specific organization.
Get details for organization "org-id-123" in "master" realmadd-organization-member
Add a user to an organization.
Add user "user-id-123" to organization "org-id-456" in "master" realmremove-organization-member
Remove a user from an organization.
Remove user "user-id-123" from organization "org-id-456" in "master" realmlist-organization-members
List all members of an organization.
List all members of organization "org-id-123" in "master" realm, limit 20๐ญ Role Management Tools
create-role
Creates roles at realm or client level.
Create a realm role "manager" with description "Manager role" in "master" realmupdate-role
Modifies role attributes.
Update role "manager" in "master" realm to change description to "Updated manager role"delete-role
Deletes roles.
Delete role "old-role" from "master" realmlist-roles
Lists all roles in a realm.
List all roles in the "master" realmlist-client-roles
Lists all roles defined on a client.
List all roles on client "my-app" in "master" realmassign-role-to-user
Assigns a realm role to a user, or a client role when clientId is supplied.
Assign role "manager" to user "user-id-123" in "master" realm
Assign client role "editor" on client "my-app" to user "user-id-123" in "master" realmremove-role-from-user
Removes a realm role from a user, or a client role when clientId is supplied.
Remove role "manager" from user "user-id-123" in "master" realm
Remove client role "editor" on client "my-app" from user "user-id-123" in "master" realmget-user-roles
Gets all roles directly assigned to a user, as { realmMappings, clientMappings }.
Get all roles for user "user-id-123" in "master" realmcreate-composite-role โญ NEW
Create composite roles (role hierarchies).
Create composite role from "parent-role-id" with child roles ["child-role-1", "child-role-2"] in "master" realmget-composite-roles โญ NEW
Get composite roles for a role.
Get composite roles for role "role-id-123" in "master" realm, limit 10delete-composite-roles โญ NEW
Delete composite roles from a role.
Remove composite roles ["child-role-1", "child-role-2"] from role "parent-role-id" in "master" realmget-role-by-id โญ NEW
Get role details by ID.
Get role details for role ID "role-id-123" in "master" realmupdate-role-by-id โญ NEW
Update role by ID.
Update role "role-id-123" in "master" realm to change name to "new-role-name"delete-role-by-id โญ NEW
Delete role by ID.
Delete role with ID "role-id-123" from "master" realmfind-users-with-role โญ NEW
Find users with a realm role, or with a client role when clientId is supplied.
Find all users with role "manager" in "master" realm, limit 20
Find all users with client role "editor" on client "my-app" in "master" realmassign-role-to-group โญ NEW
Assign a realm role to a group, or a client role when clientId is supplied.
Assign role "developer" to group "group-id-123" in "master" realm
Assign client role "editor" on client "my-app" to group "group-id-123" in "master" realmremove-role-from-group โญ NEW
Remove a realm role from a group, or a client role when clientId is supplied.
Remove role "developer" from group "group-id-123" in "master" realmget-group-roles โญ NEW
Get roles assigned to a group, as { realmMappings, clientMappings }.
Get all roles for group "group-id-123" in "master" realmlist-available-group-roles โญ NEW
List roles a group could still be granted โ realm roles, or a client's roles when clientId is supplied.
List available roles for group "group-id-123" in "master" realmlist-composite-group-roles โญ NEW
List composite roles for a group.
List composite roles for group "group-id-123" in "master" realm๐ฅ Group Management Tools
create-group
Creates user groups.
Create a group called "developers" in "master" realmupdate-group
Updates group attributes.
Update group "group-id-123" in "master" realm to change name to "senior-developers"delete-group
Deletes groups.
Delete group "group-id-123" from "master" realmlist-groups
Lists all groups in a realm.
List all groups in the "master" realmmanage-user-groups
Adds or removes users from groups.
Add user "user-id-123" to group "group-id-456" in "master" realmset-group-attributes โญ NEW
Set group attributes (organization metadata).
Set organization attributes for group "group-id-123" in "master" realm: {"department": ["engineering"]}get-group-attributes โญ NEW
Get group attributes.
Get all attributes for group "group-id-123" in "master" realmcreate-child-group โญ NEW
Create a child group (subgroup).
Create child group "junior-devs" under parent group "group-id-123" in "master" realmlist-sub-groups โญ NEW
List subgroups of a parent group.
List subgroups of parent group "group-id-123" in "master" realm, limit 10list-group-members โญ NEW
List members of a group.
List all members of group "group-id-123" in "master" realm, limit 20๐ Identity Provider Management Tools โญ NEW
create-identity-provider
Create a new identity provider for SSO integration.
Create SAML identity provider "company-saml" in "master" realm with SSO URL and certificateupdate-identity-provider
Update an existing identity provider.
Update identity provider "company-saml" in "master" realm to change display namedelete-identity-provider
Delete an identity provider.
Delete identity provider "old-saml" from "master" realmlist-identity-providers
List all identity providers in a realm.
List all identity providers in "master" realmget-identity-provider
Get details of a specific identity provider.
Get details for identity provider "company-saml" in "master" realmcreate-identity-provider-mapper
Create a mapper for identity provider (external user mapping).
Create user attribute mapper for identity provider "company-saml" in "master" realmupdate-identity-provider-mapper
Update an identity provider mapper.
Update mapper "mapper-id-123" for identity provider "company-saml" in "master" realm๐ Session & Event Management Tools
list-sessions
Lists all active sessions in a realm.
List all active sessions in "master" realmget-user-sessions
Lists active sessions for a specific user.
Get active sessions for user "user-id-123" in "master" realmlist-events
Retrieves authentication and admin events.
List last 10 events in "master" realmclear-events
Clears event logs.
Clear all events in "master" realm๐งช Testing & Development
Testing with MCP Inspector
npx @modelcontextprotocol/inspector npx keycloak-mcp-serverVisit http://localhost:6274 to test all 80+ tools interactively.
Local Development
npm run watch # Auto-rebuild on changes
npm run dev # Test server directlyStress Testing
The server has been stress-tested with 80+ consecutive operations without authentication failures, demonstrating production-level reliability.
๐ง Architecture
Bulletproof Authentication System
Fresh Client Instances: Creates new KcAdminClient for every request
Retry Logic: Exponential backoff with 2 attempts maximum
Connection Management: 15-second timeout with proper cleanup
Error Handling: Comprehensive error messages for all scenarios
TypeScript Implementation
Type Safety: Full TypeScript coverage with proper interfaces
Error Handling: Detailed error messages and logging
Modular Design: Clean separation of concerns
๐ Production Ready
This package has been extensively tested and validated:
โ 80+ consecutive operations without authentication failures
โ Cross-realm operations working seamlessly
โ Parallel tool execution supported
โ Complex search queries with multiple filters
โ Error recovery and detailed logging
โ TypeScript compilation with zero errors
โ Complete Keycloak API coverage with organization management
๐ฏ JWT Organization Problem Solved
This package specifically addresses the common JWT organization problem:
โ User Attributes: Store organization data in user attributes
โ Protocol Mappers: Create mappers to include organization in JWT tokens
โ Client Scopes: Manage token scopes for organization claims
โ Organizations: Full organization lifecycle management
โ Group Attributes: Store organization metadata in groups
Example workflow:
Create organization using
create-organizationSet user organization attribute using
set-user-attributesCreate protocol mapper using
create-protocol-mapperto include organization in JWTAdd user to organization using
add-organization-member
๐ Security Best Practices
Use environment variables for credentials
Enable HTTPS for production Keycloak instances
Use strong admin passwords
Regularly rotate credentials
Monitor admin events and sessions
๐ค Contributing
Fork the repository
Create a feature branch:
git checkout -b feature/amazing-featureCommit changes:
git commit -m 'Add amazing feature'Push to branch:
git push origin feature/amazing-featureOpen a Pull Request
๐ License
MIT License - see LICENSE file for details.
๐ Support
GitHub Issues: Create an issue
Documentation: Check this README for comprehensive examples
MCP Documentation: Model Context Protocol
๐ Related Projects
Claude Desktop - AI assistant supporting MCP
Cursor AI - AI-powered code editor with MCP support
Model Context Protocol - Protocol specification
Keycloak - Open source identity and access management
๐ Package Stats
80+ Tools: Complete Keycloak administration coverage
Production Ready: Extensively tested and validated
TypeScript: Full type safety and modern development experience
Cross-Platform: Windows, macOS, and Linux support
Zero Dependencies Issues: Robust dependency management
Organization Management: Solve JWT organization visibility problems
Advanced Features: Protocol mappers, client scopes, identity providers
Made with โค๏ธ for the Keycloak and AI community
Available Tools
86 toolsadd-organization-memberC
Add a user to an organization
Inputs: orgId (required), realm (required), userId (required).
assign-role-to-groupA
Assign a realm role, or a client role when clientId is given, to a group
Inputs: realm (required), groupId (required), roleName (required), clientId.
assign-role-to-userA
Assign a realm role, or a client role when clientId is given, to a user
Inputs: realm (required), userId (required), roleName (required), clientId.
clear-eventsC
Clear event logs
Inputs: realm (required).
create-child-groupC
Create a child group (subgroup)
Inputs: name (required), realm (required), parentGroupId (required), attributes.
create-clientB
Register a new client/application in a realm
Inputs: realm (required), clientId (required), name, enabled, +3 more.
create-client-scopeB
Create a new client scope (CRITICAL for managing token scopes)
Inputs: name (required), realm (required), protocol, attributes, +1 more.
create-client-scope-protocol-mapperC
Create a protocol mapper for a client scope
Inputs: name (required), realm (required), protocol (required), clientScopeId (required), +2 more.
create-composite-roleC
Create composite roles (role hierarchies)
Inputs: realm (required), roles (required), roleId (required).
create-groupB
Create user groups
Inputs: name (required), realm (required), parentId.
create-identity-providerC
Create a new identity provider for SSO integration
Inputs: alias (required), realm (required), providerId (required), config, +7 more.
create-identity-provider-mapperC
Create a mapper for identity provider (external user mapping)
Inputs: name (required), alias (required), realm (required), identityProviderMapper (required), +1 more.
create-organizationB
Create a new organization (CRITICAL for organization management)
Inputs: name (required), realm (required), enabled, attributes, +1 more.
create-protocol-mapperA
Create a protocol mapper for a client (CRITICAL for JWT organization claims)
Inputs: name (required), realm (required), clientId (required), protocol (required), +2 more.
create-realmB
Create a new realm with configurable settings
Inputs: realm (required), enabled, displayName.
create-roleA
Create roles at realm or client level
Inputs: realm (required), roleName (required), clientId, description.
create-userB
Create a new user in a specific realm
Inputs: email (required), realm (required), lastName (required), username (required), +1 more.
delete-clientB
Remove a client from a realm
Inputs: realm (required), clientId (required).
delete-client-scopeC
Delete a client scope
Inputs: realm (required), clientScopeId (required).
delete-client-scope-protocol-mapperB
Delete a protocol mapper from a client scope
Inputs: realm (required), mapperId (required), clientScopeId (required).
delete-composite-rolesC
Delete composite roles from a role
Inputs: realm (required), roles (required), roleId (required).
delete-groupC
Delete groups
Inputs: realm (required), groupId (required).
delete-identity-providerC
Delete an identity provider
Inputs: alias (required), realm (required).
delete-identity-provider-mapperC
Delete an identity provider mapper
Inputs: alias (required), realm (required), mapperId (required).
delete-organizationB
Delete an organization
Inputs: orgId (required), realm (required).
delete-protocol-mapperA
Delete a protocol mapper from a client
Inputs: realm (required), clientId (required), mapperId (required).
delete-realmB
Delete an existing realm
Inputs: realm (required).
delete-roleC
Delete roles
Inputs: realm (required), roleName (required), clientId.
delete-role-by-idB
Delete role by ID
Inputs: realm (required), roleId (required).
delete-userA
Delete a user from a specific realm
Inputs: realm (required), userId (required).
find-users-with-roleA
Find users with a realm role, or with a client role when clientId is given
Inputs: realm (required), roleName (required), max, first, +1 more.
get-client-scopeB
Get details of a specific client scope
Inputs: realm (required), clientScopeId (required).
get-composite-rolesC
Get composite roles for a role
Inputs: realm (required), roleId (required), max, first, +1 more.
get-group-attributesC
Get group attributes
Inputs: realm (required), groupId (required).
get-group-rolesA
Get roles assigned to a group, returned as { realmMappings, clientMappings }
Inputs: realm (required), groupId (required).
get-identity-providerA
Get details of a specific identity provider
Inputs: alias (required), realm (required).
get-identity-provider-mapperA
Get details of a specific identity provider mapper
Inputs: alias (required), realm (required), mapperId (required).
get-organizationA
Get details of a specific organization
Inputs: orgId (required), realm (required).
get-realm-settingsA
Retrieve detailed settings of a realm
Inputs: realm (required).
get-role-by-idC
Get role details by ID
Inputs: realm (required), roleId (required).
get-userA
Get user details by ID from a specific realm
Inputs: realm (required), userId (required).
get-user-attributesA
Get user attributes including unmanaged attributes
Inputs: realm (required), userId (required).
get-user-rolesA
Get all roles directly assigned to a user, returned as { realmMappings, clientMappings }
Inputs: realm (required), userId (required).
get-user-sessionsC
List active sessions for a user
Inputs: realm (required), userId (required).
import-identity-provider-from-urlB
Import identity provider configuration from URL
Inputs: realm (required), fromUrl (required), providerId (required).
list-available-group-rolesA
List roles a group could still be granted -- realm roles, or a client's roles when clientId is given
Inputs: realm (required), groupId (required), clientId.
list-client-rolesA
List all roles defined on a client
Inputs: realm (required), clientId (required).
list-clientsB
List all clients in a realm
Inputs: realm (required).
list-client-scope-protocol-mappersA
List protocol mappers for a client scope
Inputs: realm (required), clientScopeId (required).
list-client-scopesA
List all client scopes in a realm
Inputs: realm (required).
list-composite-group-rolesB
List composite roles for a group
Inputs: realm (required), groupId (required).
list-eventsA
Retrieve authentication and admin events
Inputs: realm (required), max, type.
list-group-membersB
List members of a group
Inputs: realm (required), groupId (required), max, first.
list-groupsA
List all groups in a realm
Inputs: realm (required).
list-identity-provider-mappersB
List all mappers for an identity provider
Inputs: alias (required), realm (required).
list-identity-provider-mapper-typesB
List available mapper types for an identity provider
Inputs: alias (required), realm (required).
list-identity-providersB
List all identity providers in a realm
Inputs: realm (required), max, first, search.
list-organization-membersC
List all members of an organization
Inputs: orgId (required), realm (required), max, first, +1 more.
list-organizationsB
List all organizations in a realm
Inputs: realm (required), max, first, search.
list-protocol-mappersA
List protocol mappers for a client
Inputs: realm (required), clientId (required).
list-realmsB
List all available realms
Inputs: random_string (required).
list-rolesB
List all roles in a specific realm
Inputs: realm (required).
list-sessionsA
List all active sessions in a realm
Inputs: realm (required), clientId.
list-sub-groupsA
List subgroups of a parent group
Inputs: realm (required), parentGroupId (required), max, first, +1 more.
list-usersB
List users in a specific realm
Inputs: realm (required).
logout-userB
Logout all sessions for a specific user
Inputs: realm (required), userId (required).
manage-user-groupsB
Add or remove users from groups
Inputs: realm (required), action (required), userId (required), groupId (required).
remove-organization-memberB
Remove a user from an organization
Inputs: orgId (required), realm (required), userId (required).
remove-role-from-groupA
Remove a realm role, or a client role when clientId is given, from a group
Inputs: realm (required), groupId (required), roleName (required), clientId.
remove-role-from-userA
Remove a realm role, or a client role when clientId is given, from a user
Inputs: realm (required), userId (required), roleName (required), clientId.
reset-user-passwordB
Reset a user's password in a specific realm
Inputs: realm (required), userId (required), newPassword (required), temporary.
search-usersC
Search users in a specific realm with filters
Inputs: realm (required), max, email, search, +3 more.
set-group-attributesC
Set group attributes (organization metadata)
Inputs: realm (required), groupId (required), attributes (required).
set-user-attributesB
Set user attributes (CRITICAL for storing organization data)
Inputs: realm (required), userId (required), attributes (required).
update-clientC
Update client settings (redirect URIs, protocol mappers, etc.)
Inputs: realm (required), clientId (required), name, enabled, +3 more.
update-client-scopeB
Update an existing client scope
Inputs: realm (required), clientScopeId (required), name, protocol, +2 more.
update-client-scope-protocol-mapperB
Update a protocol mapper for a client scope
Inputs: name (required), realm (required), mapperId (required), protocol (required), +3 more.
update-groupD
Update group attributes
Inputs: realm (required), groupId (required), name.
update-identity-providerB
Update an existing identity provider
Inputs: alias (required), realm (required), config, enabled, +7 more.
update-identity-provider-mapperC
Update an identity provider mapper
Inputs: name (required), alias (required), realm (required), mapperId (required), +2 more.
update-organizationB
Update an existing organization
Inputs: orgId (required), realm (required), name, enabled, +2 more.
update-protocol-mapperC
Update a protocol mapper for a client
Inputs: name (required), realm (required), clientId (required), mapperId (required), +3 more.
update-realmC
Update realm settings and configurations
Inputs: realm (required), enabled, displayName.
update-roleC
Modify role attributes
Inputs: realm (required), roleName (required), newName, clientId, +1 more.
update-role-by-idC
Update role by ID
Inputs: realm (required), roleId (required), name, composite, +4 more.
update-userC
Update user information in a specific realm
Inputs: realm (required), userId (required), email, enabled, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 86 tools
While most tools map to distinct resources, the large number of role-related tools (create-role, create-composite-role, update-role, update-role-by-id, delete-role, delete-role-by-id) and similar mapper tools create potential confusion. Some tools like manage-user-groups and find-users-with-role could also be misselected without careful reading.
All tool names consistently follow a verb-noun hyphenated pattern (e.g., create-user, list-clients, delete-identity-provider-mapper). The style is uniform and predictable, making it easy to infer function from the name.
With 86 tools, this server far exceeds the reasonable scope for a coherent toolset, even for a complex system like Keycloak. The count is in the extreme range and will overwhelm agents, increasing selection difficulty and cognitive load.
The toolset covers most core Keycloak admin operations across realms, users, clients, roles, groups, organizations, identity providers, and mappers. However, notable gaps exist such as get-client and get-group (by ID), which are standard CRUD operations agents would expect.
Maintenance
Related MCP Connectors
Managed Keycloak from any MCP client: clusters, realms, apps, SSO, users, domains, audit events.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Keycloak identity management expert with semantic search, protocol guides, and config analysis
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables management of Keycloak users and realms through a standardized interface, providing tools for user creation, deletion, role assignment, and group management.9102 npm13MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI assistants to navigate, search, and analyze local Keycloak source code to support developer customizations like SPIs and authenticators. It provides tools for searching classes, generating boilerplate code, detecting breaking changes between versions, and tracing dependencies.8MIT
- AlicenseAqualityBmaintenanceAn MCP server for Keycloak Admin REST API, enabling user, group, event, and security management through service account authentication.33152 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that provides a natural language interface for managing Keycloak identity and access management through its REST API.MIT