原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。评价和账户功能将在后续阶段推出。
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

Keycloak Model Context Protocol

作者:ChristophEnglisch版本 1.1.0i★ –i在你的电脑上运行
注册名称io.github.ChristophEnglisch/keycloak-model-context-protocol

安装

概览

作者提供的说明(英文原文)

Manage Keycloak users, groups, roles and realms through the Keycloak Admin REST API.

PopNx MCP 的三大支柱

这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。

它能帮你做什么

我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。

  • 连接方式: 在你的电脑上运行
  • 传输方式: stdio
  • 分类: 其他
  • 你需要填写:KEYCLOAK_URL, KEYCLOAK_CLIENT_SECRET, KEYCLOAK_PASSWORD

安装

选择你使用的 AI 应用,然后复制设置。

安装之前

  • 基础检查:1 项中通过 1 项
  • 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
  • 需要你自己填写: KEYCLOAK_URL, KEYCLOAK_AUTH_REALM, KEYCLOAK_CLIENT_ID, KEYCLOAK_CLIENT_SECRET, KEYCLOAK_USERNAME, KEYCLOAK_PASSWORD, KEYCLOAK_GRANT_TYPE, KEYCLOAK_MCP_READ_ONLY, KEYCLOAK_MCP_REALMS, KEYCLOAK_MCP_ALLOW_MASTER_WRITE, KEYCLOAK_MCP_TOOLSETS, KEYCLOAK_MCP_REQUIRE_CONFIRMATION, KEYCLOAK_MCP_TIMEOUT_MS, KEYCLOAK_MCP_LOG_LEVEL

标为机密的值是你账户的钥匙。千万不要分享给别人,也不要粘贴到聊天里。

你需要

  • npm已安装 Node.js(用于 npx 命令)

你用的是哪个应用?

在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。

打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json

{
  "mcpServers": {
    "keycloak-model-context-protocol": {
      "command": "npx",
      "args": [
        "-y",
        "keycloak-model-context-protocol"
      ],
      "env": {
        "KEYCLOAK_URL": "your-value",
        "KEYCLOAK_AUTH_REALM": "your-value",
        "KEYCLOAK_CLIENT_ID": "your-value",
        "KEYCLOAK_CLIENT_SECRET": "your-value",
        "KEYCLOAK_USERNAME": "your-value",
        "KEYCLOAK_PASSWORD": "your-value",
        "KEYCLOAK_GRANT_TYPE": "your-value",
        "KEYCLOAK_MCP_READ_ONLY": "your-value",
        "KEYCLOAK_MCP_REALMS": "your-value",
        "KEYCLOAK_MCP_ALLOW_MASTER_WRITE": "your-value",
        "KEYCLOAK_MCP_TOOLSETS": "your-value",
        "KEYCLOAK_MCP_REQUIRE_CONFIRMATION": "your-value",
        "KEYCLOAK_MCP_TIMEOUT_MS": "your-value",
        "KEYCLOAK_MCP_LOG_LEVEL": "your-value"
      }
    }
  }
}

在终端中运行这条命令

claude mcp add keycloak-model-context-protocol --env KEYCLOAK_URL=your-value --env KEYCLOAK_AUTH_REALM=your-value --env KEYCLOAK_CLIENT_ID=your-value --env KEYCLOAK_CLIENT_SECRET=your-value --env KEYCLOAK_USERNAME=your-value --env KEYCLOAK_PASSWORD=your-value --env KEYCLOAK_GRANT_TYPE=your-value --env KEYCLOAK_MCP_READ_ONLY=your-value --env KEYCLOAK_MCP_REALMS=your-value --env KEYCLOAK_MCP_ALLOW_MASTER_WRITE=your-value --env KEYCLOAK_MCP_TOOLSETS=your-value --env KEYCLOAK_MCP_REQUIRE_CONFIRMATION=your-value --env KEYCLOAK_MCP_TIMEOUT_MS=your-value --env KEYCLOAK_MCP_LOG_LEVEL=your-value -- npx -y keycloak-model-context-protocol

运行前请先填写空着的值。

在 Cursor 中打开

或者自己复制设置

粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json

{
  "mcpServers": {
    "keycloak-model-context-protocol": {
      "command": "npx",
      "args": [
        "-y",
        "keycloak-model-context-protocol"
      ],
      "env": {
        "KEYCLOAK_URL": "your-value",
        "KEYCLOAK_AUTH_REALM": "your-value",
        "KEYCLOAK_CLIENT_ID": "your-value",
        "KEYCLOAK_CLIENT_SECRET": "your-value",
        "KEYCLOAK_USERNAME": "your-value",
        "KEYCLOAK_PASSWORD": "your-value",
        "KEYCLOAK_GRANT_TYPE": "your-value",
        "KEYCLOAK_MCP_READ_ONLY": "your-value",
        "KEYCLOAK_MCP_REALMS": "your-value",
        "KEYCLOAK_MCP_ALLOW_MASTER_WRITE": "your-value",
        "KEYCLOAK_MCP_TOOLSETS": "your-value",
        "KEYCLOAK_MCP_REQUIRE_CONFIRMATION": "your-value",
        "KEYCLOAK_MCP_TIMEOUT_MS": "your-value",
        "KEYCLOAK_MCP_LOG_LEVEL": "your-value"
      }
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

在 VS Code 中打开

或者自己复制设置

粘贴到项目中的 .vscode/mcp.json

{
  "servers": {
    "keycloak-model-context-protocol": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "keycloak-model-context-protocol"
      ],
      "env": {
        "KEYCLOAK_URL": "your-value",
        "KEYCLOAK_AUTH_REALM": "your-value",
        "KEYCLOAK_CLIENT_ID": "your-value",
        "KEYCLOAK_CLIENT_SECRET": "your-value",
        "KEYCLOAK_USERNAME": "your-value",
        "KEYCLOAK_PASSWORD": "your-value",
        "KEYCLOAK_GRANT_TYPE": "your-value",
        "KEYCLOAK_MCP_READ_ONLY": "your-value",
        "KEYCLOAK_MCP_REALMS": "your-value",
        "KEYCLOAK_MCP_ALLOW_MASTER_WRITE": "your-value",
        "KEYCLOAK_MCP_TOOLSETS": "your-value",
        "KEYCLOAK_MCP_REQUIRE_CONFIRMATION": "your-value",
        "KEYCLOAK_MCP_TIMEOUT_MS": "your-value",
        "KEYCLOAK_MCP_LOG_LEVEL": "your-value"
      }
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。

你的选择通过 Cookie 保存在这台设备上,无需账户。

需要你填写的值

  • KEYCLOAK_URL 必填 env
    Base URL of the Keycloak server, e.g. https://keycloak.example.com
  • KEYCLOAK_AUTH_REALM env
    Realm used to obtain the admin token
  • KEYCLOAK_CLIENT_ID env
    Client ID used for login (default admin-cli for the password grant, required for client_credentials)
  • KEYCLOAK_CLIENT_SECRET 机密 env
    Client secret for the client_credentials grant (recommended: a dedicated service account)
  • KEYCLOAK_USERNAME env
    Username for the password grant (alternative to client credentials)
  • KEYCLOAK_PASSWORD 机密 env
    Password for the password grant
  • KEYCLOAK_GRANT_TYPE env
    Grant type; auto-detected if unset (client_credentials when a secret is set, else password)
  • KEYCLOAK_MCP_READ_ONLY env
    If true, only read-only tools are registered
  • KEYCLOAK_MCP_REALMS env
    Comma-separated allowlist of target realms; empty means all realms
  • KEYCLOAK_MCP_ALLOW_MASTER_WRITE env
    If true, write tools may modify the master realm
  • KEYCLOAK_MCP_TOOLSETS env
    Comma-separated enabled toolsets (core, groups, roles, clients, sessions, events, security) or all
  • KEYCLOAK_MCP_REQUIRE_CONFIRMATION env
    If true, destructive tools require confirm=true
  • KEYCLOAK_MCP_TIMEOUT_MS env
    HTTP timeout for Keycloak requests in milliseconds
  • KEYCLOAK_MCP_LOG_LEVEL env
    Log level written to stderr

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月8日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 ChristophEnglisch 验证,该账户拥有此仓库

  • … 尚未检查

    仍在维护

    我们还没有从 GitHub 读取这个仓库

  • … 尚未检查

    有许可证

    我们还没有从 GitHub 读取这个仓库

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

与“其他”中的其他服务器比较i

  • 星标数多于此分类中其他 18474 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 18474 个服务器的 76% 更新
  • 基础检查结果等于或优于此分类中其他 18474 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

Keycloak Model Context Protocol 安全吗?

它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

你需要填写:KEYCLOAK_URL, KEYCLOAK_CLIENT_SECRET, KEYCLOAK_PASSWORD

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于–,最新版本(1.1.0)于12天前进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。

有什么可以替代它?

同一分类中有:Spec Driven Development, Remote Desktop Commander, Thalovant MCP

替代选择

同一分类中其他作者的服务器,按星标数排序。

如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

Spec Driven Development

MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.

作者:formulahendry起步阶段↓ 66/周★ 44014个月前更新

在你的电脑上运行

Remote Desktop Commander

Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.

作者:desktop-commander正在增长★ 2113天前更新

在云端运行✓ desktopcommander.app

Thalovant MCP

Connect MCP clients to Thalovant control-plane and hub runtime APIs over stdio or Streamable HTTP.

作者:thalovant起步阶段↓ 455/周今天更新

在你的电脑上运行

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

Keycloak MCP Server

A Model Context Protocol (MCP) server for Keycloak administration. It lets an AI assistant such as Claude manage users, groups, roles and sessions, and inspect clients, events and the security posture of your realms, through the Keycloak Admin REST API, with least-privilege authentication and guardrails around every write.

[!WARNING]

This server acts with the permissions of the Keycloak account you give it. Use a dedicated service-account client with only the roles you need, never the bootstrap admin. Every tool that changes data asks for confirmation by default, and a read-only mode is available. See Security.

Highlights

  • 24 tools in 7 toolsets, enabled per toolset. The default set (core, groups, roles) is small; everything else is opt-in.
  • Least-privilege auth. client_credentials with a service account is the recommended grant; the password grant stays available. No credential defaults, so a missing setting fails fast.
  • Guardrails. Read-only mode, realm allowlist, write protection for the master realm, and a preview-then-confirm: true flow for every change. Grants of administrative rights are detected through composite roles and parent groups.
  • 4 guided prompts (onboarding, offboarding, security audit, failed-login investigation) and MCP resources for realms and users, with realm-name completion.
  • Structured, paginated output with output schemas; secrets and credentials are never returned or logged.
  • Works with Claude Desktop, Claude Code, VS Code, Cursor and any stdio MCP client. Requires Node.js 22 or newer.

How it works

Your MCP client starts the server as a local child process and talks to it over stdio. Every tool call passes the guards, then goes through a single gateway that owns the Keycloak login and caches the access token.

What a confirmed call looks like

Every tool that changes data is _destructive_ (it deletes or revokes) or _sensitive_ (it changes identity, credentials, rights or protection mechanisms, for example user_update or user_role_assign). Called without confirm: true, such a tool only returns a preview of what would happen and changes nothing. After you approve, the assistant repeats the call with confirm: true.

The model can set confirm: true itself, even on its first call. The server then still computes the preview and returns it with the result, but only your client's approval prompt proves that a human agreed. All these tools carry destructiveHint, so clients that ask before destructive calls ask here too.

Quick start

Requirements: Node.js 22 or newer, a Keycloak server your machine can reach (tested with Keycloak 24.0 to 26.8), and an MCP client.

1. Prepare Keycloak (3 steps)

In the realm you want to administer (here demo):

  1. Create a client mcp-admin with _Client authentication_ on and only _Service accounts roles_ enabled (turn off _Standard flow_ and _Direct access grants_).
  2. Assign roles. On the client's _Service accounts roles_ tab, assign client roles of realm-management. For a first read-only trial: view-users, query-users, query-groups, view-realm.
  3. Copy the secret from the client's _Credentials_ tab.

Step-by-step instructions with Admin Console click paths, kcadm.sh commands and a local Docker Keycloak: docs/getting-started.md.

2. Configure your MCP client

Example for Claude Code (other clients: docs/clients.md):

claude mcp add --transport stdio \

--env KEYCLOAK_URL=https://keycloak.example.com \ --env KEYCLOAK_AUTH_REALM=demo \ --env KEYCLOAK_CLIENT_ID=mcp-admin \ --env KEYCLOAK_CLIENT_SECRET="$KEYCLOAK_CLIENT_SECRET" \ keycloak -- npx -y keycloak-model-context-protocol@1

Or as JSON (Claude Desktop, claude_desktop_config.json):

{

"mcpServers": { "keycloak": { "command": "npx", "args": ["-y", "keycloak-model-context-protocol@1"], "env": { "KEYCLOAK_URL": "https://keycloak.example.com", "KEYCLOAK_AUTH_REALM": "demo", "KEYCLOAK_CLIENT_ID": "mcp-admin", "KEYCLOAK_CLIENT_SECRET": " " } } } }

3. Ask your first question

_List the realms you can access, then show me the first 10 users of realm demo._

If you get an answer, you are done. If not, see docs/troubleshooting.md.

Configuration

All settings are environment variables. Only KEYCLOAK_URL and one set of credentials are required.

VariableDefaultPurpose
KEYCLOAK_URL(required)Base URL of the Keycloak server
KEYCLOAK_AUTH_REALMmasterRealm where the login account or client lives
KEYCLOAK_CLIENT_ID / KEYCLOAK_CLIENT_SECRETnoneclient_credentials login (recommended)
KEYCLOAK_USERNAME / KEYCLOAK_PASSWORDnonePassword grant login (client defaults to admin-cli)
KEYCLOAK_GRANT_TYPEautoclient_credentials or password; detected from what you set
KEYCLOAK_MCP_TOOLSETScore,groups,rolesEnabled toolsets, or all
KEYCLOAK_MCP_READ_ONLYfalseRegister read-only tools only
KEYCLOAK_MCP_REALMSallComma-separated allowlist of target realms
KEYCLOAK_MCP_ALLOW_MASTER_WRITEfalseAllow write tools in the master realm
KEYCLOAK_MCP_REQUIRE_CONFIRMATIONtrueDestructive and sensitive tools need confirm: true
KEYCLOAK_MCP_TIMEOUT_MS30000HTTP timeout for Keycloak requests
KEYCLOAK_MCP_LOG_LEVELinfodebug, info, warn or error (stderr)

Full reference with examples, validation rules and the tool-to-role matrix: docs/configuration.md.

Toolsets and tools

Tools are named _ . Only the default toolsets are enabled unless you set KEYCLOAK_MCP_TOOLSETS. In read-only mode only tools of kind _read_ are registered.

ToolsetDefaultTools
coreyesrealm_list, realm_get, user_search, user_get, user_create (sensitive), user_update (sensitive), user_delete (destructive), user_send_actions_email (sensitive)
groupsyesgroup_list, group_members_list, user_group_add (sensitive), user_group_remove (destructive)
rolesyesrole_list, user_roles_list, user_role_assign (sensitive), user_role_revoke (destructive)
clientsnoclient_list, client_get
sessionsnouser_sessions_list, user_logout (destructive)
eventsnoevent_list, admin_event_list
securitynouser_brute_force_status, user_brute_force_unlock (sensitive)

Details for every tool (parameters, outputs, required roles): docs/tools-reference.md.

Prompts and resources

Prompts are guided workflows built on the tools. They appear in your client's prompt picker (in Claude Code as slash commands). The realm argument autocompletes.

PromptWhat it does
onboard_employeeCreate a user, add groups and roles, send the welcome e-mail
offboard_employeeReview, end sessions and disable a departing employee's account (does not delete)
audit_realm_securityRead-only security review with prioritized findings
investigate_failed_loginsAnalyze failed logins and lockout status without changing anything

Resources are read-only JSON documents, filtered by the same realm allowlist:

URIContent
keycloak://realmsNames of accessible realms
keycloak://realms/{realm}Safe subset of the realm settings
keycloak://realms/{realm}/security-summaryBrute-force, password policy, SSL, OTP, event flags, client exposure counts (no secrets)
keycloak://realms/{realm}/users/{userId}One user's basic fields (no attributes, no credentials)

Security

  • Least privilege first. Use a service-account client scoped to one realm with only the realm-management roles you need. A role matrix is in docs/configuration.md.
  • Every change needs confirmation (KEYCLOAK_MCP_REQUIRE_CONFIRMATION=true): destructive and sensitive tools show a preview firs

只显示了开头部分;其余内容请在仓库中阅读

问 PopNx