MCP Featured

Manage Keycloak Users and Realms via Natural Language

MCP server that connects to Keycloak for user and realm administration through create, delete, list-users, and list-realms tools.

Works with keycloak
⚠️ This tool looks unmaintained — no upstream commits in 12+ months.

17
Spark score
out of 100
Status Verified Official
Updated Feb 2025
Version 0.0.2
Models

Add to Favorites

Why it matters

Streamline Keycloak administration by enabling natural language commands for user and realm management. Automate tasks like user creation, deletion, and listing, simplifying access control and user lifecycle management.

Outcomes

What it gets done

01

Create new users with specified details.

02

Delete users by their unique identifier.

03

List all available realms.

04

View users within a specific realm.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-keycloak-mcp | bash

Capabilities

Tools your agent gets

create-user

Creates a new user in the specified realm with username, email, first name, and last name

delete-user

Deletes a user from the specified realm by their ID

list-realms

Displays a list of all available realms in the Keycloak instance

list-users

Displays a list of all users in the specified realm

Overview

Keycloak MCP Server

What it does

A Model Context Protocol server for Keycloak administration that provides tools to create and delete users, list realms, and list users in specific realms.

How it connects

Use when you need to integrate Keycloak user and realm management capabilities into MCP-compatible applications like Claude Desktop.

Source README

Keycloak MCP Server

smithery badge

A Model Context Protocol server for Keycloak administration, providing tools to manage users and realms.

Features

  • Create new users in specific realms
  • Delete users from realms
  • List available realms
  • List users in specific realms

Installation

Installing via Smithery

To install Keycloak for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install keycloak-model-context-protocol --client claude

Via NPM (Recommended)

The server is available as an NPM package:

# Direct usage with npx
npx -y keycloak-model-context-protocol

# Or global installation
npm install -g keycloak-model-context-protocol

Local Development Setup

If you want to develop or modify the server:

git clone <repository-url>
cd keycloak-model-context-protocol
npm install
npm run build

Configuration

Using NPM Package (Recommended)

Configure the server in your Claude Desktop configuration file:

{
  "mcpServers": {
    "keycloak": {
      "command": "npx",
      "args": ["-y", "keycloak-model-context-protocol"],
      "env": {
        "KEYCLOAK_URL": "http://localhost:8080",
        "KEYCLOAK_ADMIN": "admin",
        "KEYCLOAK_ADMIN_PASSWORD": "admin"
      }
    }
  }
}

For Local Development

{
  "mcpServers": {
    "keycloak": {
      "command": "node",
      "args": ["path/to/dist/index.js"],
      "env": {
        "KEYCLOAK_URL": "http://localhost:8080",
        "KEYCLOAK_ADMIN": "admin",
        "KEYCLOAK_ADMIN_PASSWORD": "admin"
      }
    }
  }
}

Available Tools

create-user

Creates a new user in a specified realm.

Inputs:

  • realm: The realm name
  • username: Username for the new user
  • email: Email address for the user
  • firstName: User's first name
  • lastName: User's last name

delete-user

Deletes a user from a specified realm.

Inputs:

  • realm: The realm name
  • userId: The ID of the user to delete

list-realms

Lists all available realms.

list-users

Lists all users in a specified realm.

Inputs:

  • realm: The realm name

Development

npm run watch

Testing

To test the server using MCP Inspector:

npx -y @modelcontextprotocol/inspector npx -y keycloak-model-context-protocol

Deployment

NPM Package

This project is automatically published to NPM via GitHub Actions when a new release is published on GitHub.

Setup Requirements for Deployment
  1. Create NPM account and get access token
  2. Add NPM_TOKEN secret to GitHub repository
    • Go to repository Settings > Secrets
    • Add new secret named NPM_TOKEN
    • Paste your NPM access token as the value

Prerequisites

  • Node.js 18 or higher
  • Running Keycloak instance

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.