Keycloak Admin API
MCP server by sferarc Community
Unofficial: one tool per Keycloak admin operation on a realm, read-only unless writes are enabled
Install Keycloak Admin API
Built from the published package, never by AI.
claude mcp add keycloak-admin-api -e KEYCLOAK_URL=YOUR_KEYCLOAK_URL -e KEYCLOAK_REALM=YOUR_KEYCLOAK_REALM -- npx -y keycloak-apiRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"keycloak-admin-api": {
"command": "npx",
"args": [
"-y",
"keycloak-api"
],
"env": {
"KEYCLOAK_URL": "YOUR_KEYCLOAK_URL",
"KEYCLOAK_REALM": "YOUR_KEYCLOAK_REALM"
}
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"keycloak-admin-api": {
"command": "npx",
"args": [
"-y",
"keycloak-api"
],
"env": {
"KEYCLOAK_URL": "YOUR_KEYCLOAK_URL",
"KEYCLOAK_REALM": "YOUR_KEYCLOAK_REALM"
}
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"keycloak-admin-api": {
"command": "npx",
"args": [
"-y",
"keycloak-api"
],
"env": {
"KEYCLOAK_URL": "YOUR_KEYCLOAK_URL",
"KEYCLOAK_REALM": "YOUR_KEYCLOAK_REALM"
}
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add keycloak-admin-api --env KEYCLOAK_URL=YOUR_KEYCLOAK_URL --env KEYCLOAK_REALM=YOUR_KEYCLOAK_REALM -- npx -y keycloak-api{
"mcpServers": {
"keycloak-admin-api": {
"command": "npx",
"args": [
"-y",
"keycloak-api"
],
"env": {
"KEYCLOAK_URL": "YOUR_KEYCLOAK_URL",
"KEYCLOAK_REALM": "YOUR_KEYCLOAK_REALM"
}
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add keycloak-admin-api npx -y keycloak-apiGemini 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 keycloak-admin-api block.
What you need
| Setting | Needed | What it is |
|---|---|---|
KEYCLOAK_Environment variable | Required | Base URL of the server, such as https://keycloak.example.com |
KEYCLOAK_Environment variable | Required | Realm the tools act on |
KEYCLOAK_Environment variable, secret | Optional | A fixed access token; otherwise set KEYCLOAK_CLIENT_ID and KEYCLOAK_CLIENT_SECRET |
KEYCLOAK_Environment variable | Optional | A confidential client with a service account, for the client credentials grant |
KEYCLOAK_Environment variable, secret | Optional | Secret of that client |
KEYCLOAK_Environment variable | Optional | Realm of that client, if not KEYCLOAK_REALM (for example master) |
KEYCLOAK_Environment variable | Optional | 1 to list the tools that change data |
KEYCLOAK_Environment variable | Optional | Comma separated resources to list tools for, such as users,groups,roles |
From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.
Alternatives to Keycloak Admin API
All alternatives →Medplum is a developer platform for building healthcare apps, with a FHIR-based API and a repository for healthcare data. The source is the README for its main code repository, not a description of an MCP server.
Describes Puter, an open-source, self-hostable internet computer with office, AI builder and developer tools. The source does not document an MCP server or list its tools, so this listing could not be verified from the text.
Microsoft Fabric MCP Server is an MCP server for interacting with Microsoft Fabric. Its source, README, changelog and troubleshooting guide are in the microsoft/mcp repository. The source does not list its individual tools.
Template MCP server example.
Business Contact Finder is listed as an MCP server from modelcontextprotocol. The source provided is the MCP Registry README, which does not describe this server's tools, setup or behavior.
The source provided is the README for the MCP Registry, not code for a contractor licence tool. It does not describe a Contractor Licence Changes server, so this listing cannot be confirmed from the text.
Compare with Medplum, mcp-server or Microsoft Fabric MCP Server
Keycloak Admin API: common questions
How do I install Keycloak Admin API?
In Claude Code run claude mcp add keycloak-admin-api -e KEYCLOAK_URL=YOUR_KEYCLOAK_URL -e KEYCLOAK_REALM=YOUR_KEYCLOAK_REALM -- npx -y keycloak-api. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is Keycloak Admin API the official server?
Keycloak Admin API is a community project by sferarc, not verified by a company domain.
Is Keycloak Admin API free?
The code is published under the ISC licence. The service it connects to may have its own pricing.
Is Keycloak Admin API safe to use?
It scores 30 of 100. Grades: maintenance A, licence A, quality C. The security check has not run for it yet. Review the code before you install. How grades work.
What are alternatives to Keycloak Admin API?
Similar MCP servers: Medplum, mcp-server, Microsoft Fabric MCP Server, Template MCP Server.
Does Keycloak Admin API 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.
