
Keycloak
STDIOMCP server for Keycloak integration with comprehensive user and realm management capabilities
MCP server for Keycloak integration with comprehensive user and realm management capabilities
This project provides tools for developers using Keycloak. It includes utilities for interacting with a Keycloak server, a search client for the official Keycloak Discourse community, and built-in Retrieval-Augmented Generation (RAG) capabilities.
The project is under active development. You can contribute by reporting issues, suggesting new features, or submitting pull requests.
For more details on how to contribute, please see
graph LR subgraph Realm U[Users] C[Clients] R[Roles] G[Groups] end
The Keycloak MCP server is available in the following formats:
You can add the following in the config in the ~/.cursor/mcp.json
{ "mcpServers": { "keycloak_mcp_server": { "type": "stdio", "command": "<full path> keycloak-mcp-server-0.1", "args": [], "env": { "KC_URL": "http://localhost:8081", "KC_USER": "admin", "KC_PASSWORD": "admin" } } } }
You can add the keycloak server by adding the following to claude_desktop_config
.
{ "mcpServers": { "keycloak": { "command": "<full path>/keycloak-mcp-server-0.1", "args": [], "env": { "KC_URL": "http://localhost:8081", "KC_USER": "admin", "KC_PASSWORD": "admin" } } } }
You can add the keycloak MCP server tools into VS Code by adding the following to your mcp.json
.
"keycloak_mcp_server": { "type": "stdio", "command": "<full path> keycloak-mcp-server-0.1", "args": [], "env": { "KC_URL": "http://localhost:8081", "KC_USER": "admin", "KC_PASSWORD": "admin" }
extensions: keycloak_mcp_server: display_name: Keycloak MCP Server enabled: true name: keycloak-mcp-server timeout: 300 type: stdio cmd: "<full path>keycloak-mcp-server-0.1" args: [] env_keys: - "KC_URL"
You need to set an environment variable: e.g.
export KC_URL=http://localhost:8081
Now you can run goose session
and the extension should be loaded.
The examples above are for native binaries. however you can also use the uber-jar
If using the uber jar change the cmd
and args
as follows
cmd|command: "java" args: ["-jar", "path to jar"]
Here are some examples of how to use the Keycloak MCP Server with Goose:
( O)> can I create a new user in keycloak?
Yes, you can create a new user in Keycloak. To do this, you'll need to provide the following information about the user:
- **Realm**: The name of the realm where the user will reside.
- **Username**: The username for the new user.
- **First Name**: The first name of the user.
- **Last Name**: The last name of the user.
- **Email**: The email address of the user.
- **Password**: The password for the user's account.
You can provide these details, and I can assist you with creating the user.
----
( O)> list all users in quarkus realm
Here are the users in the "quarkus" realm:
1. **admin**
- ID: `af134cab-f41c-4675-b141-205f975db679`
2. **alice**
- ID: `eb4123a3-b722-4798-9af5-8957f823657a`
3. **jdoe**
- ID: `1eed6a8e-a853-4597-b4c6-c4c2533546a0`
----
( O)> can you delete user sshaaf from realm quarkus
Contributions are welcome! For more information please read the following documents.