MCP Kroki Server
Generates and downloads diagrams in JPEG format through the Kroki.io service.
Converts Mermaid diagram syntax to visual outputs (SVG, PNG, PDF, JPEG) via Kroki.io, enabling generation of URLs and downloadable diagram files.
Generates and downloads diagrams in SVG format with optional scaling support for diagram dimensions.
Converts PlantUML diagram syntax to visual outputs (SVG, PNG, PDF, JPEG) via Kroki.io, supporting UML diagram generation and download.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Kroki Server generate a mermaid diagram URL for my flowchart"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Kroki Server
An MCP (Model Context Protocol) server for converting Mermaid diagrams to SVG images using Kroki.io.
Features
Generate URLs for diagrams using Kroki.io
Download diagrams as SVG, PNG, PDF, or JPEG files
Support for multiple diagram formats:
Mermaid
PlantUML
Graphviz
And many more (see Kroki.io documentation)
Related MCP server: kroki_mcp
Installation
local install
git clone https://github.com/tkoba1974/mcp-kroki.git
cd mcp-kroki
npm install
npm run buildUsage
The server provides two main tools:
1. Generate Diagram URL
Generates a URL for a diagram using Kroki.io.
Parameters:
type: The diagram type (e.g., "mermaid", "plantuml")content: The diagram content in the specified formatoutputFormat(optional): The output format (svg, png, pdf, jpeg, base64)
2. Download Diagram
Downloads a diagram to a local file.
Parameters:
type: The diagram type (e.g., "mermaid", "plantuml")content: The diagram content in the specified formatoutputPath: The path where the diagram should be savedoutputFormat(optional): The output format (svg, png, pdf, jpeg)scale(optional, number, default: 1.0): Scaling factor for the diagram dimensions. Currently only affects SVG output by attempting to modify width/height attributes. Minimum value is 0.1.
Example
// Generate a URL for a Mermaid diagram
const result = await callTool('generate_diagram_url', {
type: 'mermaid',
content: 'graph TD; A-->B; B-->C; C-->D;',
outputFormat: 'svg'
});
// Download a Mermaid diagram
const result = await callTool('download_diagram', {
type: 'mermaid',
content: 'graph TD; A-->B; B-->C; C-->D;',
outputPath: '/path/to/diagram.svg'
});How It Works
The server uses the Kroki.io API to convert diagrams. The diagram content is compressed and encoded before being sent to Kroki.io.
Usage with Claude Desktop
Add to your Claude Desktop configuration file (claude_desktop_config.json):
local install:
{
"mcpServers": {
"mcp-kroki": {
"command": "node",
"args": ["/path/to/mcp-kroki/build/index.js"]
}
}
}npx:
{
"mcpServers": {
"mcp-kroki": {
"command": "npx",
"args": [
"-y",
"@tkoba1974/mcp-kroki"
]
}
}
}License
MIT
Available Tools
2 toolsdownload_diagramA
Download a diagram image to a local file. This tool converts diagram code (such as Mermaid) into an image file and saves it to the specified location. Useful for generating diagrams for presentations, documentation, or other offline use. Includes an option to scale SVG output.
Inputs: type (required), content (required), outputPath (required), outputFormat, +1 more.
generate_diagram_urlA
Generate a URL for a diagram using Kroki.io. This tool takes Mermaid diagram code or other supported diagram formats and returns a URL to the rendered diagram. The URL can be used to display the diagram in web browsers or embedded in documents.
Inputs: type (required), content (required), outputFormat.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one downloads diagrams to local files for offline use, while the other generates URLs for web-based display. There is no overlap or ambiguity between them.
Both tools follow a consistent verb_noun pattern (download_diagram, generate_diagram_url) with the same base noun 'diagram', making them predictable and easy to understand.
With only two tools, the server feels thin for a diagram generation service. It lacks essential operations like listing supported diagram formats, validating diagram code, or managing diagram styles, which would be expected for a complete toolset.
The server covers basic output generation (download and URL) but has significant gaps. It lacks tools for input validation, format discovery, or diagram manipulation (e.g., editing or converting formats), which are core to a diagram service domain.
Maintenance
Related MCP Connectors
Render, validate, encode/decode PlantUML diagram-as-code; 22 diagram types. Free, no auth.
Diagrams, badges, charts and QR codes as plain image URLs you can paste into Markdown.
Generate dynamic Mermaid diagrams and charts with AI assistance. Customize styles and export diagr…
Render, verify, describe, and safely edit Mermaid diagrams through MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceConverts Markdown files into professional diagrams such as flowcharts, mind maps, and architecture diagrams using Mermaid.js and custom SVG renderers. It enables users to list, render, and export visualizations in multiple formats including SVG, PNG, and PDF.3MIT
- FlicenseNot gradedqualityDmaintenanceProvides AI agents with tools to generate, validate, and inspect diagrams from natural-language prompts, using the Kroki rendering engine to produce SVG files.-
- AlicenseAqualityCmaintenanceEnables AI assistants to generate and validate 30+ UML and other diagram types (Mermaid, D2, Graphviz, BPMN, C4, and more) through the Model Context Protocol, returning rendered SVG, PNG, PDF, JPEG, or base64 output via Kroki, PlantUML, and Mermaid backends.4Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to render, validate and convert diagrams-as-code — Mermaid, PlantUML, C4, Graphviz, D2, Structurizr, BPMN and Excalidraw — into images with shareable links, using either the public or a self-hosted Kroki service.MIT