mkdocs-kroki-plugin
MkDocs plugin for Kroki-Diagrams
What it is and what it does
mkdocs-kroki-plugin bridges MkDocs and Kroki, a universal diagram-rendering service. You write diagram syntax (BlockDiag, BPMN, Mermaid, Excalidraw, and others) inside Markdown code fences tagged with `kroki-`, and the plugin renders them server-side, embedding the results as images or SVG objects in your built documentation. It handles HTTP requests to a Kroki server (public or self-hosted), caches rendered diagrams to speed up rebuilds during local development, and supports configuration for output format, styling, timeouts, and display options like width and alignment.
The plugin depends on mkdocs as its framework, httpx for HTTP requests, and defusedxml for safe XML parsing. It targets modern Python (3.10–3.14) and is in Beta status. Maintenance is active, with recent releases and ongoing commits. No known security vulnerabilities are recorded.
Use it for:
- Embed architecture diagrams, flowcharts, and sequence diagrams directly in API or system documentation without external image files.
- Generate BPMN process diagrams in technical documentation that stay in sync with your source code repository.
- Create Mermaid flowcharts and state diagrams in MkDocs sites, leveraging Kroki's rendering instead of client-side JavaScript.
- Build documentation with theme-aware diagram styling (light/dark mode backgrounds and colors) using the plugin's style configuration.
- Speed up local documentation builds by caching rendered diagrams, avoiding re-rendering on every file save during `mkdocs serve`.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A MkDocs plugin that converts Kroki diagram syntax in Markdown code fences into rendered diagrams (BlockDiag, BPMN, Excalidraw, Mermaid, and others) embedded in your documentation.
Yes. The plugin is actively maintained, has no known vulnerabilities, installs with low friction, and solves a clear problem—embedding diagrams in MkDocs without manual image management. MIT licensing removes legal friction. Install it if you use MkDocs and want to include Kroki diagrams; the only prerequisite is access to a Kroki server and Python 3.10+.
Install
mkdocs-kroki-plugin on PyPI
pip
pip install mkdocs-kroki-pluginuv
uv add mkdocs-kroki-pluginpoetry
poetry add mkdocs-kroki-pluginInstalling mkdocs-kroki-plugin
Before you install
Low friction: pure Python wheel with five runtime dependencies (mkdocs, httpx, defusedxml, properdocs, result). Active maintenance with a recent release 123 days ago and ongoing commits.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.
Quickstart
pip install mkdocs-kroki-plugin
# In mkdocs.yml:
plugins:
- kroki:
server_url: 'https://kroki.io'
# In your Markdown:
```kroki-blockdiag
blockdiag {
A -> B -> C;
}
```
Requires Python 3.10 or later; requires a running Kroki server (public instance at https://kroki.io or self-hosted).
Verify before relying
- Whether the plugin supports all Kroki diagram types equally or if some have known limitations.
- Performance impact of caching strategies on large documentation builds with hundreds of diagrams.
- Compatibility with MkDocs themes that use custom HTML rendering or CSS frameworks.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — defusedxml, httpx, mkdocs, properdocs, result |
| Maintenance | actively maintained — 123 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 84,348/month — #14,005 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mkdocs_kroki_plugin-1.6.0-py3-none-any.whl
Keywords: diagram, kroki, markdown, mkdocs, python
Tags
More Documentation packages
Docutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
SphinxSphinx generates professional documentation…
permissive · top 1,000 on PyPI
griffeGriffe extracts the complete structure and…
permissive · top 1,000 on PyPI
sphinxcontrib-serializinghtmlA Sphinx extension that outputs documentation…
permissive · top 1,000 on PyPI
alabasterAlabaster is a clean, responsive Sphinx theme…
permissive · top 1,000 on PyPI
sphinxcontrib-htmlhelpA Sphinx extension that generates HTML help…
permissive · top 1,000 on PyPI
mkdocs-drawioA MkDocs plugin that embeds interactive Drawio…
permissive · top 15,000 on PyPI
mkdocs-mermaid2-pluginA MkDocs plugin that renders Mermaid diagram…
permissive · top 5,000 on PyPI
mkdocs-panzoom-pluginAdds interactive pan and zoom functionality to…
permissive · top 5,000 on PyPI
blockdiagblockdiag generates block-diagram images from a…
permissive · top 15,000 on PyPI
mkdocs-videoA MkDocs plugin that embeds videos in…
permissive · top 15,000 on PyPI
mkdocs-include-markdown-pluginA MkDocs plugin that includes content from…
permissive · top 15,000 on PyPI
neoteroi-mkdocsProvides a collection of MkDocs plugins and…
permissive · top 15,000 on PyPI
mkdocs-render-swagger-pluginRenders Swagger and OpenAPI schemas as…
permissive · top 15,000 on PyPI
markdown-execExecutes code blocks embedded in Markdown files…
permissive · top 5,000 on PyPI
sphinxcontrib-blockdiagA Sphinx extension that embeds block diagrams…
permissive · top 15,000 on PyPI