list_realms
List realms
List all realms visible to the configured credentials. Realms outside the allowlist are filtered out.
无需输入参数。

io.github.dockndevai由 GitHub 账号 dockndevai 发布v0.3.3更新于 Oct 26, 2026
Keycloak admin for AI agents — realms, users, clients, roles; safe-by-default governance.
Keycloak 管理 MCP 服务器,让助手查看领域、用户、客户端、角色和组,默认只读并带多层安全开关。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
参照 仓库 中的启动说明。
A Model Context Protocol server for Keycloak. It lets an MCP-capable client (Claude Desktop, Claude Code, etc.) inspect and manage Keycloak realms, users, clients, roles, and groups — with security controlled entirely by flags.
The design goal is safe by default: it starts read-only, scopes to an allowlist of realms, protects sensitive realms from mutation, and gates destructive operations behind an explicit opt-in.
realm argument; scope it with an allowlist.read-only → read-write → admin, layered so a mode never exposes tools above its level.These layers are independent — for example admin mode with KEYCLOAK_ALLOW_DELETE=false can create and update users but cannot delete them.
Read (read-only+): list_realms, get_realm, list_users, get_user, count_users, list_clients, list_realm_roles, list_groups
Write (read-write+): create_user, update_user, reset_password, logout_user
Admin (admin): delete_user
Published on npm as @dockndevai/mcp-keycloak. No clone or build needed — your MCP client runs it on demand with npx. Start in read-only mode; see .env.example for every variable and docs/CLIENTS.md for the full per-client guide.
Claude Code (CLI)
Claude Desktop · Cursor · Windsurf — same block in claude_desktop_config.json, .cursor/mcp.json, or ~/.codeium/windsurf/mcp_config.json:
OpenAI Codex CLI — in ~/.codex/config.toml:
VS Code (GitHub Copilot, Agent mode) — in .vscode/mcp.json:
Copy .env.example and fill it in, or set the variables directly in your MCP client config. A confidential client with the realm-management roles you need is the recommended credential.
Prefer the published package above. To run from a clone:
This server ships a server.json for the official MCP registry and an mcpName for npm ownership validation. See PUBLISHING.md for publishing to npm and listing on the MCP registry, Smithery, Glama, Cursor, and PulseMCP.
MIT
来源:README.md,提交 c2481a2
List realms
List all realms visible to the configured credentials. Realms outside the allowlist are filtered out.
无需输入参数。
Get realm settings
Fetch the configuration of a single realm.
realm必填List / search users
List users in a realm. Supports free-text search and pagination. Passwords and secrets are never returned by Keycloak.
maxfirstrealm必填searchGet user by id
Fetch a single user representation by their Keycloak id.
realm必填userId必填Count users
Return the number of users in a realm, optionally matching a search term.
realm必填searchList clients
List OAuth/OIDC clients configured in a realm. Client secrets are not included.
realm必填clientIdList realm roles
List the realm-level roles defined in a realm.
realm必填List groups
List groups in a realm.
realm必填search已满足适用检查项的 90%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
claude mcp add keycloak -e KEYCLOAK_URL="https://keycloak.example.com" -e KEYCLOAK_CLIENT_ID="admin-cli" -e KEYCLOAK_CLIENT_SECRET="your-secret" -e KEYCLOAK_MODE="read-only" -- npx -y @dockndevai/mcp-keycloak{ "mcpServers": { "keycloak": { "command": "npx", "args": [ "-y", "@dockndevai/mcp-keycloak" ], "env": { "KEYCLOAK_URL": "https://keycloak.example.com", "KEYCLOAK_CLIENT_ID": "admin-cli", "KEYCLOAK_CLIENT_SECRET": "your-secret", "KEYCLOAK_MODE": "read-only" } } }}[mcp_servers.keycloak]command = "npx"args = ["-y", "@dockndevai/mcp-keycloak"]env = { KEYCLOAK_URL = "https://keycloak.example.com", KEYCLOAK_CLIENT_ID = "admin-cli", KEYCLOAK_CLIENT_SECRET = "your-secret", KEYCLOAK_MODE = "read-only" }{ "servers": { "keycloak": { "type": "stdio", "command": "npx", "args": [ "-y", "@dockndevai/mcp-keycloak" ], "env": { "KEYCLOAK_URL": "https://keycloak.example.com", "KEYCLOAK_CLIENT_ID": "admin-cli", "KEYCLOAK_CLIENT_SECRET": "your-secret", "KEYCLOAK_MODE": "read-only" } } }}npm installnpm run buildnode dist/index.js # with the environment variables setnpm run dev # watch modenpm test # unit tests for the security policynpm run typecheck