
Keycloak Admin
io.github.mrz1880由 GitHub 帳號 mrz1880 發布v0.2.3更新於 Oct 24, 2026
Administer Keycloak via its Admin REST API: users, roles, clients, groups, IdP, events.
概覽
本機 MCP 伺服器,讓助理透過 Keycloak Admin REST API 管理 Keycloak 26.x 領域中的使用者、角色、用戶端、群組、身分提供者與事件。
- 可以做什麼
- 搜尋、讀取、建立、更新、啟用或停用、刪除領域使用者,查看工作階段、寄送操作郵件、重設密碼與登出工作階段
- 列出、指派與撤銷使用者及群組的領域角色與用戶端角色
- 列出、建立、更新與刪除用戶端,讀取或重新產生用戶端密鑰,管理預設範圍與通訊協定對應器
- 列出、建立與刪除群組,新增或移除成員,為群組授予角色
- 列出、建立與刪除身分提供者及其對應器,列出使用者聯合提供者並觸發同步
- 讀取驗證流程、必要動作、授權資源、原則與權限、登入與管理員事件、領域設定與伺服器版本
- 適用情境
- 適合讓助理或 IDE 代理執行日常 Keycloak 維運——查詢使用者、管理角色、用戶端與群組、讀取事件——而不必交出原始管理主控台。特別適合希望在這些操作外加上唯讀模式與領域允許清單等防護的團隊。
- 執行需求
- 需要 Node.js 20 以上版本,以及可連線的 Keycloak 26.x 伺服器。必要環境變數:KEYCLOAK_BASE_URL、KEYCLOAK_REALM 與 AUTH_MODE。service_account 模式需 KC_CLIENT_ID 與 KC_CLIENT_SECRET;password 模式需 KC_ADMIN_USERNAME 與 KC_ADMIN_PASSWORD,可選 KC_ADMIN_REALM。另有選用的 READ_ONLY 與 ALLOWED_REALMS。以 stdio 在本機執行,通常透過 npx 啟動。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Keycloak Admin,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mcp-keycloak-admin
[npm version] [CI] [CodeQL] [License: MIT]
A Model Context Protocol (MCP) server to administer a Keycloak instance through its Admin REST API. Safe by default, configurable, and built with a clean, test-driven architecture.
Compatible with Keycloak 26.x (validated against 26.0.5).
Install
No install needed — run it straight from npm with npx:
The server speaks MCP over stdio, so you normally wire it into an MCP client rather than running it by hand — see Usage with an MCP client. New to it? The Quickstart spins up a local Keycloak and a client config in a couple of minutes.
Why
Administering Keycloak from an MCP client (an assistant, an IDE, a custom agent) means exposing day-to-day operations — searching users, managing roles, reading events — as MCP tools, without handing over a raw admin console. This server does that with strong guardrails so destructive actions never happen silently.
Features
- Two authentication modes, selectable by configuration:
service_account— a confidential client with a service account (recommended; no admin password stored).password— theadmin-cliclient with an admin username/password.
- Safe by default:
READ_ONLYmode hides every write/destructive tool.ALLOWED_REALMSrestricts which realms the server may operate on.- Destructive operations require explicit confirmation (native MCP
elicitation, with a
confirm: trueparameter fallback for clients that do not support elicitation).
- Clean Architecture: a framework-free domain, application use cases, and infrastructure adapters. No business concept travels as a raw string or number — every one is a validated value object.
Requirements
- Node.js >= 20
- A reachable Keycloak 26.x server
Usage with an MCP client
Add the server to your MCP client configuration:
See docs/setup-keycloak.md to create the mcp-admin
client and grant it the least-privilege roles it needs.
Multiple Keycloak instances
Each server entry targets one Keycloak (one base URL + realm + auth). To manage several environments, add one entry per instance — each fully isolated, with its own credentials and guardrails:
The client namespaces the tools per server (e.g. kc-prod:keycloak_user_delete),
so there's no risk of running an operation against the wrong environment. This
is the recommended pattern: you can, for example, keep production READ_ONLY
while preprod stays writable.
Configuration
A full example lives in .env.example.
Tools
Levels: [R] read-only · [W] write · [D] destructive (requires
confirmation). Every tool carries the matching MCP annotations
(readOnlyHint / destructiveHint / idempotentHint).
Currently implemented:
Note: this table tracks the
mainbranch, which can run ahead of the latest npm release shown by the version badge above. To confirm what's available in your install, checknpm view mcp-keycloak-admin versionand pinmcp-keycloak-admin@latest.
See docs/users.md, docs/roles.md, docs/clients.md, docs/groups.md and docs/events-realm.md for parameters and examples, and docs/security.md for the safety model.
Roadmap
The architecture is designed to keep growing as thin use cases + tools. Remaining candidates: authorization policy/permission CRUD and evaluation, authentication flow mutation (copy/add executions), and advanced federation and identity-provider configuration. See docs/development.md for how to add one.
Development
Releases are automated — see docs/releasing.md.
Contributing
Contributions are welcome — please read CONTRIBUTING.md.
License
來源:README.md,提交 8f97751
工具
0版本歷史
1- v0.2.3最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分