Keycloak · Capability

Keycloak Admin REST API — Realms

Keycloak Admin REST API — Realms. 4 operations. Lead operation: Keycloak List all realms. Self-contained Naftiko capability covering one Keycloak business surface.

Run with Naftiko KeycloakRealms

What You Can Do

GET
Getrealms — Keycloak List all realms
/v1
GET
Getrealm — Keycloak Get a realm
/v1/{realm}
PUT
Updaterealm — Keycloak Update a realm
/v1/{realm}
DELETE
Deleterealm — Keycloak Delete a realm
/v1/{realm}

MCP Tools

keycloak-list-all-realms

Keycloak List all realms

read-only idempotent
keycloak-get-realm

Keycloak Get a realm

read-only idempotent
keycloak-update-realm

Keycloak Update a realm

idempotent
keycloak-delete-realm

Keycloak Delete a realm

idempotent

Capability Spec

admin-rest-realms.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Keycloak Admin REST API — Realms
  description: 'Keycloak Admin REST API — Realms. 4 operations. Lead operation: Keycloak List all realms. Self-contained Naftiko
    capability covering one Keycloak business surface.'
  tags:
  - Keycloak
  - Realms
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    KEYCLOAK_API_KEY: KEYCLOAK_API_KEY
capability:
  consumes:
  - type: http
    namespace: admin-rest-realms
    baseUri: https://{host}/admin/realms
    description: Keycloak Admin REST API — Realms business capability. Self-contained, no shared references.
    resources:
    - name: root
      path: /
      operations:
      - name: getrealms
        method: GET
        description: Keycloak List all realms
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: briefRepresentation
          in: query
          type: boolean
    - name: realm
      path: /{realm}
      operations:
      - name: getrealm
        method: GET
        description: Keycloak Get a realm
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: updaterealm
        method: PUT
        description: Keycloak Update a realm
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: deleterealm
        method: DELETE
        description: Keycloak Delete a realm
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    authentication:
      type: bearer
      token: '{{env.KEYCLOAK_API_KEY}}'
  exposes:
  - type: rest
    namespace: admin-rest-realms-rest
    port: 8080
    description: REST adapter for Keycloak Admin REST API — Realms. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1
      name: root
      description: REST surface for root.
      operations:
      - method: GET
        name: getrealms
        description: Keycloak List all realms
        call: admin-rest-realms.getrealms
        with:
          briefRepresentation: rest.briefRepresentation
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/{realm}
      name: realm
      description: REST surface for realm.
      operations:
      - method: GET
        name: getrealm
        description: Keycloak Get a realm
        call: admin-rest-realms.getrealm
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: updaterealm
        description: Keycloak Update a realm
        call: admin-rest-realms.updaterealm
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deleterealm
        description: Keycloak Delete a realm
        call: admin-rest-realms.deleterealm
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: admin-rest-realms-mcp
    port: 9090
    transport: http
    description: MCP adapter for Keycloak Admin REST API — Realms. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: keycloak-list-all-realms
      description: Keycloak List all realms
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: admin-rest-realms.getrealms
      with:
        briefRepresentation: tools.briefRepresentation
      outputParameters:
      - type: object
        mapping: $.
    - name: keycloak-get-realm
      description: Keycloak Get a realm
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: admin-rest-realms.getrealm
      outputParameters:
      - type: object
        mapping: $.
    - name: keycloak-update-realm
      description: Keycloak Update a realm
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: admin-rest-realms.updaterealm
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: keycloak-delete-realm
      description: Keycloak Delete a realm
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: admin-rest-realms.deleterealm
      outputParameters:
      - type: object
        mapping: $.