Keycloak MCP Server

Model Context Protocol server for Keycloak administration

Local serverstdio

What is the Keycloak MCP MCP server?

Keycloak mcp mcp server lets Claude, Cursor and other MCP clients work with Keycloak MCP directly. Model Context Protocol server for Keycloak administration.

What Keycloak MCP does

A powerful Model Context Protocol server for Keycloak administration, providing a comprehensive set of tools to manage users, realms, roles, and other Keycloak resources through LLM interfaces.

Key capabilities

  • User Management — Create, delete, and list users across realms
  • Realm Administration — Comprehensive realm management capabilities
  • Secure Integration — Authentication with admin credentials
  • Easy Configuration — Simple setup with environment variables
  • LLM Integration — Seamless use with Claude, ChatGPT, and other MCP-compatible AI assistants

Installing the keycloak mcp mcp server

The server is distributed via npm as npx, so most clients can run it without a manual build step. Add it to your MCP client's configuration and restart the client to pick it up — the copy-paste configs for Claude Desktop, Claude Code and Cursor are on this page.

Configuration

Before the server will start you need to supply 3 environment variables: KEYCLOAK_URL, KEYCLOAK_ADMIN, KEYCLOAK_ADMIN_PASSWORD. Keep credentials in your client's env block or a secrets manager rather than committing them.

Requirements

  • Node.js 18 or higher - Running Keycloak instance

Where it fits

AI-service servers chain other models into your assistant, turning a single chat into a small production pipeline. Keycloak MCP sits in that group. Worth comparing against the other ai services servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.

Practical notes

  • This server runs locally, so it operates with whatever access your machine and its credentials already have. Scope that deliberately rather than by default.
  • It will not start until its required credentials are present, so set those before wondering why the tools never appear.
  • Maintained by Octodet.
  • MCP clients ask for confirmation before each tool call by default. Keep that on while you learn what the keycloak mcp mcp server actually does with your data.
  • Every entry in this directory is reviewed by hand before it goes live, and details are checked against the project's own documentation.

How to install the Keycloak MCP MCP server

#### For Local Development

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

Configuration as documented by the project. Restart the client after saving.

Configuration

  • Node.js 18 or higher - Running Keycloak instance
VariableDescriptionRequired
KEYCLOAK_URLCredential the server authenticates with.Yes
KEYCLOAK_ADMINCredential the server authenticates with.Yes
KEYCLOAK_ADMIN_PASSWORDCredential the server authenticates with.Yes

Frequently asked questions

It connects Keycloak MCP to MCP-compatible AI assistants such as Claude and Cursor. Instead of copying data back and forth by hand, the assistant works with Keycloak MCP directly.