Skip to main content
Glama
idoyudha

mcp-keycloak

by idoyudha

add_realm_default_group

Assign a default group to a Keycloak realm to automatically apply group settings to new users, simplifying user management and access control configuration.

Instructions

Add a default group to the realm.

Args:
    group_id: Group ID to add as default
    realm: Target realm (uses default if not specified)

Returns:
    Status message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
group_idYes
realmNo

Implementation Reference

  • The main handler function decorated with @mcp.tool(), which registers and implements the tool logic. It calls the Keycloak API to add a group as a default group for the realm.
    @mcp.tool()
    async def add_realm_default_group(
        group_id: str, realm: Optional[str] = None
    ) -> Dict[str, str]:
        """
        Add a default group to the realm.
    
        Args:
            group_id: Group ID to add as default
            realm: Target realm (uses default if not specified)
    
        Returns:
            Status message
        """
        await client._make_request("PUT", f"/default-groups/{group_id}", realm=realm)
        return {"status": "added", "message": f"Group {group_id} added as default group"}

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

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