Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

keycloak-model-context-protocol

MCP server by ChristophEnglisch Community

Manages Keycloak users, groups, roles and realms through the Keycloak Admin REST API. It lets an AI assistant such as Claude administer a Keycloak server, with guardrails around every write. Built for administrators who want least-privilege access.

  • Score 70
  • 48 stars
  • 153 a week
  • MIT
  • Updated

Install keycloak-model-context-protocol

Built from the published package, never by AI.

claude mcp add keycloak-model-context-protocol -e KEYCLOAK_URL=YOUR_KEYCLOAK_URL -- npx -y keycloak-model-context-protocol

Run in your terminal. Add --scope user to use it in every project.

Step-by-step: install keycloak-model-context-protocol in Claude Code

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 keycloak-model-context-protocol block.

About

Keycloak MCP Server is a Model Context Protocol server for Keycloak administration. It lets an AI assistant such as Claude manage users, groups, roles and sessions, and inspect clients, events and realm security, through the Keycloak Admin REST API. The server runs as a local child process of your MCP client and talks to it over stdio. It works with Claude Desktop, Claude Code, VS Code, Cursor and other stdio clients.

Authentication uses a client_credentials service account, with the password grant also available. Read-only mode, a realm allowlist, write protection for the master realm and a preview-then-confirm flow for changes act as guardrails. It suits administrators who want an assistant to handle Keycloak tasks with scoped permissions. Node.js 22 or newer is required.

Written from the project's README and checked against it.

Tools it gives your assistant

  • realm_listLists the realms the configured account can access.
  • user_searchSearches users in a realm.
  • user_getReturns the details of a single user.
  • user_createCreates a user. Sensitive, so it asks for confirmation.
  • user_updateUpdates a user's fields. Sensitive, so it asks for confirmation.
  • user_deleteDeletes a user. Destructive, so it asks for confirmation.
  • user_group_addAdds a user to a group. Sensitive, so it asks for confirmation.
  • user_role_assignAssigns a role to a user. Sensitive, so it asks for confirmation.
  • user_logoutEnds a user's sessions. Destructive, so it asks for confirmation.
  • user_brute_force_unlockUnlocks a user locked by brute-force protection. Sensitive.

What you need

  • Node.js 22 or newer
  • A Keycloak server the machine can reach (tested with Keycloak 24.0 to 26.8)
  • An MCP client such as Claude Desktop, Claude Code, VS Code or Cursor
  • A Keycloak client with service account roles from realm-management
SettingNeededWhat it is
KEYCLOAK_URLEnvironment variableRequiredBase URL of the Keycloak server, e.g. https://keycloak.example.com
KEYCLOAK_AUTH_REALMEnvironment variableOptionalRealm used to obtain the admin token Default: master
KEYCLOAK_CLIENT_IDEnvironment variableOptionalClient ID used for login (default admin-cli for the password grant, required for client_credentials)
KEYCLOAK_CLIENT_SECRETEnvironment variable, secretOptionalClient secret for the client_credentials grant (recommended: a dedicated service account)
KEYCLOAK_USERNAMEEnvironment variableOptionalUsername for the password grant (alternative to client credentials)
KEYCLOAK_PASSWORDEnvironment variable, secretOptionalPassword for the password grant
KEYCLOAK_GRANT_TYPEEnvironment variableOptionalGrant type; auto-detected if unset (client_credentials when a secret is set, else password)
KEYCLOAK_MCP_READ_ONLYEnvironment variableOptionalIf true, only read-only tools are registered Default: false
KEYCLOAK_MCP_REALMSEnvironment variableOptionalComma-separated allowlist of target realms; empty means all realms
KEYCLOAK_MCP_ALLOW_MASTER_WRITEEnvironment variableOptionalIf true, write tools may modify the master realm Default: false
KEYCLOAK_MCP_TOOLSETSEnvironment variableOptionalComma-separated enabled toolsets (core, groups, roles, clients, sessions, events, security) or all Default: core,groups,roles
KEYCLOAK_MCP_REQUIRE_CONFIRMATIONEnvironment variableOptionalIf true, destructive tools require confirm=true Default: true
KEYCLOAK_MCP_TIMEOUT_MSEnvironment variableOptionalHTTP timeout for Keycloak requests in milliseconds Default: 30000
KEYCLOAK_MCP_LOG_LEVELEnvironment variableOptionalLog level written to stderr Default: info

From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.

Try asking

  • List the realms I can access, then show the first 10 users of realm demo.
  • Show the groups and roles assigned to user jdoe in realm demo.
  • Run a read-only security audit of realm demo with prioritized findings.

Good to know

  • Acts with the permissions of the Keycloak account it is given.
  • Only the core, groups and roles toolsets are enabled by default.
  • Role and group grants and profile changes for the server's own account are refused.
  • Changes to users with administrative rights need confirmation that cannot be turned off.

Security check

A

No 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 keycloak-model-context-protocol

All alternatives →
Agentmesh MCP Proxy microsoft
94

Agentmesh MCP Proxy is a security proxy for MCP servers, described by its publisher as a firewall for the Model Context Protocol. It is aimed at teams that run AI agents which call tools and other agents.

AAA Local 6.6k
Bla qybaihe
94

Hardens client-side artifacts such as binaries, Electron apps, JS bundles, Python and WebAssembly against AI reverse-engineering agents. Built for developers who ship proprietary logic to user-controlled devices.

AAA Local 7.3k
Bla Agents qybaihe
94

Bla Agents is an MCP server and CLI that adds seeded, format-specific decoys to shipped binaries, JavaScript, WebAssembly and other artifacts. It is for developers who ship proprietary logic to user-controlled devices and want to make AI reverse-engineering slower.

AAA Local 11k/wk
MCP Auth zgeoff
94

A shared OAuth server for the MCP route of an app, built on better-auth, with passkey sign-in for the owner

AAC Local 44k/wk
Agentos MCP Server microsoft
94

Agent Governance Toolkit adds policy enforcement, identity, sandboxing and audit logging to autonomous AI agents. It is aimed at teams shipping agents to production. The source does not confirm the Claude Desktop MCP server named in the listing.

AAA Local 6.6k
Convex MCP Gateway tfohlmeister
93

Convex MCP Gateway is a Convex component that exposes selected Convex functions as MCP tools. It checks each call with your own authorize callback and writes an audit log. It is for developers who run Convex apps and want AI assistants to call parts of them.

AAC Local 37k/wk

Compare with Agentmesh MCP Proxy, Bla or Bla Agents

keycloak-model-context-protocol: common questions

Does it change Keycloak data without asking?

Tools that change data are destructive or sensitive. Called without confirm: true, they only return a preview and change nothing.

Can it run in read-only mode?

Yes. With KEYCLOAK_MCP_READ_ONLY enabled, only read tools are registered.

Should I use the Keycloak bootstrap admin account?

No. The source recommends a dedicated service-account client with only the roles you need, never the bootstrap admin.

How do I install keycloak-model-context-protocol?

In Claude Code run claude mcp add keycloak-model-context-protocol -e KEYCLOAK_URL=YOUR_KEYCLOAK_URL -- npx -y keycloak-model-context-protocol. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.

Is keycloak-model-context-protocol the official server?

keycloak-model-context-protocol is a community project by ChristophEnglisch, not verified by a company domain.

Is keycloak-model-context-protocol free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is keycloak-model-context-protocol safe to use?

It scores 70 of 100. Grades: maintenance B, 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 keycloak-model-context-protocol?

Similar MCP servers: Agentmesh MCP Proxy, Bla, Bla Agents, MCP Auth.

Does keycloak-model-context-protocol 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.

keycloak-model-context-protocol Install

Add to stack

Loading.