Shaaf's blog

A technical blog about Java, Kubernetes and things that matter

Keycloak MCP Server: Manage Identity with Natural Language

There is always a distinct thrill in learning something new and immediately putting it to the test. My journey with Model Context Protocol (MCP) servers began with a basic ‘books API’ demo, but I quickly wanted to take it a step further and build something with real-world utility. Since I enjoy working with Keycloak, I thought: Why not create an MCP server for it?

The vision was simple: enable developers to just ‘chat’ with Keycloak. There are so many standard tasks—setting up new users, groups, clients, and browser workflows—that could be streamlined through conversation. For those unfamiliar, Keycloak is an open-source identity and access management solution. I released the first experimental version this past summer, and since then, the wave of constructive community feedback has been incredible. That momentum is exactly what gets me excited to keep building.


A Keycloak example - building my first MCP server Tools with Quarkus

Recently I wrote an article about “Adoption of the Model Context Protocol Within the Java Ecosystem”. Now it was also time to start experimenting with writing an MCP Server myself (well maybe not the first time). Certainly I don’t want to be left out of all the cool things being demonstrated by the community. The goal for me is to learn, and creating perhaps a more practical example. In this post I am going to choose Keycloak, and write an experimental MCP server implementation for keycloak. The post is also to spark interest around this topic. Will it be useful to have an MCP server for Keycloak?