MCP directory
KM

Keycloak Model Context Protocol

by github.com/ChristophEnglisch · v1.1.0 · updated Oct 26, 2026

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

npm

Run it locally

Install the package and point your AI client at it.

Environment variables

  • KEYCLOAK_URLrequired

    Base URL of the Keycloak server, e.g. https://keycloak.example.com

  • KEYCLOAK_AUTH_REALM

    Realm used to obtain the admin token

  • KEYCLOAK_CLIENT_ID

    Client ID used for login (default admin-cli for the password grant, required for client_credentials)

  • KEYCLOAK_CLIENT_SECRETsecret

    Client secret for the client_credentials grant (recommended: a dedicated service account)

  • KEYCLOAK_USERNAME

    Username for the password grant (alternative to client credentials)

  • KEYCLOAK_PASSWORDsecret

    Password for the password grant

  • KEYCLOAK_GRANT_TYPE

    Grant type; auto-detected if unset (client_credentials when a secret is set, else password)

  • KEYCLOAK_MCP_READ_ONLY

    If true, only read-only tools are registered

  • KEYCLOAK_MCP_REALMS

    Comma-separated allowlist of target realms; empty means all realms

  • KEYCLOAK_MCP_ALLOW_MASTER_WRITE

    If true, write tools may modify the master realm

  • KEYCLOAK_MCP_TOOLSETS

    Comma-separated enabled toolsets (core, groups, roles, clients, sessions, events, security) or all

  • KEYCLOAK_MCP_REQUIRE_CONFIRMATION

    If true, destructive tools require confirm=true

  • KEYCLOAK_MCP_TIMEOUT_MS

    HTTP timeout for Keycloak requests in milliseconds

  • KEYCLOAK_MCP_LOG_LEVEL

    Log level written to stderr

More MCP servers