keycloak model context protocol
A Model Context Protocol server that provides tools to manage Keycloak users and realms, allowing you to create and delete users, list available realms, and view users in specific realms.
A Model Context Protocol server that provides tools to manage Keycloak users and realms, allowing you to create and delete users, list available realms, and view users in specific realms.
A Model Context Protocol server for Keycloak administration, providing tools to manage users and realms.
To install Keycloak for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install keycloak-model-context-protocol --client claude
The server is available as an NPM package:
# Direct usage with npx
npx -y keycloak-model-context-protocol
# Or global installation
npm install -g keycloak-model-context-protocol
If you want to develop or modify the server:
git clone <repository-url>
cd keycloak-model-context-protocol
npm install
npm run build
Configure the server in your Claude Desktop configuration file:
{
"mcpServers": {
"keycloak": {
"command": "npx",
"args": ["-y", "keycloak-model-context-protocol"],
"env": {
"KEYCLOAK_URL": "http://localhost:8080",
"KEYCLOAK_ADMIN": "admin",
"KEYCLOAK_ADMIN_PASSWORD": "admin"
}
}
}
}
{
"mcpServers": {
"keycloak": {
"command": "node",
"args": ["path/to/dist/index.js"],
"env": {
"KEYCLOAK_URL": "http://localhost:8080",
"KEYCLOAK_ADMIN": "admin",
"KEYCLOAK_ADMIN_PASSWORD": "admin"
}
}
}
}
Creates a new user in a specified realm.
Inputs:
- realm
: The realm name
- username
: Username for the new user
- email
: Email address for the user
- firstName
: User is first name
- lastName
: User is last name
Deletes a user from a specified realm.
Inputs:
- realm
: The realm name
- userId
: The ID of the user to delete
Lists all available realms.
Lists all users in a specified realm.
Inputs:
- realm
: The realm name
npm run watch
To test the server using MCP Inspector:
npx -y @modelcontextprotocol/inspector npx -y keycloak-model-context-protocol
This project is automatically published to NPM via GitHub Actions when a new release is published on GitHub.
NPM_TOKEN
[
{
"description": "Create a new user in a specific realm",
"inputSchema": {
"properties": {
"email": {
"format": "email",
"type": "string"
},
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"realm": {
"type": "string"
},
"username": {
"type": "string"
}
},
"required": [
"realm",
"username",
"email",
"firstName",
"lastName"
],
"type": "object"
},
"name": "create-user"
},
{
"description": "Delete a user from a specific realm",
"inputSchema": {
"properties": {
"realm": {
"type": "string"
},
"userId": {
"type": "string"
}
},
"required": [
"realm",
"userId"
],
"type": "object"
},
"name": "delete-user"
},
{
"description": "List all available realms",
"inputSchema": {
"properties": {},
"required": [],
"type": "object"
},
"name": "list-realms"
},
{
"description": "List users in a specific realm",
"inputSchema": {
"properties": {
"realm": {
"type": "string"
}
},
"required": [
"realm"
],
"type": "object"
},
"name": "list-users"
}
]