keycloak-mcp-server

Keycloak MCP Server Documentation

Introduction

The Keycloak MCP Server is a Model Context Protocol (MCP) server implementation that provides programmatic access to Keycloak administration functionality. This server enables AI assistants and development tools to interact with Keycloak through a standardized interface, supporting operations such as user management, realm configuration, client administration, and authentication flow management.

Key Features

Architecture

The server is built using:

Table of Contents

Getting Started

Deployment

Configuration

CI/CD

Migration Guides

Technical Documentation

Development

Release Information

Authentication

The MCP server uses JWT Bearer token authentication. Each user must obtain their own JWT token from Keycloak and configure it in their MCP client.

Get Token:

./scripts/get-mcp-token.sh \
  --keycloak-url https://keycloak.example.com \
  --username your-username \
  --password your-password

Configure MCP Client:

{
  "mcpServers": {
    "keycloak": {
      "transport": "sse",
      "url": "https://mcp-server.example.com/mcp/sse",
      "headers": {
        "Authorization": "Bearer <your-jwt-token>"
      }
    }
  }
}

Deployment Options

Docker Container

docker run -d \
  --name keycloak-mcp-server \
  -p 8080:8080 \
  -e KC_URL=https://keycloak.example.com \
  -e KC_REALM=master \
  -e OIDC_CLIENT_ID=mcp-server \
  quay.io/sshaaf/keycloak-mcp-server:latest

OpenShift

oc apply -f deploy/openshift/

See the OpenShift Deployment Guide for complete instructions.

Native Binary

Download the native binary for your platform from the releases page and run:

export KC_URL=https://keycloak.example.com
export KC_REALM=master
export OIDC_CLIENT_ID=mcp-server
export QUARKUS_HTTP_PORT=8080

./keycloak-mcp-server-linux-x64

Available Operations

The Keycloak MCP Server supports the following operations:

User Management

Realm Management

Client Management

Role Management

Group Management

Identity Provider Management

Authentication Flow Management

Security Considerations

Authentication

Token Management

Production Deployment

Support and Contributing

Documentation

Complete documentation is available in this directory. Start with the Getting Started Guide for setup instructions.

Contributing

Contributions are welcome. Please see the Contributors Guide for information on how to contribute to the project.

Issues

Report issues on the GitHub repository issue tracker.

Community

License

This project is licensed under the MIT License. See the LICENSE file in the repository root for details.


Version: 0.3.0
Last Updated: November 2025
Maintainer: Shaaf Syed