Skip to main content

Keycloak Model Context Protocol

io.github.ChristophEnglisch/keycloak-model-context-protocol

v1.1.0Updated Oct 26, 2026stdio · npm

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

Install

Replace 1 placeholder with your own values.

Run in your terminal. Replace 1 placeholder.

claude mcp add keycloak-model-context-protocol -e 'KEYCLOAK_URL=<your-keycloak-url>' -e KEYCLOAK_AUTH_REALM=master -e KEYCLOAK_MCP_READ_ONLY=false -e KEYCLOAK_MCP_ALLOW_MASTER_WRITE=false -e KEYCLOAK_MCP_TOOLSETS=core,groups,roles -e KEYCLOAK_MCP_REQUIRE_CONFIRMATION=true -e KEYCLOAK_MCP_TIMEOUT_MS=30000 -e KEYCLOAK_MCP_LOG_LEVEL=info -- npx -y [email protected]

Configuration

14 settings.

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

Listed in the official MCP Registry since Oct 26, 2026. Mirrored daily; last checked Nov 26, 2026.