Skip to main content
Glama
Octodet

Advanced Keycloak MCP server

by Octodet

list-realms

Retrieve all available realms from the Keycloak server to manage authentication and authorization domains.

Instructions

List all available realms

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'list-realms': calls KeycloakService.listRealms() and returns formatted list of realms.
    case "list-realms": { const realms = await keycloakService.listRealms(); return { content: [ { type: "text", text: `Available realms:\n${realms .map((r) => `- ${r.realm}`) .join("\n")}`, }, ], };
  • KeycloakService method implementing the core logic to list realms after authentication.
    async listRealms() { await this.authenticate(); return await this.client.realms.find(); }
  • src/index.ts:377-385 (registration)
    Registers the 'list-realms' tool in the MCP server's listTools response with description and empty input schema.
    { name: "list-realms", description: "List all available realms", inputSchema: { type: "object", properties: {}, required: [], }, },

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/Octodet/keycloak-mcp'

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