Skip to content
VS Code

Keycloak Admin for VS Code

io.github.mrz1880/mcp-keycloak-admin

Administer Keycloak via its Admin REST API: users, roles, clients, groups, IdP, events.

client:VS Code transport:stdio runtime:npm

Install Keycloak Admin in VS Code

.vscode/mcp.json

{
  "inputs": [
    {
      "type": "promptString",
      "id": "keycloak-base-url",
      "description": "KEYCLOAK_BASE_URL",
      "password": true
    },
    {
      "type": "promptString",
      "id": "keycloak-realm",
      "description": "KEYCLOAK_REALM",
      "password": true
    },
    {
      "type": "promptString",
      "id": "auth-mode",
      "description": "AUTH_MODE",
      "password": true
    },
    {
      "type": "promptString",
      "id": "kc-client-id",
      "description": "KC_CLIENT_ID",
      "password": true
    },
    {
      "type": "promptString",
      "id": "kc-client-secret",
      "description": "KC_CLIENT_SECRET",
      "password": true
    },
    {
      "type": "promptString",
      "id": "kc-admin-username",
      "description": "KC_ADMIN_USERNAME",
      "password": true
    },
    {
      "type": "promptString",
      "id": "kc-admin-password",
      "description": "KC_ADMIN_PASSWORD",
      "password": true
    },
    {
      "type": "promptString",
      "id": "kc-admin-realm",
      "description": "KC_ADMIN_REALM",
      "password": true
    },
    {
      "type": "promptString",
      "id": "read-only",
      "description": "READ_ONLY",
      "password": true
    },
    {
      "type": "promptString",
      "id": "allowed-realms",
      "description": "ALLOWED_REALMS",
      "password": true
    }
  ],
  "servers": {
    "mcp-keycloak-admin": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-keycloak-admin"
      ],
      "env": {
        "KEYCLOAK_BASE_URL": "${input:keycloak-base-url}",
        "KEYCLOAK_REALM": "${input:keycloak-realm}",
        "AUTH_MODE": "${input:auth-mode}",
        "KC_CLIENT_ID": "${input:kc-client-id}",
        "KC_CLIENT_SECRET": "${input:kc-client-secret}",
        "KC_ADMIN_USERNAME": "${input:kc-admin-username}",
        "KC_ADMIN_PASSWORD": "${input:kc-admin-password}",
        "KC_ADMIN_REALM": "${input:kc-admin-realm}",
        "READ_ONLY": "${input:read-only}",
        "ALLOWED_REALMS": "${input:allowed-realms}"
      }
    }
  }
}

VS Code prompts for each input the first time the server starts, so no secret is written to the file. VS Code docs

Keycloak Admin in other clients