HaithamOumerzoug/keycloak-mcp
If you are the rightful owner of keycloak-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Keycloak MCP is a Model Context Protocol server implementation for Keycloak, providing a standardized interface for managing Keycloak users and realms.
Keycloak MCP is a robust server implementation designed to integrate seamlessly with Keycloak, a popular open-source identity and access management solution. By leveraging the Model Context Protocol (MCP), this server offers a standardized interface for managing users and realms within Keycloak. It utilizes the official Keycloak Admin Client to interact with Keycloak's API, ensuring reliable and efficient operations. This project is particularly beneficial for developers and administrators who require a consistent and streamlined method to manage identity and access control across various applications. With Keycloak MCP, users can perform a range of operations such as creating and deleting users, listing realms, and managing client roles, all through a unified protocol. The server is available as an NPM package, making it easy to install and configure within different development environments. Additionally, it supports integration with platforms like Claude Desktop and Cursor IDE, further enhancing its versatility and usability.
Features
- Standardized interface for managing Keycloak users and realms
- Integration with Keycloak's API using the official Admin Client
- Support for various operations such as user creation, deletion, and role management
- Available as an NPM package for easy installation
- Compatible with platforms like Claude Desktop and Cursor IDE
Usages
usage with Claude Desktop
{ "mcpServers": { "keycloak": { "command": "npx", "args": ["-y", "keycloak-mcp"], "env": { "KEYCLOAK_URL": "http://localhost:8080", "KEYCLOAK_ADMIN": "admin", "KEYCLOAK_ADMIN_PASSWORD": "admin" } } } }
usage with Cursor IDE
{ "mcpServers": { "keycloak": { "command": "npx", "args": ["-y", "keycloak-mcp"], "env": { "KEYCLOAK_URL": "http://localhost:8080", "KEYCLOAK_ADMIN": "admin", "KEYCLOAK_ADMIN_PASSWORD": "admin" } } } }
usage with Cline
{ "mcpServers": { "keycloak": { "command": "npx", "args": ["-y", "keycloak-mcp"], "env": { "KEYCLOAK_URL": "http://localhost:8080", "KEYCLOAK_ADMIN": "admin", "KEYCLOAK_ADMIN_PASSWORD": "admin" } } } }
local development
{ "mcpServers": { "keycloak": { "command": "node", "args": ["path/to/dist/index.js"], "env": { "KEYCLOAK_URL": "http://localhost:8080", "KEYCLOAK_ADMIN": "admin", "KEYCLOAK_ADMIN_PASSWORD": "admin" } } } }
Tools
create-user
Creates a new user in a specified realm.
delete-user
Deletes a user from a specified realm.
list-realms
Lists all available realms.
list-users
Lists all users in a specified realm.
list-clients
Lists all clients in a specified realm.
list-groups
Lists all groups in a specified realm.
list-client-roles
Lists all roles for a specific client in a realm.
assign-client-role-to-user
Assigns a client role to a specific user.
add-user-to-group
Adds a user to a specific group.