Skip to main content
Glama
Keycloak MCP Server

Keycloak MCP Server

by paoloamato2

Keycloak MCP Server


Features

  • Complete API coverage: All 299 Keycloak Admin REST API endpoints

  • Dual transport: stdio (Claude Code) and SSE (GitHub Copilot, other MCP clients)

  • Auto-authentication: Supports both password and client credentials flows with automatic token refresh

  • Zero configuration tools: Each tool is self-describing with full input schemas

API Categories

Category

Tools

Attack Detection

3

Authentication Management

38

Client Certificates

6

Client Initial Access

3

Client Registration Policy

1

Client Role Mappings

10

Client Scopes

10

Clients

33

Components

6

Groups

11

Identity Providers

15

Keys

2

Organizations

13

Protocol Mappers

14

Realms Admin

37

Roles

28

Roles by ID

10

Scope Mappings

29

Users

30

Total

299

Related MCP server: Keycloak MCP Server

Demo

(Add a GIF or screenshot here demonstrating 3 real prompts and their executed tools!)

Installation

Option 1: Run directly with uvx (Recommended)

You can run the server directly without manual installation using astral's uv:

uvx keycloak-mcp-server

(When using uvx, you can pass environment variables inline or keep them in your MCP config file.)

Option 2: Install via pip

If you prefer a global or virtual environment installation:

pip install git+https://github.com/paoloamato2/keycloak-mcp-server.git

Option 3: Install from source (For development)

git clone https://github.com/paoloamato2/keycloak-mcp-server.git
cd keycloak-mcp-server
uv pip install -e .

Configuration

Set environment variables (or create a .env file based on .env.example):

# Required
export KEYCLOAK_URL=http://localhost:8080

# Authentication - Option A: Password flow
export KEYCLOAK_ADMIN_USERNAME=admin
export KEYCLOAK_ADMIN_PASSWORD=admin

# Authentication - Option B: Client credentials flow
export KEYCLOAK_CLIENT_ID=my-client
export KEYCLOAK_CLIENT_SECRET=my-secret

# Optional
export KEYCLOAK_ADMIN_REALM=master    # default: master
export KEYCLOAK_VERIFY_SSL=true       # default: true

Usage

Claude Code (stdio)

Add to your Claude Code MCP configuration (~/.claude/claude_desktop_config.json or project-level):

{
  "mcpServers": {
    "keycloak": {
      "command": "python",
      "args": ["-m", "keycloak_mcp_server"],
      "env": {
        "KEYCLOAK_URL": "http://localhost:8080",
        "KEYCLOAK_ADMIN_USERNAME": "admin",
        "KEYCLOAK_ADMIN_PASSWORD": "admin"
      }
    }
  }
}

Or if installed with uv:

{
  "mcpServers": {
    "keycloak": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/keycloak-mcp-server", "python", "-m", "keycloak_mcp_server"],
      "env": {
        "KEYCLOAK_URL": "http://localhost:8080",
        "KEYCLOAK_ADMIN_USERNAME": "admin",
        "KEYCLOAK_ADMIN_PASSWORD": "admin"
      }
    }
  }
}

GitHub Copilot (SSE)

Start the server with SSE transport:

python -m keycloak_mcp_server --transport sse --port 8080

Then configure in your GitHub Copilot MCP settings (VS Code settings.json):

{
  "github.copilot.chat.mcpServers": {
    "keycloak": {
      "type": "sse",
      "url": "http://localhost:8080/sse"
    }
  }
}

Command Line

# stdio mode (default)
python -m keycloak_mcp_server

# SSE mode
python -m keycloak_mcp_server --transport sse --host 0.0.0.0 --port 8080

# Using the entry point
keycloak-mcp-server --transport sse --port 8080

Security & Production Recommendations

⚠️ SECURITY WARNING: This MCP Server registers all Keycloak Admin REST API endpoints (299 tools), including sensitive write operations (like creating/deleting users, resetting passwords, and managing realms). Do not use your master realm super-admin credentials in a production environment.

When attaching this MCP server to your AI Assistants, please strictly follow the Principle of Least Privilege:

  1. Use Service Accounts (Client Credentials Flow): Avoid using the Password flow (KEYCLOAK_ADMIN_USERNAME / KEYCLOAK_ADMIN_PASSWORD). Instead, create a dedicated Keycloak Client with Service Accounts Enabled, and use the KEYCLOAK_CLIENT_ID and KEYCLOAK_CLIENT_SECRET.

  2. Limit Target Realms: Do not attach the server to the master realm unless specifically necessary. Point KEYCLOAK_ADMIN_REALM to the exact realm your AI assistant should manage.

  3. Grant Only Required Roles: Only assign the minimum necessary roles to your MCP Service Account.

    • If your LLM only needs to read data: Assign only view-users, view-clients, or view-realm.

    • If your LLM needs to manage users: Assign only manage-users.

    • Never assign admin or realm-admin roles to the AI unless you are fully aware of the risks.

  4. Always Verify SSL: Keep KEYCLOAK_VERIFY_SSL=true enabled in production to prevent Man-in-the-Middle (MITM) attacks. Setting it to false is only acceptable for local development.

Examples

Once connected, you can use natural language to interact with Keycloak:

  • "List all realms" → calls list_realms

  • "Create a user called john in the master realm" → calls create_user

  • "Show me all clients in the production realm" → calls list_clients

  • "What roles does user X have?" → calls get_user_role_mappings

  • "Add the admin role to the developers group" → calls add_group_realm_role_mappings

Project Structure

src/keycloak_mcp_server/
├── __init__.py          # Package entry point
├── __main__.py          # CLI entry point
├── config.py            # Environment-based configuration
├── client.py            # Async HTTP client with auto-auth
├── server.py            # MCP server setup and tool registration
└── endpoints/           # Endpoint definitions by category
    ├── __init__.py      # Base classes (EndpointDef, Param)
    ├── attack_detection.py
    ├── authentication.py
    ├── certificates.py
    ├── client_initial_access.py
    ├── client_registration_policy.py
    ├── client_role_mappings.py
    ├── client_scopes.py
    ├── clients.py
    ├── component.py
    ├── groups.py
    ├── identity_providers.py
    ├── key.py
    ├── organizations.py
    ├── protocol_mappers.py
    ├── realms.py
    ├── roles.py
    ├── roles_by_id.py
    ├── scope_mappings.py
    └── users.py

License

MIT

Available Tools

299 tools
add_auth_executionB

Add a new authentication execution to the realm.

Inputs: realm (required), execution_data (required).

add_client_default_scopeC

Add a default client scope to a client.

Inputs: realm (required), client_uuid (required), client_scope_id (required).

add_client_optional_scopeC

Add an optional client scope to a client.

Inputs: realm (required), client_uuid (required), client_scope_id (required).

add_client_protocol_mappers_batchB

Add multiple protocol mappers to a client in batch.

Inputs: realm (required), client_uuid (required), mappers_data (required).

add_client_realm_scope_mappingsC

Add realm-level roles to a client's scope.

Inputs: realm (required), client_uuid (required), roles (required).

add_client_role_compositesB

Add composites to a client role.

Inputs: realm (required), client_uuid (required), role_name (required), roles (required).

add_client_scope_client_scope_mappingsC

Add client-level roles to a client scope's scope.

Inputs: realm (required), client_scope_id (required), client_uuid (required), roles (required).

add_client_scope_protocol_mappers_batchC

Add multiple protocol mappers to a client scope in batch.

Inputs: realm (required), client_scope_id (required), mappers_data (required).

add_client_scope_realm_scope_mappingsB

Add realm-level roles to a client scope's scope.

Inputs: realm (required), client_scope_id (required), roles (required).

add_default_default_client_scopeC

Add a client scope to the default default client scopes of the realm.

Inputs: realm (required), client_scope_id (required).

add_default_groupB

Add a group to the default groups of the realm.

Inputs: realm (required), group_id (required).

add_default_optional_client_scopeA

Add a client scope to the default optional client scopes of the realm.

Inputs: realm (required), client_scope_id (required).

add_execution_to_flowC

Add a new execution to an authentication flow.

Inputs: realm (required), flow_alias (required), execution_data (required).

add_flow_with_executionC

Add a new flow with a new execution to an existing authentication flow.

Inputs: realm (required), flow_alias (required), flow_data (required).

add_group_client_role_mappingsB

Add client-level role mappings to the group.

Inputs: realm (required), group_id (required), client_id (required), roles (required).

add_group_realm_role_mappingsB

Add realm-level role mappings to a group.

Inputs: realm (required), group_id (required), roles (required).

add_organization_memberB

Add a member to an organization.

Inputs: realm (required), org_id (required), member_data (required).

add_realm_role_compositesC

Add composites to a realm role.

Inputs: realm (required), role_name (required), roles (required).

add_role_by_id_compositesC

Add composites to a role by ID.

Inputs: realm (required), role_id (required), roles (required).

add_user_client_role_mappingsB

Add client-level role mappings to the user.

Inputs: realm (required), user_id (required), client_id (required), roles (required).

add_user_federated_identityB

Add a federated identity to a user.

Inputs: realm (required), user_id (required), provider (required), identity_data (required).

add_user_realm_role_mappingsB

Add realm-level role mappings to a user.

Inputs: realm (required), user_id (required), roles (required).

add_user_to_groupC

Add a user to a group.

Inputs: realm (required), user_id (required), group_id (required).

clear_admin_eventsC

Clear all admin events for the realm.

Inputs: realm (required).

clear_all_brute_force_failuresB

Clear all user login failures for the realm, allowing all users to attempt login again.

Inputs: realm (required).

clear_realm_eventsC

Clear all events for the realm.

Inputs: realm (required).

clear_user_brute_force_failuresA

Clear login failures for a specific user, allowing them to attempt login again.

Inputs: realm (required), user_id (required).

copy_auth_flowB

Copy an existing authentication flow under a new name.

Inputs: realm (required), flow_alias (required), new_name_data (required).

count_groupsC

Get the number of groups in the realm.

Inputs: realm (required), search, top.

count_user_groupsB

Get the number of groups a user belongs to.

Inputs: realm (required), user_id (required), search.

count_usersA

Get the number of users in the realm matching the given criteria.

Inputs: realm (required), search, email, emailVerified, +4 more.

create_auth_flowC

Create a new authentication flow in the realm.

Inputs: realm (required), flow_data (required).

create_clientB

Create a new client in the realm.

Inputs: realm (required), client_data (required).

create_client_initial_access_tokenB

Create a new client initial access token.

Inputs: realm (required), token_config (required).

create_client_protocol_mapperC

Create a protocol mapper for a client.

Inputs: realm (required), client_uuid (required), mapper_data (required).

create_client_roleC

Create a new client role.

Inputs: realm (required), client_uuid (required), role_data (required).

create_client_scopeC

Create a new client scope.

Inputs: realm (required), scope_data (required).

create_client_scope_protocol_mapperC

Create a protocol mapper for a client scope.

Inputs: realm (required), client_scope_id (required), mapper_data (required).

create_client_templateC

Create a new client template (legacy).

Inputs: realm (required), template_data (required).

create_componentD

Create a new component.

Inputs: realm (required), component_data (required).

create_execution_configB

Create a new configuration for an authentication execution.

Inputs: realm (required), execution_id (required), config_data (required).

create_groupC

Create a new group in the realm.

Inputs: realm (required), group_data (required).

create_group_childC

Create a child group under a parent group.

Inputs: realm (required), group_id (required), group_data (required).

create_identity_providerB

Create a new identity provider.

Inputs: realm (required), provider_data (required).

create_identity_provider_mapperC

Create a new mapper for an identity provider.

Inputs: realm (required), alias (required), mapper_data (required).

create_organizationC

Create a new organization.

Inputs: realm (required), org_data (required).

create_realmC

Create a new realm.

Inputs: realm_data (required).

create_realm_roleC

Create a new realm role.

Inputs: realm (required), role_data (required).

create_userC

Create a new user in the realm.

Inputs: realm (required), user_data (required).

delete_authenticator_configB

Delete an authenticator configuration by ID.

Inputs: realm (required), id (required).

delete_auth_executionC

Delete an authentication execution by ID.

Inputs: realm (required), execution_id (required).

delete_auth_flowB

Delete an authentication flow by ID.

Inputs: realm (required), id (required).

delete_clientC

Delete a client.

Inputs: realm (required), client_uuid (required).

delete_client_initial_access_tokenB

Delete a client initial access token.

Inputs: realm (required), id (required).

delete_client_protocol_mapperB

Delete a protocol mapper from a client.

Inputs: realm (required), client_uuid (required), mapper_id (required).

delete_client_roleB

Delete a client role.

Inputs: realm (required), client_uuid (required), role_name (required).

delete_client_scopeC

Delete a client scope.

Inputs: realm (required), client_scope_id (required).

delete_client_scope_protocol_mapperB

Delete a protocol mapper from a client scope.

Inputs: realm (required), client_scope_id (required), mapper_id (required).

delete_client_templateC

Delete a client template (legacy).

Inputs: realm (required), client_scope_id (required).

delete_componentC

Delete a component.

Inputs: realm (required), component_id (required).

delete_groupC

Delete a group.

Inputs: realm (required), group_id (required).

delete_group_client_role_mappingsB

Delete client-level role mappings from the group.

Inputs: realm (required), group_id (required), client_id (required), roles (required).

delete_identity_providerB

Delete an identity provider by alias.

Inputs: realm (required), alias (required).

delete_identity_provider_mapperB

Delete a mapper for an identity provider.

Inputs: realm (required), alias (required), mapper_id (required).

delete_organizationC

Delete an organization.

Inputs: realm (required), org_id (required).

delete_realmB

Delete a realm.

Inputs: realm (required).

delete_realm_localization_localeA

Delete all localization texts for a locale in the realm.

Inputs: realm (required), locale (required).

delete_realm_localization_textB

Delete a specific localization text by locale and key.

Inputs: realm (required), locale (required), key (required).

delete_realm_roleC

Delete a realm role.

Inputs: realm (required), role_name (required).

delete_required_actionC

Delete a required action by alias.

Inputs: realm (required), alias (required).

delete_required_action_configB

Delete the configuration for a required action by alias.

Inputs: realm (required), alias (required).

delete_role_by_idB

Delete a role by ID.

Inputs: realm (required), role_id (required).

delete_userC

Delete a user.

Inputs: realm (required), user_id (required).

delete_user_client_role_mappingsB

Delete client-level role mappings from the user.

Inputs: realm (required), user_id (required), client_id (required), roles (required).

delete_user_credentialC

Delete a credential for a user.

Inputs: realm (required), user_id (required), credential_id (required).

disable_user_credential_typesC

Disable credential types for a user.

Inputs: realm (required), user_id (required), credential_types (required).

download_client_keystoreC

Download the keystore file for a client certificate, using the provided keystore configuration.

Inputs: realm (required), client_uuid (required), attr (required), config (required).

export_identity_provider_broker_configB

Export the broker configuration for an identity provider.

Inputs: realm (required), alias (required).

generate_and_download_client_keypairB

Generate a new keypair and certificate for the client, and download the resulting keystore.

Inputs: realm (required), client_uuid (required), attr (required), config (required).

generate_client_certificateC

Generate a new certificate and keypair for a client attribute.

Inputs: realm (required), client_uuid (required), attr (required).

generate_client_registration_access_tokenA

Generate a new registration access token for a client.

Inputs: realm (required), client_uuid (required).

generate_client_secretB

Generate a new secret for a client.

Inputs: realm (required), client_uuid (required).

generate_example_access_tokenB

Generate an example access token for evaluating client scopes.

Inputs: realm (required), client_uuid (required), scope, user_id.

generate_example_id_tokenA

Generate an example ID token for evaluating client scopes.

Inputs: realm (required), client_uuid (required), scope, user_id.

generate_example_userinfoB

Generate example userinfo for evaluating client scopes.

Inputs: realm (required), client_uuid (required), scope, user_id.

get_active_realm_keyB

Get the active key for the realm by key type.

Inputs: realm (required), kty (required).

get_authenticator_configB

Get an authenticator configuration by ID.

Inputs: realm (required), id (required).

get_authenticator_config_descriptionB

Get the configuration description for a specific authenticator provider.

Inputs: realm (required), provider_id (required).

get_auth_executionC

Get an authentication execution by ID.

Inputs: realm (required), execution_id (required).

get_auth_flowB

Get an authentication flow by ID.

Inputs: realm (required), id (required).

get_available_client_realm_scope_mappingsB

Get realm-level roles available to add to a client's scope.

Inputs: realm (required), client_uuid (required).

get_available_client_scope_client_scope_mappingsB

Get available client-level roles that can be added to a client scope's scope.

Inputs: realm (required), client_scope_id (required), client_uuid (required).

get_available_client_scope_realm_scope_mappingsA

Get realm-level roles available to add to a client scope's scope.

Inputs: realm (required), client_scope_id (required).

get_available_group_client_rolesB

Get available client-level roles that can be mapped to the group.

Inputs: realm (required), group_id (required), client_id (required).

get_available_group_realm_rolesA

Get realm-level roles available to map to a group.

Inputs: realm (required), group_id (required).

get_available_user_client_rolesB

Get available client-level roles that can be mapped to the user.

Inputs: realm (required), user_id (required), client_id (required).

get_available_user_realm_rolesB

Get realm-level roles available to map to a user.

Inputs: realm (required), user_id (required).

get_clientB

Get a client by UUID.

Inputs: realm (required), client_uuid (required).

get_client_evaluated_protocol_mappersB

Get evaluated protocol mappers for a client.

Inputs: realm (required), client_uuid (required), scope.

get_client_granted_scope_mappingsC

Get granted scope mappings for a client by role container.

Inputs: realm (required), client_uuid (required), role_container_id (required), scope.

get_client_installation_providerC

Get the installation provider configuration for a client.

Inputs: realm (required), client_uuid (required), provider_id (required).

get_client_key_infoC

Get key information for a client certificate attribute, including certificate and key metadata.

Inputs: realm (required), client_uuid (required), attr (required).

get_client_management_permissionsB

Get management permissions for a client.

Inputs: realm (required), client_uuid (required).

get_client_not_granted_scope_mappingsB

Get not-granted scope mappings for a client by role container.

Inputs: realm (required), client_uuid (required), role_container_id (required), scope.

get_client_protocol_mapperA

Get a protocol mapper for a client by ID.

Inputs: realm (required), client_uuid (required), mapper_id (required).

get_client_realm_scope_mappingsB

Get realm-level roles associated with a client's scope.

Inputs: realm (required), client_uuid (required).

get_client_registration_access_tokenC

Get the registration access token for a client.

Inputs: realm (required), client_uuid (required).

get_client_roleC

Get a client role by name.

Inputs: realm (required), client_uuid (required), role_name (required).

get_client_role_client_compositesC

Get client-level composites of a client role for a specific target client.

Inputs: realm (required), client_uuid (required), role_name (required), target_client_uuid (required).

get_client_role_compositesC

Get composites of a client role.

Inputs: realm (required), client_uuid (required), role_name (required).

get_client_role_permissionsB

Get management permissions for a client role.

Inputs: realm (required), client_uuid (required), role_name (required).

get_client_role_realm_compositesC

Get realm-level composites of a client role.

Inputs: realm (required), client_uuid (required), role_name (required).

get_client_scopeC

Get a client scope by ID.

Inputs: realm (required), client_scope_id (required).

get_client_scope_client_scope_mappingsB

Get client-level roles associated with a client scope's scope.

Inputs: realm (required), client_scope_id (required), client_uuid (required).

get_client_scope_mappings_allC

Get all scope mappings for a client.

Inputs: realm (required), client_uuid (required).

get_client_scope_protocol_mapperB

Get a protocol mapper for a client scope by ID.

Inputs: realm (required), client_scope_id (required), mapper_id (required).

get_client_scope_realm_scope_mappingsC

Get realm-level roles associated with a client scope's scope.

Inputs: realm (required), client_scope_id (required).

get_client_scope_scope_mappingsC

Get all scope mappings for a client scope.

Inputs: realm (required), client_scope_id (required).

get_client_secretC

Get the client secret for a client.

Inputs: realm (required), client_uuid (required).

get_client_service_account_userB

Get the service account user for a client.

Inputs: realm (required), client_uuid (required).

get_client_session_countB

Get the number of active sessions for a client.

Inputs: realm (required), client_uuid (required).

get_client_session_statsC

Get client session stats for the realm.

Inputs: realm (required).

get_client_templateC

Get a client template by ID (legacy).

Inputs: realm (required), client_scope_id (required).

get_componentB

Get a component by ID.

Inputs: realm (required), component_id (required).

get_effective_client_realm_scope_mappingsA

Get effective (composite) realm-level roles for a client's scope.

Inputs: realm (required), client_uuid (required).

get_effective_client_scope_client_scope_mappingsB

Get effective (composite) client-level roles for a client scope's scope.

Inputs: realm (required), client_scope_id (required), client_uuid (required).

get_effective_client_scope_realm_scope_mappingsC

Get effective (composite) realm-level roles for a client scope's scope.

Inputs: realm (required), client_scope_id (required).

get_effective_group_client_role_mappingsB

Get effective (composite) client-level role mappings for the group.

Inputs: realm (required), group_id (required), client_id (required).

get_effective_group_realm_role_mappingsB

Get effective (composite) realm-level role mappings for a group.

Inputs: realm (required), group_id (required).

get_effective_user_client_role_mappingsA

Get effective (composite) client-level role mappings for the user.

Inputs: realm (required), user_id (required), client_id (required).

get_effective_user_realm_role_mappingsA

Get effective (composite) realm-level role mappings for a user.

Inputs: realm (required), user_id (required).

get_execution_configB

Get the configuration for an authentication execution by execution ID and config ID.

Inputs: realm (required), execution_id (required), id (required).

get_flow_executionsC

Get all executions for an authentication flow.

Inputs: realm (required), flow_alias (required).

get_groupA

Get a group by ID.

Inputs: realm (required), group_id (required).

get_group_by_pathC

Get a group by its path.

Inputs: realm (required), path (required).

get_group_client_role_mappingsC

Get client-level role mappings for the group.

Inputs: realm (required), group_id (required), client_id (required).

get_group_management_permissionsB

Get management permissions for a group.

Inputs: realm (required), group_id (required).

get_group_realm_role_mappingsB

Get realm-level role mappings for a group.

Inputs: realm (required), group_id (required).

get_group_role_mappingsC

Get all role mappings for a group.

Inputs: realm (required), group_id (required).

get_identity_providerC

Get an identity provider by alias.

Inputs: realm (required), alias (required).

get_identity_provider_by_provider_idB

Get an identity provider by provider ID.

Inputs: realm (required), provider_id (required).

get_identity_provider_mapperB

Get a mapper for an identity provider by mapper ID.

Inputs: realm (required), alias (required), mapper_id (required).

get_identity_provider_permissionsC

Get the management permissions for an identity provider.

Inputs: realm (required), alias (required).

get_organizationC

Get an organization by ID.

Inputs: realm (required), org_id (required).

get_organization_identity_providerA

Get an identity provider linked to an organization by alias.

Inputs: realm (required), org_id (required), alias (required).

get_organization_memberB

Get a specific member of an organization.

Inputs: realm (required), org_id (required), user_id (required).

get_per_client_config_descriptionB

Get the per-client configuration description for authentication.

Inputs: realm (required).

get_realmC

Get a realm by name.

Inputs: realm (required).

get_realm_events_configB

Get the events configuration for the realm.

Inputs: realm (required).

get_realm_keysB

Get the keys for the realm, including active and passive keys and their details.

Inputs: realm (required).

get_realm_localization_textA

Get a specific localization text by locale and key.

Inputs: realm (required), locale (required), key (required).

get_realm_localization_textsA

Get all localization texts for a locale in the realm.

Inputs: realm (required), locale (required), useRealmDefaultLocaleFallback.

get_realm_roleB

Get a realm role by name.

Inputs: realm (required), role_name (required).

get_realm_role_client_compositesB

Get client-level composites of a realm role for a specific client.

Inputs: realm (required), role_name (required), client_uuid (required).

get_realm_role_compositesC

Get composites of a realm role.

Inputs: realm (required), role_name (required).

get_realm_role_permissionsB

Get management permissions for a realm role.

Inputs: realm (required), role_name (required).

get_realm_role_realm_compositesA

Get realm-level composites of a realm role.

Inputs: realm (required), role_name (required).

get_required_actionB

Get a required action by alias.

Inputs: realm (required), alias (required).

get_required_action_configB

Get the configuration for a required action by alias.

Inputs: realm (required), alias (required).

get_required_action_config_descriptionB

Get the configuration description for a required action by alias.

Inputs: realm (required), alias (required).

get_role_by_idB

Get a role by ID.

Inputs: realm (required), role_id (required).

get_role_by_id_client_compositesA

Get client-level composites of a role by ID for a specific client.

Inputs: realm (required), role_id (required), client_uuid (required).

get_role_by_id_compositesC

Get composites of a role by ID.

Inputs: realm (required), role_id (required).

get_role_by_id_permissionsB

Get management permissions for a role by ID.

Inputs: realm (required), role_id (required).

get_role_by_id_realm_compositesC

Get realm-level composites of a role by ID.

Inputs: realm (required), role_id (required).

get_rotated_client_secretC

Get the rotated secret for a client.

Inputs: realm (required), client_uuid (required).

get_userC

Get a user by ID.

Inputs: realm (required), user_id (required), userProfileMetadata.

get_user_brute_force_statusB

Get the brute force detection status for a specific user, including number of failures and disabled state.

Inputs: realm (required), user_id (required).

get_user_client_role_mappingsB

Get client-level role mappings for the user.

Inputs: realm (required), user_id (required), client_id (required).

get_user_profileC

Get the user profile configuration for the realm.

Inputs: realm (required).

get_user_realm_role_mappingsC

Get realm-level role mappings for a user.

Inputs: realm (required), user_id (required).

get_user_role_mappingsC

Get all role mappings for a user.

Inputs: realm (required), user_id (required).

get_users_management_permissionsC

Get users management permissions for the realm.

Inputs: realm (required).

impersonate_userC

Impersonate a user.

Inputs: realm (required), user_id (required).

invalidate_rotated_client_secretB

Invalidate the rotated secret for a client.

Inputs: realm (required), client_uuid (required).

list_admin_eventsC

List admin events for the realm.

Inputs: realm (required), operationTypes, authRealm, authClient, +7 more.

list_authenticator_providersB

List all authenticator providers available in the realm.

Inputs: realm (required).

list_auth_flowsB

List all authentication flows in the realm.

Inputs: realm (required).

list_client_authenticator_providersA

List all client authenticator providers available in the realm.

Inputs: realm (required).

list_client_default_scopesC

List default client scopes for a client.

Inputs: realm (required), client_uuid (required).

list_client_initial_access_tokensB

List all client initial access tokens for the realm.

Inputs: realm (required).

list_client_mappers_by_protocolC

List protocol mappers for a client filtered by protocol.

Inputs: realm (required), client_uuid (required), protocol (required).

list_client_optional_scopesC

List optional client scopes for a client.

Inputs: realm (required), client_uuid (required).

list_client_protocol_mappersB

List all protocol mappers for a client.

Inputs: realm (required), client_uuid (required).

list_client_registration_policy_providersA

List all client registration policy providers for the realm.

Inputs: realm (required).

list_client_role_groupsB

List groups that have the specified client role.

Inputs: realm (required), client_uuid (required), role_name (required), first, +2 more.

list_client_rolesC

List all roles for a client.

Inputs: realm (required), client_uuid (required), search, first, +2 more.

list_client_role_usersC

List users that have the specified client role.

Inputs: realm (required), client_uuid (required), role_name (required), first, +1 more.

list_clientsC

List all clients in the realm.

Inputs: realm (required), clientId, viewableOnly, first, +1 more.

list_client_scope_mappers_by_protocolA

List protocol mappers for a client scope filtered by protocol.

Inputs: realm (required), client_scope_id (required), protocol (required).

list_client_scope_protocol_mappersA

List all protocol mappers for a client scope.

Inputs: realm (required), client_scope_id (required).

list_client_scopesB

List all client scopes for the realm.

Inputs: realm (required).

list_client_templatesA

List all client templates for the realm (legacy).

Inputs: realm (required).

list_client_user_sessionsB

List active user sessions for a client.

Inputs: realm (required), client_uuid (required), first, max.

list_componentsB

List all components for the realm, optionally filtered by name, parent, or type.

Inputs: realm (required), name, parent, type.

list_credential_registratorsC

List credential registrators for the realm.

Inputs: realm (required).

list_default_default_client_scopesC

List default default client scopes for the realm.

Inputs: realm (required).

list_default_groupsB

List default groups for the realm.

Inputs: realm (required).

list_default_optional_client_scopesB

List default optional client scopes for the realm.

Inputs: realm (required).

list_form_action_providersC

List all form action providers available in the realm.

Inputs: realm (required).

list_form_providersB

List all form providers available in the realm.

Inputs: realm (required).

list_group_childrenC

List children of a group.

Inputs: realm (required), group_id (required), first, max, +1 more.

list_group_membersC

List members of a group.

Inputs: realm (required), group_id (required), first, max, +1 more.

list_groupsC

List all groups for the realm.

Inputs: realm (required), search, exact, first, +4 more.

list_identity_provider_mappersB

List all mappers for an identity provider.

Inputs: realm (required), alias (required).

list_identity_provider_mapper_typesB

List available mapper types for an identity provider.

Inputs: realm (required), alias (required).

list_identity_providersC

List all identity providers for the realm.

Inputs: realm (required), search, first, max, +1 more.

list_organization_identity_providersB

List identity providers linked to an organization.

Inputs: realm (required), org_id (required).

list_organization_membersB

List members of an organization.

Inputs: realm (required), org_id (required), first, max.

list_organizationsB

List organizations for the realm, optionally filtered by search criteria.

Inputs: realm (required), search, first, max, +1 more.

list_realm_eventsC

List events for the realm.

Inputs: realm (required), type, client, user, +5 more.

list_realm_localization_localesB

List all locales that have localization texts configured for the realm.

Inputs: realm (required).

list_realm_role_groupsB

List groups that have the specified realm role.

Inputs: realm (required), role_name (required), first, max, +1 more.

list_realm_rolesC

List all roles for the realm.

Inputs: realm (required), search, first, max, +1 more.

list_realm_role_usersB

List users that have the specified realm role.

Inputs: realm (required), role_name (required), first, max.

list_realmsB

List all realms accessible to the caller.

Inputs: briefRepresentation.

list_required_actionsC

List all required actions in the realm.

Inputs: realm (required).

list_sub_component_typesC

List sub-component types available for a component.

Inputs: realm (required), component_id (required), type.

list_unregistered_required_actionsB

List all unregistered required actions in the realm.

Inputs: realm (required).

list_user_configured_credential_typesC

List configured user storage credential types for a user.

Inputs: realm (required), user_id (required).

list_user_consentsC

List consents granted by a user.

Inputs: realm (required), user_id (required).

list_user_credentialsB

List credentials for a user.

Inputs: realm (required), user_id (required).

list_user_federated_identitiesB

List federated identities for a user.

Inputs: realm (required), user_id (required).

list_user_groupsB

List groups that a user belongs to.

Inputs: realm (required), user_id (required), search, first, +2 more.

list_user_offline_sessionsB

List offline sessions for a user and client.

Inputs: realm (required), user_id (required), client_uuid (required).

list_usersC

List users in the realm, with optional filtering.

Inputs: realm (required), search, email, emailVerified, +11 more.

list_user_sessionsC

List sessions for a user.

Inputs: realm (required), user_id (required).

logout_all_realm_sessionsB

Log out all sessions for the realm.

Inputs: realm (required).

logout_userA

Log out a user by revoking all sessions.

Inputs: realm (required), user_id (required).

lower_auth_execution_priorityB

Lower the priority of an authentication execution (move it down in the flow).

Inputs: realm (required), execution_id (required).

lower_required_action_priorityA

Lower the priority of a required action (move it down in the list).

Inputs: realm (required), alias (required).

move_user_credential_afterC

Move a user credential after another credential.

Inputs: realm (required), user_id (required), credential_id (required), after_credential_id (required).

move_user_credential_to_firstB

Move a user credential to the first position.

Inputs: realm (required), user_id (required), credential_id (required).

partial_export_realmC

Partial export of the realm configuration.

Inputs: realm (required), exportClients, exportGroupsAndRoles.

partial_import_realmC

Partial import into the realm.

Inputs: realm (required), import_data (required).

push_client_revocation_policyB

Push the revocation policy to all registered cluster nodes for the client.

Inputs: realm (required), client_uuid (required).

push_realm_revocation_policyA

Push the realm's revocation policy to any client that has an admin URL.

Inputs: realm (required).

raise_auth_execution_priorityC

Raise the priority of an authentication execution (move it up in the flow).

Inputs: realm (required), execution_id (required).

raise_required_action_priorityB

Raise the priority of a required action (move it up in the list).

Inputs: realm (required), alias (required).

register_client_cluster_nodeB

Register a cluster node with the client.

Inputs: realm (required), client_uuid (required), node_data (required).

register_required_actionC

Register a new required action in the realm.

Inputs: realm (required), action_data (required).

remove_client_default_scopeB

Remove a default client scope from a client.

Inputs: realm (required), client_uuid (required), client_scope_id (required).

remove_client_optional_scopeA

Remove an optional client scope from a client.

Inputs: realm (required), client_uuid (required), client_scope_id (required).

remove_client_realm_scope_mappingsB

Remove realm-level roles from a client's scope.

Inputs: realm (required), client_uuid (required), roles (required).

remove_client_role_compositesB

Remove composites from a client role.

Inputs: realm (required), client_uuid (required), role_name (required), roles (required).

remove_client_scope_client_scope_mappingsC

Remove client-level roles from a client scope's scope.

Inputs: realm (required), client_scope_id (required), client_uuid (required), roles (required).

remove_client_scope_realm_scope_mappingsC

Remove realm-level roles from a client scope's scope.

Inputs: realm (required), client_scope_id (required), roles (required).

remove_default_default_client_scopeB

Remove a client scope from the default default client scopes of the realm.

Inputs: realm (required), client_scope_id (required).

remove_default_groupB

Remove a group from the default groups of the realm.

Inputs: realm (required), group_id (required).

remove_default_optional_client_scopeB

Remove a client scope from the default optional client scopes of the realm.

Inputs: realm (required), client_scope_id (required).

remove_group_realm_role_mappingsC

Remove realm-level role mappings from a group.

Inputs: realm (required), group_id (required), roles (required).

remove_organization_memberA

Remove a member from an organization.

Inputs: realm (required), org_id (required), user_id (required).

remove_realm_role_compositesC

Remove composites from a realm role.

Inputs: realm (required), role_name (required), roles (required).

remove_role_by_id_compositesB

Remove composites from a role by ID.

Inputs: realm (required), role_id (required), roles (required).

remove_user_federated_identityB

Remove a federated identity from a user.

Inputs: realm (required), user_id (required), provider (required).

remove_user_from_groupB

Remove a user from a group.

Inputs: realm (required), user_id (required), group_id (required).

remove_user_realm_role_mappingsB

Remove realm-level role mappings from a user.

Inputs: realm (required), user_id (required), roles (required).

reset_user_passwordC

Reset a user's password.

Inputs: realm (required), user_id (required), credential_data (required).

send_user_actions_emailB

Send required actions email to a user.

Inputs: realm (required), user_id (required), actions_data (required), lifespan, +2 more.

set_realm_localization_textB

Set a specific localization text by locale and key.

Inputs: realm (required), locale (required), key (required), text_value (required).

test_client_nodes_availableC

Test if registered cluster nodes for the client are available.

Inputs: realm (required), client_uuid (required).

test_smtp_connectionB

Test SMTP connection with the given configuration.

Inputs: realm (required), smtp_config (required).

unregister_client_cluster_nodeB

Unregister a cluster node from the client.

Inputs: realm (required), client_uuid (required), node (required).

update_authenticator_configB

Update an authenticator configuration by ID.

Inputs: realm (required), id (required), config_data (required).

update_auth_flowB

Update an authentication flow by ID.

Inputs: realm (required), id (required), flow_data (required).

update_clientC

Update a client.

Inputs: realm (required), client_uuid (required), client_data (required).

update_client_management_permissionsC

Update management permissions for a client.

Inputs: realm (required), client_uuid (required), permissions_data (required).

update_client_protocol_mapperC

Update a protocol mapper for a client.

Inputs: realm (required), client_uuid (required), mapper_id (required), mapper_data (required).

update_client_roleC

Update a client role.

Inputs: realm (required), client_uuid (required), role_name (required), role_data (required).

update_client_role_permissionsC

Update management permissions for a client role.

Inputs: realm (required), client_uuid (required), role_name (required), permissions_data (required).

update_client_scopeB

Update a client scope.

Inputs: realm (required), client_scope_id (required), scope_data (required).

update_client_scope_protocol_mapperC

Update a protocol mapper for a client scope.

Inputs: realm (required), client_scope_id (required), mapper_id (required), mapper_data (required).

update_client_templateC

Update a client template (legacy).

Inputs: realm (required), client_scope_id (required), template_data (required).

update_componentC

Update a component.

Inputs: realm (required), component_id (required), component_data (required).

update_flow_executionsC

Update the executions of an authentication flow.

Inputs: realm (required), flow_alias (required), execution_data (required).

update_groupC

Update a group.

Inputs: realm (required), group_id (required), group_data (required).

update_group_management_permissionsC

Update management permissions for a group.

Inputs: realm (required), group_id (required), permissions_data (required).

update_identity_providerB

Update an identity provider.

Inputs: realm (required), alias (required), provider_data (required).

update_identity_provider_mapperC

Update a mapper for an identity provider.

Inputs: realm (required), alias (required), mapper_id (required), mapper_data (required).

update_identity_provider_permissionsC

Update the management permissions for an identity provider.

Inputs: realm (required), alias (required), permissions_data (required).

update_organizationC

Update an organization.

Inputs: realm (required), org_id (required), org_data (required).

update_realmC

Update a realm.

Inputs: realm (required), realm_data (required).

update_realm_events_configB

Update the events configuration for the realm.

Inputs: realm (required), events_config (required).

update_realm_localization_textsC

Update localization texts for a locale in the realm.

Inputs: realm (required), locale (required), texts_data (required).

update_realm_roleC

Update a realm role.

Inputs: realm (required), role_name (required), role_data (required).

update_realm_role_permissionsB

Update management permissions for a realm role.

Inputs: realm (required), role_name (required), permissions_data (required).

update_required_actionC

Update a required action by alias.

Inputs: realm (required), alias (required), action_data (required).

update_required_action_configC

Update the configuration for a required action by alias.

Inputs: realm (required), alias (required), config_data (required).

update_role_by_idC

Update a role by ID.

Inputs: realm (required), role_id (required), role_data (required).

update_role_by_id_permissionsB

Update management permissions for a role by ID.

Inputs: realm (required), role_id (required), permissions_data (required).

update_userC

Update a user.

Inputs: realm (required), user_id (required), user_data (required).

update_user_credential_labelC

Update the label of a user credential.

Inputs: realm (required), user_id (required), credential_id (required), label_data (required).

update_user_profileC

Update the user profile configuration for the realm.

Inputs: realm (required), profile_data (required).

update_users_management_permissionsC

Update users management permissions for the realm.

Inputs: realm (required), permissions_data (required).

upload_client_certificate_and_keyC

Upload a certificate and its private key for a client attribute.

Inputs: realm (required), client_uuid (required), attr (required), keystore (required).

upload_client_certificate_onlyA

Upload only a certificate for a client attribute, without updating the private key.

Inputs: realm (required), client_uuid (required), attr (required), certificate (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.8/5.0

    Scored across 299 tools

    Disambiguation4/5

    Most tools have clearly distinct targets and actions, with descriptions that specify the resource and operation. However, the sheer number of similar-sounding tools (e.g., multiple get/delete/update for roles and clients) creates potential for misselection, though descriptions usually clarify.

    Naming Consistency4/5

    Tools predominantly follow a verb_noun pattern with underscores (e.g., create_client, list_users). Minor inconsistencies exist between 'add' and 'create' for similar operations, and some names are overly long, but overall the pattern is recognizable and predictable.

    Tool Count1/5

    With 299 tools, the server vastly exceeds the typical scope for an MCP server. This is far too many for an agent to navigate efficiently, suggesting the server has been auto-generated from an API rather than curated for coherence.

    Completeness5/5

    The tool set covers an extensive range of Keycloak operations, including full CRUD for realms, clients, roles, users, groups, authentication flows, identity providers, organizations, and more. It also includes management permissions, events, localization, and advanced features, leaving few obvious gaps.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables administrators to manage Keycloak realms, users, roles, clients, groups, and more through its Admin REST API, with safe-by-default configuration and destructive operation confirmation.
      56
      106 npm
      3
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Exposes Keycloak admin operations as tools via the Model Context Protocol, allowing management of users, clients, groups, roles, and more through natural language.
      ISC
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables administration of Keycloak identity and access management through MCP, allowing management of realms, clients, users, roles, groups, identity providers, and sessions from any MCP client.
      Apache 2.0
    • A
      license
      C
      quality
      D
      maintenance
      A comprehensive MCP server for Keycloak administration, offering 80+ tools to manage users, realms, clients, roles, groups, sessions, events, organizations, and more directly from AI assistants.
      86
      MIT