kroki
Kroki-MCP is a Go-based Model Context Protocol tool that converts textual diagram definitions (PlantUML, Mermaid, and more) into images via a Kroki backend. Designed for simplicity and flexibility, it supports both local and remote Kroki servers, offers configurable settings, and outputs multiple formats – making it ideal for developers building AI
claude mcp add --transport stdio utain-kroki-mcp go run github.com/utain/kroki-mcp/cmd/kroki-mcp@latest -m stdio -f png --kroki-host https://kroki.io
How to use
Kroki-MCP exposes a command-line MCP tool that uses Kroki to render textual diagrams (such as PlantUML or Mermaid) into images. It can operate in two modes: SSE (default, streaming results) and STDIO (reads diagram code from stdin and writes the image to stdout). The MCP integration allows you to run Kroki-MCP as an MCP server and wire it into your MCP workflow, so clients can request diagram rendering via the MCP protocol. By default, Kroki-MCP targets a Kroki backend (default https://kroki.io) and outputs PNG, but you can change the output format to SVG, JPEG, or PDF and point Kroki-MCP at a custom Kroki server. To use it, run the Kroki-MCP binary with the desired options, or configure it in your MCP config as shown in the README examples. The MCP integration leverages the mcp-go library, enabling seamless tool/server integration within your MCP ecosystem.
How to install
Prerequisites:
- Go 1.22 or newer installed on your system
- Internet access to fetch modules
- Optional: Docker if you want to run via Docker (as described in the README)
Install steps:
-
Ensure Go is installed and in your PATH. Verify with: go version
-
Run Kroki-MCP directly from source without building a separate binary (quick start): go run github.com/utain/kroki-mcp/cmd/kroki-mcp@latest -m stdio -f png --kroki-host https://kroki.io
-
Build a local binary for repeated use: go build -o kroki-mcp ./cmd/kroki-mcp ./kroki-mcp -m stdio -f png --kroki-host https://kroki.io
-
Running as an MCP server configuration (as shown in the README):
- Create an MCP config file with the kroki-mcp server (see example in README)
- Start the MCP server manager; Kroki-MCP will be invoked via Go as described above
Docker-based option:
- Build the Docker image and run (as per the Development with Docker section): docker build -t kroki-mcp . docker run --rm -it kroki-mcp --help
Optional: refer to the project README for additional Docker Compose usage to connect to a Kroki server running locally.
Additional notes
Notes and tips:
- The default Kroki backend is https://kroki.io; you can override this with --kroki-host or --kroki-host in the MCP config.
- Output formats include png, svg, jpeg, and pdf; specify with -f/--format.
- In STDIO mode, Kroki-MCP reads diagram code from stdin and writes the rendered image to stdout, which makes it easy to pipe data within a larger toolchain.
- In SSE mode (the default in some setups), results stream as events, suitable for real-time processing.
- When integrating with MCP, ensure the command and arguments align with your MCP server runner expectations (the example uses go run with @latest to keep it current).
- If you modify flags or host settings, ensure your MCP client requests match the server’s accepted flags and formats.
- Check connectivity to Kroki server backends if you’re self-hosting Kroki behind a firewall or proxy.
Related MCP Servers
mcp-language
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnostics.
sandbox
A Model Context Protocol (MCP) server that enables LLMs to run ANY code safely in isolated Docker containers.
awesome s
A curated list of excellent Model Context Protocol (MCP) servers.
mcp -python-template
This template provides a streamlined foundation for building Model Context Protocol (MCP) servers in Python. It's designed to make AI-assisted development of MCP tools easier and more efficient.
Convert-Markdown-PDF
Markdown To PDF Conversion MCP
vector_mcp
A server implementation for the Model Context Protocol (MCP) in Ruby.