Purpose
Keycloak MCP Server is a Model Context Protocol (MCP) server for Keycloak management, mainly used to implement AI-driven Keycloak user and realm management through the MCP protocol. It can seamlessly integrate with Claude Desktop and other MCP clients for automated user operations.
Main Capabilities
The tools provided by this server include:
- Create a new user in a specified realm. Parameters: realm (realm name), username (username of the new user), email (user's email address), firstName (user's first name), lastName (user's last name).
- Delete a user from a specified realm. Parameters: realm, userId (ID of the user to delete).
- List all available realms.
- List all users in a specified realm.
Usage
Installation methods include:
- Automatic installation for Claude Desktop via Smithery.
- Via NPM (recommended); the server is provided as an NPM package.
- Local development setup. If you want to develop or modify the server, you can use the NPM package (recommended) method and configure the server in the Claude Desktop configuration file; it can also be used for local development.
MCP Inspector can be used when testing the server.
The project is automatically published to NPM via GitHub Actions when a new version is released on GitHub. The publishing process involves: creating an NPM account and obtaining an access token; adding a secret named NPM_TOKEN in the GitHub repository's Settings > Secrets, and pasting the NPM access token as its value.
Applicable Scenarios
Suitable for scenarios that require automated management of users and realms in Keycloak through AI clients such as Claude Desktop, for example daily management operations such as creating users, deleting users, querying realm lists, and user lists.
Limitations and Requirements
The runtime environment requires Node.js 18 or later and requires a running Keycloak instance. In addition to the tools listed above, such as creating users, deleting users, listing realms, and listing users,other functions, fees, and pricing information are not yet provided.