MCPSERV.CLUB
utain

Kroki MCP

MCP Server

Convert diagram code to images via Kroki backend

Stale(55)
5stars
3views
Updated Sep 18, 2025

About

A command‑line and MCP server tool that transforms textual diagram descriptions (PlantUML, Mermaid, etc.) into image files using a Kroki backend, supporting multiple output formats and both SSE and STDIO modes.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

Kroki‑MCP Overview

Kroki‑MCP bridges the gap between textual diagram specifications and visual representations by turning PlantUML, Mermaid, and other diagram languages into image files. It does this through a lightweight command‑line interface that can also run as an MCP server, exposing diagram conversion as a reusable tool for AI assistants. The primary problem it solves is the friction developers experience when integrating diagram generation into automated workflows or AI‑driven documentation pipelines. By providing a single, configurable endpoint that accepts diagram code and returns an image in formats such as PNG, SVG, JPEG, or PDF, Kroki‑MCP eliminates the need for multiple language‑specific rendering engines and simplifies CI/CD pipelines, chatbot interactions, or static site generators.

At its core, Kroki‑MCP offers two operation modes. The default STDIO mode reads diagram code from standard input and writes the rendered image to standard output, making it ideal for scripting or embedding in build pipelines. The SSE mode streams results via Server‑Sent Events, enabling real‑time feedback in interactive applications such as live preview editors or chat interfaces. These modes are selectable through a concise flag set, allowing developers to choose the most appropriate communication pattern for their use case. The tool also exposes a configuration layer that lets users override the backend Kroki server URL, tweak logging verbosity, or specify custom ports—facilitating deployment in both cloud and on‑premises environments.

The integration with the mcp-go library turns Kroki‑MCP into a first‑class MCP tool. Once registered, AI assistants can invoke diagram conversion by passing the textual specification to the server; the assistant receives back a binary image payload without needing to understand the underlying rendering logic. This abstraction is especially valuable in multi‑assistant ecosystems where a single diagramming capability can be shared across different models or services. Moreover, the server’s extensible architecture allows contributors to add support for new diagram types or output formats without altering the core API, ensuring long‑term adaptability.

Typical real‑world scenarios include:

  • Documentation generators that embed live diagram previews in Markdown or AsciiDoc files.
  • Chatbot assistants that can render UML or flowcharts on demand, enhancing user explanations.
  • CI pipelines that automatically generate architecture diagrams from code annotations or design documents.
  • Educational platforms where students submit diagram code and receive instant visual feedback.

By centralizing diagram rendering behind a simple HTTP or SSE interface, Kroki‑MCP provides developers with a consistent, language‑agnostic tool that fits naturally into modern AI workflows. Its combination of flexible modes, format support, and MCP integration gives it a unique edge over standalone rendering libraries or manual API calls, making it an attractive choice for any project that needs reliable diagram generation at scale.