
A modular FastMCP server for interacting with Microsoft Graph API, supporting advanced queries for users, sign-in logs, MFA status, and privileged users.

A Model Context Protocol server that exposes tools for administering Keycloak users, realms, and client roles through LLM interfaces.
Octodet Keycloak MCP Server is cataloged as an MCP server attributed to octodet. A Model Context Protocol server that exposes tools for administering Keycloak users, realms, and client roles through LLM interfaces. It is categorized under auth security. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.
能力定义尚未审核。未核验的采集内容不会作为可信接口展示。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for Octodet Keycloak MCP Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Yes, update-user-roles supports combined operations where roles are added and removed in one call, requiring at least one of rolesToAdd or rolesToRemove.
It accepts either the human-readable client ID or the client UUID.
It is configured through environment variables for the Keycloak URL, admin credentials, and default realm.
README.md · 41649be6e112 · 采集于 2026-11-13 13:23:21 UTC
保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。
当前显示最后一次成功采集的文档快照,请以来源页面为准。
A powerful Model Context Protocol server for Keycloak administration, providing a comprehensive set of tools to manage users, realms, roles, and other Keycloak resources through LLM interfaces.
The server is available as an NPM package:
# Direct usage with npx
npx -y @octodet/keycloak-mcp
# Or global installation
npm install -g @octodet/keycloak-mcp
| Variable | Description | Default |
|---|---|---|
| KEYCLOAK_URL | Keycloak server URL | http://localhost:8080 |
| KEYCLOAK_ADMIN | Admin username | admin |
| KEYCLOAK_ADMIN_PASSWORD | Admin password | admin |
| KEYCLOAK_REALM | Default realm | master |
Add this to your settings.json:
{
"mcp.servers": {
"keycloak": {
"command": "npx",
"args": ["-y", "@octodet/keycloak-mcp"],
"env": {
"KEYCLOAK_URL": "http://localhost:8080",
"KEYCLOAK_ADMIN": "admin",
"KEYCLOAK_ADMIN_PASSWORD": "admin"
}
}
}
}
Configure in your Claude Desktop configuration file:
{
"mcpServers": {
"keycloak": {
"command": "npx",
"args": ["-y", "@octodet/keycloak-mcp"],
"env": {
"KEYCLOAK_URL": "http://localhost:8080",
"KEYCLOAK_ADMIN": "admin",
"KEYCLOAK_ADMIN_PASSWORD": "admin"
}
}
}
}
{
"mcpServers": {
"keycloak": {
"command": "node",
"args": ["path/to/build/index.js"],
"env": {
"KEYCLOAK_URL": "http://localhost:8080",
"KEYCLOAK_ADMIN": "admin",
"KEYCLOAK_ADMIN_PASSWORD": "admin"
}
}
}
}
The server provides a comprehensive set of MCP tools for Keycloak administration. Each tool is designed to perform specific administrative tasks across realms, users, and roles.
| Tool | Category | Description |
|---|---|---|
create-user | User Management | Create a new user in a specified realm |
delete-user | User Management | Delete an existing user from a realm |
list-users | User Management | List all users in a specified realm |
list-realms | Realm Management | List all available realms |
list-roles | Role Management | List all roles for a specific client |
update-user-roles | Role Management | Add or remove client roles for a user |
create-userCreates a new user in a specified realm with comprehensive user attributes and optional credentials.
Required Parameters:
realm (string): Target realm nameusername (string): Unique username for the new useremail (string): Valid email addressfirstName (string): User's first namelastName (string): User's last nameOptional Parameters:
enabled (boolean): Enable/disable user account (default: true)emailVerified (boolean): Mark email as verifiedcredentials (array): Array of credential objects for setting passwordsCredential Object Structure:
type (string): Credential type (e.g., "password")value (string): The credential valuetemporary (boolean): Whether password must be changed on first loginExample Usage:
{
"realm": "my-app-realm",
"username": "john.doe",
"email": "john.doe@company.com",
"firstName": "John",
"lastName": "Doe",
"enabled": true,
"emailVerified": true,
"credentials": [
{
"type": "password",
"value": "TempPassword123!",
"temporary": true
}
]
}
Response: Returns the created user ID and confirmation message.
delete-userPermanently removes a user from the specified realm. This action cannot be undone.
Required Parameters:
realm (string): Target realm nameuserId (string): Unique identifier of the user to deleteExample Usage:
{
"realm": "my-app-realm",
"userId": "8f5c21e3-7c9d-4b5a-9f3e-8d4f6a2e7b1c"
}
Response: Confirmation message of successful deletion.
⚠️ Warning: This operation is irreversible. Ensure you have the correct user ID before execution.
list-usersRetrieves a list of all users in the specified realm with their basic information.
Required Parameters:
realm (string): Target realm nameExample Usage:
{
"realm": "my-app-realm"
}
Response: Returns a formatted list showing usernames and user IDs for all users in the realm.
list-realmsRetrieves all available realms in the Keycloak instance.
Parameters: None required
Example Usage:
{}
Response: Returns a list of all realm names available in the Keycloak installation.
Use Cases:
list-rolesLists all roles defined for a specific client within a realm. Useful for understanding available permissions and roles before assignment.
Required Parameters:
realm (string): Target realm nameclientId (string): Client ID or UUID of the target clientExample Usage:
{
"realm": "my-app-realm",
"clientId": "my-application"
}
Alternative with Client UUID:
{
"realm": "my-app-realm",
"clientId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Response: Returns a formatted list of all role names available for the specified client.
💡 Tip: You can use either the client's human-readable ID or its UUID identifier.
update-user-rolesManages client role assignments for a user. Allows both adding and removing roles in a single operation.
Required Parameters:
realm (string): Target realm nameuserId (string): User's unique identifierclientId (string): Client ID or UUIDOptional Parameters:
rolesToAdd (array): List of role names to assign to the userrolesToRemove (array): List of role names to remove from the userExample Usage - Adding Roles:
{
"realm": "my-app-realm",
"userId": "8f5c21e3-7c9d-4b5a-9f3e-8d4f6a2e7b1c",
"clientId": "my-application",
"rolesToAdd": ["admin", "user-manager", "report-viewer"]
}
Example Usage - Removing Roles:
{
"realm": "my-app-realm",
"userId": "8f5c21e3-7c9d-4b5a-9f3e-8d4f6a2e7b1c",
"clientId": "my-application",
"rolesToRemove": ["temporary-access", "beta-tester"]
}
Example Usage - Combined Operation:
{
"realm": "my-app-realm",
"userId": "8f5c21e3-7c9d-4b5a-9f3e-8d4f6a2e7b1c",
"clientId": "my-application",
"rolesToAdd": ["senior-user"],
"rolesToRemove": ["junior-user", "trainee"]
}
Response: Detailed summary of roles added, removed, and any errors encountered.
🔍 Notes:
rolesToAdd or rolesToRemove must be providedUser IDs vs Usernames: Most operations require user IDs (UUIDs), not usernames. Use list-users to find the correct user ID.
Client Identification: The clientId parameter accepts both human-readable client IDs and UUID identifiers.
Realm Validation: Always verify realm names using list-realms before performing operations.
Role Discovery: Use list-roles to discover available roles before attempting role assignments.
Error Handling: All tools provide detailed error messages for troubleshooting authentication, permission, or parameter issues.
# Clone the repository
git clone <repository-url>
# Install dependencies
npm install
# Start the development server with watch mode
npm run watch
To add a new tool to the server:
src/index.ts using ZodListToolsRequestSchema handlerCallToolRequestSchema switch statementThe MCP Inspector is a great tool for testing your MCP server:
npx -y @modelcontextprotocol/inspector npx -y @octodet/keycloak-mcp
For testing with a local Keycloak instance:
# Start Keycloak with Docker
docker run -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:latest start-dev
# In another terminal, run the MCP server
npm run build
node build/index.js
This project is published to NPM under @octodet/keycloak-mcp.
This project uses GitHub Actions for CI/CD to automatically test and publish to NPM when a new release is created.
This project is licensed under the MIT License - see the LICENSE file for details.
Octodet - Building intelligent tools for developers
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for Octodet Keycloak MCP Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/keycloak-mcp)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。
尚无已审核的包 / 镜像标识,暂不展示下载统计。
Alternative and complementary servers in the same category

A modular FastMCP server for interacting with Microsoft Graph API, supporting advanced queries for users, sign-in logs, MFA status, and privileged users.

A Model Context Protocol (MCP) server that provides programmatic access to Keycloak administration functionality.

An MCP server for LLM-driven penetration testing that wraps Kali tools and adds scope enforcement, engagement tracking, and structured output.