add-organization-member
Add a user to an organization
Administer a Keycloak instance from the client — realms, clients, users, groups, composite roles, client scopes and protocol mappers, organizations, and identity providers with their mappers.
LABSCO SUMMARY
delete-realm sits in the same surface as list-users, and there is no scoped service account in the configuration to sit behind instead. What you get for that is unusual completeness: protocol mappers exist separately for clients and for client scopes, composite roles can be built and taken apart, groups nest through create-child-group, and identity providers arrive with their own mapper CRUD plus a tool that lists the mapper types a given provider actually supports. Roles are addressed by two names that do not overlap — by name through create-role and update-role, and by id through get-role-by-id, update-role-by-id and delete-role-by-id — so a script written against one will not find the other.
A Keycloak admin client covering 85 tools across realms, clients, users, groups, roles, client scopes, protocol mappers, organizations, identity providers and the session and event log.
KEYCLOAK_URL for the instance, plus KEYCLOAK_ADMIN and KEYCLOAK_ADMIN_PASSWORD — an administrator account rather than a scoped service credential. realm is a parameter throughout, so the instance is addressed one realm at a time.
One command plus credentials — npx keycloak-mcp-server, then supply credentials
USE CASES
The account, its first password, its group memberships and its role grants are separate calls, and the temporary flag on the password reset decides whether the user has to change it at first login.
The client is created with its redirect URIs and whether it is public, then the claims it gets are decided by client scopes and protocol mappers rather than by the client record itself.
The provider can be configured field by field or imported from a discovery URL, and the mapper types it supports can be listed before any mapping is written, so external claims are mapped to what actually exists.
A role's membership can be read directly, and composite roles mean a user can hold it without ever having been granted it by name — so the hierarchy has to be read too, along with the group grants.
Authentication and admin events are readable by type, active sessions can be listed for a realm, a client or a single user, and a user's sessions can be ended outright once the cause is found.
Organizations live inside a realm with their own membership and attributes, and user attributes carry the per-person metadata that the organization record does not.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
add-organization-memberAdd a user to an organization
assign-role-to-groupAssign a role to a group
assign-role-to-userAssign a role to a user in a specific realm
clear-eventsClear event logs
create-child-groupCreate a child group (subgroup)
create-clientRegister a new client/application in a realm
create-client-scopeCreate a new client scope (CRITICAL for managing token scopes)
create-client-scope-protocol-mapperCreate a protocol mapper for a client scope
create-composite-roleCreate composite roles (role hierarchies)
create-groupCreate user groups
create-identity-providerCreate a new identity provider for SSO integration
create-identity-provider-mapperCreate a mapper for identity provider (external user mapping)
create-organizationCreate a new organization (CRITICAL for organization management)
create-protocol-mapperCreate a protocol mapper for a client (CRITICAL for JWT organization claims)
create-realmCreate a new realm with configurable settings
create-roleCreate roles at realm or client level
create-userCreate a new user in a specific realm
delete-clientRemove a client from a realm
delete-client-scopeDelete a client scope
delete-client-scope-protocol-mapperDelete a protocol mapper from a client scope
delete-composite-rolesDelete composite roles from a role
delete-groupDelete groups
delete-identity-providerDelete an identity provider
delete-identity-provider-mapperDelete an identity provider mapper
delete-organizationDelete an organization
delete-protocol-mapperDelete a protocol mapper from a client
delete-realmDelete an existing realm
delete-roleDelete roles
delete-role-by-idDelete role by ID
delete-userDelete a user from a specific realm
find-users-with-roleFind users with a specific role
get-client-scopeGet details of a specific client scope
get-composite-rolesGet composite roles for a role
get-group-attributesGet group attributes
get-group-rolesGet roles assigned to a group
get-identity-providerGet details of a specific identity provider
get-identity-provider-mapperGet details of a specific identity provider mapper
get-organizationGet details of a specific organization
get-realm-settingsRetrieve detailed settings of a realm
get-role-by-idGet role details by ID
get-userGet user details by ID from a specific realm
get-user-attributesGet user attributes including unmanaged attributes
get-user-rolesGet all roles assigned to a user in a specific realm
get-user-sessionsList active sessions for a user
import-identity-provider-from-urlImport identity provider configuration from URL
list-available-group-rolesList available roles for a group
list-client-scope-protocol-mappersList protocol mappers for a client scope
list-client-scopesList all client scopes in a realm
list-clientsList all clients in a realm
list-composite-group-rolesList composite roles for a group
list-eventsRetrieve authentication and admin events
list-group-membersList members of a group
list-groupsList all groups in a realm
list-identity-provider-mapper-typesList available mapper types for an identity provider
list-identity-provider-mappersList all mappers for an identity provider
list-identity-providersList all identity providers in a realm
list-organization-membersList all members of an organization
list-organizationsList all organizations in a realm
list-protocol-mappersList protocol mappers for a client
list-realmsList all available realms
list-rolesList all roles in a specific realm
list-sessionsList all active sessions in a realm
list-sub-groupsList subgroups of a parent group
list-usersList users in a specific realm
logout-userLogout all sessions for a specific user
manage-user-groupsAdd or remove users from groups
remove-organization-memberRemove a user from an organization
remove-role-from-groupRemove a role from a group
remove-role-from-userRemove a role from a user in a specific realm
reset-user-passwordReset a user's password in a specific realm
search-usersSearch users in a specific realm with filters
set-group-attributesSet group attributes (organization metadata)
set-user-attributesSet user attributes (CRITICAL for storing organization data)
update-clientUpdate client settings (redirect URIs, protocol mappers, etc.)
update-client-scopeUpdate an existing client scope
update-client-scope-protocol-mapperUpdate a protocol mapper for a client scope
update-groupUpdate group attributes
update-identity-providerUpdate an existing identity provider
update-identity-provider-mapperUpdate an identity provider mapper
update-organizationUpdate an existing organization
update-protocol-mapperUpdate a protocol mapper for a client
update-realmUpdate realm settings and configurations
update-roleModify role attributes
update-role-by-idUpdate role by ID
update-userUpdate user information in a specific realm
BEFORE YOU INSTALL
85 tools when we connected. The documentation names 80; the five identity-provider mapper tools, such as get-identity-provider-mapper and import-identity-provider-from-url, are undocumented.
Both documented clients run the server on your machine.
CONTEXT COST
Rated by the size of the 85 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npx keycloak-mcp-server{
"mcpServers": {
"keycloak": {
"command": "npx",
"args": [
"keycloak-mcp-server"
],
"env": {
"KEYCLOAK_URL": "<YOUR_KEYCLOAK_URL>",
"KEYCLOAK_ADMIN": "<YOUR_KEYCLOAK_ADMIN>",
"KEYCLOAK_ADMIN_PASSWORD": "<YOUR_KEYCLOAK_ADMIN_PASSWORD>"
}
}
}
}