Overview
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.
Features
- User Management: Create, delete, and list users across realms
- Realm Administration: Comprehensive realm management capabilities
- Secure Integration: Authentication with admin credentials
- Easy Configuration: Simple setup with environment variables
- LLM Integration: Seamless use with Claude, ChatGPT, and other MCP-compatible AI assistants
Installation
Via NPM (Recommended)
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
Configuration
Environment Variables
| 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 |
MCP Client Configuration
VS Code
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"
}
}
}
}
Claude Desktop
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"
}
}
}
}
For Local Development
{
"mcpServers": {
"keycloak": {
"command": "node",
"args": ["path/to/build/index.js"],
"env": {
"KEYCLOAK_URL": "http://localhost:8080",
"KEYCLOAK_ADMIN": "admin",
"KEYCLOAK_ADMIN_PASSWORD": "admin"
}
}
}
}
Server Config
{
"mcpServers": {
"keycloak": {
"command": "npx",
"args": [
"-y",
"@octodet/keycloak-mcp"
],
"env": {
"KEYCLOAK_URL": "http://localhost:8080",
"KEYCLOAK_ADMIN": "admin",
"KEYCLOAK_ADMIN_PASSWORD": "admin"
}
}
}
}