Skip to main content
Glama

remove_all_user_sessions

Terminate all active user sessions in a Keycloak realm to enforce immediate logout and reset authentication states.

Instructions

Remove all sessions for all users in the realm. Args: realm: Target realm (uses default if not specified) Returns: Status message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
realmNo

Implementation Reference

  • The handler function for the 'remove_all_user_sessions' tool. It is decorated with @mcp.tool(), which registers the tool. The function logs out all users in the specified realm by making a POST request to the Keycloak '/logout-all' endpoint.
    @mcp.tool() async def remove_all_user_sessions(realm: Optional[str] = None) -> Dict[str, str]: """ Remove all sessions for all users in the realm. Args: realm: Target realm (uses default if not specified) Returns: Status message """ await client._make_request("POST", "/logout-all", realm=realm) return { "status": "removed", "message": "Sessions for all users removed successfully", }

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