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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:523-534 (handler)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")}`, }, ], };
- src/index.ts:146-149 (helper)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: [], }, },