Skip to main content
Glama
idoyudha

mcp-keycloak

by idoyudha

get_client

Retrieve a specific Keycloak client configuration using its database ID. Specify a realm to access clients across different authentication domains.

Instructions

Get a specific client by database ID.

Args:
    id: The client's database ID (not client_id)
    realm: Target realm (uses default if not specified)

Returns:
    Client object

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
realmNo

Implementation Reference

  • The handler function for the 'get_client' MCP tool. It is decorated with @mcp.tool() for registration and retrieves a specific Keycloak client by its database ID.
    @mcp.tool()
    async def get_client(id: str, realm: Optional[str] = None) -> Dict[str, Any]:
        """
        Get a specific client by database ID.
    
        Args:
            id: The client's database ID (not client_id)
            realm: Target realm (uses default if not specified)
    
        Returns:
            Client object
        """
        return await client._make_request("GET", f"/clients/{id}", realm=realm)
  • The @mcp.tool() decorator registers the get_client function as an MCP tool.
    @mcp.tool()
  • The function signature and docstring define the input schema (id: str required, realm: Optional[str]) and output (Dict[str, Any]) for the tool.
    async def get_client(id: str, realm: Optional[str] = None) -> Dict[str, Any]:
        """
        Get a specific client by database ID.
    
        Args:
            id: The client's database ID (not client_id)
            realm: Target realm (uses default if not specified)
    
        Returns:
            Client object
        """
        return await client._make_request("GET", f"/clients/{id}", realm=realm)

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