mcp-keycloak

v0.3.3
io.github.dockndevai/mcp-keycloak Checked 2 days ago Published 1 month ago

Keycloak admin for AI agents — realms, users, clients, roles; safe-by-default governance.

Values you need

VariableWhat it is
KEYCLOAK_URLrequired Base URL of the Keycloak server (no trailing slash).
KEYCLOAK_CLIENT_IDoptional Client id used to authenticate (default admin-cli).
KEYCLOAK_CLIENT_SECREToptional secret Service-account client secret (or use KEYCLOAK_USERNAME/PASSWORD).
KEYCLOAK_MODEoptional Access mode: read-only | read-write | admin.

npm (npx) discovery passed

Requires Node.js 18+

Run in a terminal
claude mcp add mcp-keycloak -e 'KEYCLOAK_URL=<KEYCLOAK_URL>' -- npx -y @dockndevai/mcp-keycloak@0.3.3
Add to claude_desktop_config.json
{
  "mcpServers": {
    "mcp-keycloak": {
      "args": [
        "-y",
        "@dockndevai/mcp-keycloak@0.3.3"
      ],
      "command": "npx",
      "env": {
        "KEYCLOAK_URL": "<KEYCLOAK_URL>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "mcp-keycloak": {
      "args": [
        "-y",
        "@dockndevai/mcp-keycloak@0.3.3"
      ],
      "command": "npx",
      "env": {
        "KEYCLOAK_URL": "<KEYCLOAK_URL>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "KEYCLOAK_URL",
      "id": "keycloak-url",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "mcp-keycloak": {
      "args": [
        "-y",
        "@dockndevai/mcp-keycloak@0.3.3"
      ],
      "command": "npx",
      "env": {
        "KEYCLOAK_URL": "${input:keycloak-url}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.mcp-keycloak]
command = "npx"
args = ["-y", "@dockndevai/mcp-keycloak@0.3.3"]
env = { "KEYCLOAK_URL" = "<KEYCLOAK_URL>" }

For AI agents

  1. Ask the user for: KEYCLOAK_URL. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: list_realms, get_realm, list_users, get_user, count_users, list_clients, list_realm_roles, list_groups.
  5. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json