Skip to content
Cursor

Keycloak Admin API for Cursor

io.github.sferarc/keycloak-api-mcp

Unofficial: one tool per Keycloak admin operation on a realm, read-only unless writes are enabled

client:Cursor transport:stdio runtime:npm

Install Keycloak Admin API in Cursor

~/.cursor/mcp.json · windows: %USERPROFILE%\.cursor\mcp.json

Held in this page only — never stored, logged, or sent anywhere but back to your screen.

{
  "mcpServers": {
    "keycloak-api-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "keycloak-api"
      ],
      "env": {
        "KEYCLOAK_URL": "<KEYCLOAK_URL>",
        "KEYCLOAK_REALM": "<KEYCLOAK_REALM>",
        "KEYCLOAK_TOKEN": "<KEYCLOAK_TOKEN>",
        "KEYCLOAK_CLIENT_ID": "<KEYCLOAK_CLIENT_ID>",
        "KEYCLOAK_CLIENT_SECRET": "<KEYCLOAK_CLIENT_SECRET>",
        "KEYCLOAK_TOKEN_REALM": "<KEYCLOAK_TOKEN_REALM>",
        "KEYCLOAK_MCP_ALLOW_WRITES": "<KEYCLOAK_MCP_ALLOW_WRITES>",
        "KEYCLOAK_MCP_RESOURCES": "<KEYCLOAK_MCP_RESOURCES>"
      }
    }
  }
}

Use .cursor/mcp.json in a project root instead to scope it to that project. Cursor merges both. Cursor docs

Keycloak Admin API in other clients