mcp-keycloak
MCP server by dockndevai Community
Lets AI assistants inspect and manage Keycloak realms, users, clients, roles and groups. It starts read-only and uses flags to limit realms, block deletes and log changes. Aimed at teams running Keycloak with MCP clients.
Install mcp-keycloak
Built from the published package, never by AI.
claude mcp add mcp-keycloak -e KEYCLOAK_URL=YOUR_KEYCLOAK_URL -- npx -y @dockndevai/mcp-keycloakRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"mcp-keycloak": {
"env": {
"KEYCLOAK_URL": "YOUR_KEYCLOAK_URL"
},
"args": [
"-y",
"@dockndevai/mcp-keycloak"
],
"command": "npx"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"mcp-keycloak": {
"env": {
"KEYCLOAK_URL": "YOUR_KEYCLOAK_URL"
},
"args": [
"-y",
"@dockndevai/mcp-keycloak"
],
"command": "npx"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"mcp-keycloak": {
"env": {
"KEYCLOAK_URL": "YOUR_KEYCLOAK_URL"
},
"args": [
"-y",
"@dockndevai/mcp-keycloak"
],
"command": "npx"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add mcp-keycloak --env KEYCLOAK_URL=YOUR_KEYCLOAK_URL -- npx -y @dockndevai/mcp-keycloak{
"mcpServers": {
"mcp-keycloak": {
"env": {
"KEYCLOAK_URL": "YOUR_KEYCLOAK_URL"
},
"args": [
"-y",
"@dockndevai/mcp-keycloak"
],
"command": "npx"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add mcp-keycloak npx -y @dockndevai/mcp-keycloakGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the mcp-keycloak block.
About
mcp-keycloak is a Model Context Protocol server for Keycloak. It lets an MCP-capable client, such as Claude Desktop or Claude Code, inspect and manage Keycloak realms, users, clients, roles, and groups. Every tool takes a realm argument, and access is controlled by flags.
The server is built around safe defaults. It starts in read-only mode, can be limited to an allowlist of realms, and keeps the master realm protected from changes. Delete tools need both admin mode and an explicit opt-in. Dry-run and JSON audit logging are also available. It suits administrators who want an AI agent to work with Keycloak under strict controls.
Written from the project's README and checked against it.
Tools it gives your assistant
list_realmsLists the Keycloak realms available to the server.get_realmReturns details for a single realm.list_usersLists users in a realm.get_userReturns details for a single user.count_usersCounts the users in a realm.list_clientsLists clients in a realm.list_realm_rolesLists realm roles in a realm.list_groupsLists groups in a realm.create_userCreates a user. Requires read-write mode or higher.update_userUpdates an existing user. Requires read-write mode or higher.
What you need
- A running Keycloak server reachable at KEYCLOAK_URL
- Keycloak client credentials or an admin username and password
- An MCP-capable client such as Claude Desktop, Claude Code, Cursor or VS Code
- npm and npx to run the published package
| Setting | Needed | What it is |
|---|---|---|
KEYCLOAK_Environment variable | Required | Base URL of the Keycloak server (no trailing slash). |
KEYCLOAK_Environment variable | Optional | Client id used to authenticate (default admin-cli). |
KEYCLOAK_Environment variable, secret | Optional | Service-account client secret (or use KEYCLOAK_USERNAME/PASSWORD). |
KEYCLOAK_Environment variable | Optional | Access mode: read-only | read-write | admin. |
From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.
Try asking
- List all users in the staging realm
- How many users are in the demo realm?
- Show the realm roles defined in the staging realm
Good to know
- Starts in read-only mode by default.
- Delete users requires admin mode and KEYCLOAK_ALLOW_DELETE set to true.
- Protected realms, master by default, can be read but never changed.
- Clients without elicitation support fall back to the *_ALLOW_* gate flags.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to mcp-keycloak
All alternatives →Azure MCP Server bundles all Azure MCP tools into one local MCP server. It connects AI agents to Azure services and can be used alone or with the GitHub Copilot for Azure extension in VS Code.
Manages monitors, status pages, incidents and maintenances in an openstatus workspace from Claude, ChatGPT, or Cursor. It suits teams that run uptime monitoring and status pages and want their AI assistant to update them.
SmartBear MCP gives AI assistants access to SmartBear's testing and monitoring tools, including BugSnag, Reflect, Swagger, PactFlow and QTM4J. It is aimed at teams that already use these products. Products are reached through remote servers or a local npm package.
Lets AI assistants manage Fettle uptime monitoring, including monitors, incidents, heartbeats, maintenance windows and status page incidents. Built for developers and operations teams who use Fettle and want to work from Claude, Cursor or Codex.
Superlog is an open-source agentic telemetry system that ingests traces, logs and metrics and groups noisy signals into incidents. It is aimed at teams debugging production systems with OpenTelemetry data.
Microsoft Learn MCP gives AI assistants direct access to official Microsoft documentation and code samples through a remote MCP endpoint. It is for developers who use MCP-compatible clients and want answers based on current Microsoft docs.
Compare with Azure MCP Server, openstatus or SmartBear MCP
mcp-keycloak: common questions
Is it safe to let an AI change Keycloak settings?
The server starts read-only, and write or admin tools are only registered when the mode allows them. Destructive actions prompt for human approval through MCP elicitation when the client supports it.
Can the server delete users?
delete_user is only available in admin mode and also requires KEYCLOAK_ALLOW_DELETE to be true. Admin mode alone does not enable deletion.
Can I preview changes without applying them?
With KEYCLOAK_DRY_RUN enabled, write and admin tools validate and log their intent, then return without calling Keycloak.
How do I install mcp-keycloak?
In Claude Code run claude mcp add mcp-keycloak -e KEYCLOAK_URL=YOUR_KEYCLOAK_URL -- npx -y @dockndevai/mcp-keycloak. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is mcp-keycloak the official server?
mcp-keycloak is a community project by dockndevai, not verified by a company domain.
Is mcp-keycloak free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is mcp-keycloak safe to use?
It scores 78 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to mcp-keycloak?
Similar MCP servers: Azure MCP Server, openstatus, SmartBear MCP, Fettle.
Does mcp-keycloak work with ChatGPT?
Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.
