Skip to main content
Glama
HaithamOumerzoug

Keycloak MCP Server

list-realms

Retrieve all available realms in Keycloak MCP Server to manage user access, roles, and groups efficiently.

Instructions

List all available realms

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that executes the tool logic by fetching all realms from Keycloak admin client and formatting them into a list.
    public async listRealms(): Promise<string> { const realms: RealmRepresentation[] = await this.kcAdminClient.realms.find(); return `Available realms:\n${realms .map((r) => `- ${r.realm} (${r.id})`) .join("\n")}`; }
  • Input schema definition for the list-realms tool, specifying no required properties.
    "list-realms": { type: "object", properties: {}, required: [], },
  • src/server.ts:47-50 (registration)
    Registers the list-realms tool in the ListTools response, providing name, description, and input schema reference.
    name: "list-realms", description: "List all available realms", inputSchema: InputSchema["list-realms"], },
  • Server-side handler case that dispatches the list-realms tool call to the KeycloakService.
    case "list-realms": return { content: [ { type: "text", text: await keycloakService.listRealms() }, ], };

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HaithamOumerzoug/keycloak-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server