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 "Install 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 Servergenerate 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: diagrams-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.
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Diagram type (e.g., "mermaid", "plantuml", "graphviz"). Supports the same diagram types as Kroki.io. | |
| content | Yes | The diagram content in the specified format. | |
| outputPath | Yes | The complete file path where the diagram image should be saved (e.g., "/Users/username/Documents/diagram.svg"). | |
| outputFormat | No | Output image format. If unspecified, derived from outputPath extension. Options: "svg", "png", "pdf", "jpeg". | |
| scale | No | Optional scaling factor to apply to the diagram dimensions. Default is 1.0 (no scaling). This currently only affects SVG output format by attempting to modify width/height attributes. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the core functionality (converting diagram code to image file) and mentions the scale option's limitation to SVG format, but lacks details about error handling, performance characteristics, or authentication requirements.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is efficiently structured with three sentences that each serve distinct purposes: stating the core functionality, explaining use cases, and noting a specific feature. There is no redundant or unnecessary information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 5 parameters, 100% schema coverage, and no output schema, the description provides adequate context about what the tool does and when to use it, but lacks details about return values, error conditions, or performance characteristics that would be helpful for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 100% description coverage, so the baseline is 3. The description adds minimal value beyond the schema - it mentions the scale option's effect on SVG output, but doesn't provide additional context about parameter interactions or usage patterns.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with specific verbs ('download', 'converts', 'saves') and resources ('diagram image', 'local file'), and distinguishes it from the sibling tool 'generate_diagram_url' by emphasizing local file saving rather than URL generation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use this tool ('useful for generating diagrams for presentations, documentation, or other offline use'), but does not explicitly state when not to use it or mention the sibling tool as an alternative for different use cases.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Diagram type (e.g., "mermaid" for Mermaid diagrams, "plantuml" for PlantUML, "graphviz" for GraphViz DOT, "c4plantuml" for C4 architecture diagrams, and many more). See Kroki.io documentation for all supported formats. | |
| content | Yes | The diagram content in the specified format. For Mermaid diagrams, this would be the Mermaid syntax code (e.g., "graph TD; A-->B; B-->C;"). | |
| outputFormat | No | The format of the output image. Options are: "svg" (vector graphics, default), "png" (raster image), "pdf" (document format), "jpeg" (compressed raster image), or "base64" (base64-encoded SVG for direct embedding in HTML). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses that the tool generates URLs (not files) and mentions the external service Kroki.io, which adds useful context. However, it doesn't cover behavioral aspects like rate limits, authentication needs, error handling, or whether the URL is persistent/temporary. The description doesn't contradict annotations (none exist).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized (three sentences) and front-loaded: the first sentence states the core purpose, the second explains inputs/outputs, and the third describes usage. Every sentence earns its place with no redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is reasonably complete. It covers the purpose, inputs, outputs, and usage context. However, without annotations or output schema, it could benefit from more behavioral details (e.g., URL characteristics, error cases). The 100% schema coverage helps compensate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds minimal value beyond the schema: it mentions 'Mermaid diagram code or other supported diagram formats' which aligns with the 'type' and 'content' parameters, but doesn't provide additional syntax or format details. Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Generate a URL for a diagram using Kroki.io' with specific verbs ('generate', 'takes', 'returns') and resources ('Mermaid diagram code or other supported diagram formats', 'URL to the rendered diagram'). It distinguishes from the sibling tool 'download_diagram' by focusing on URL generation rather than downloading.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use this tool: for generating URLs to display diagrams in web browsers or embed in documents. It implies an alternative (the sibling 'download_diagram' likely downloads the diagram file), but doesn't explicitly state when to choose one over the other or list exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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
- AlicenseNot gradedqualityDmaintenanceEnables generating cloud architecture diagrams, flowcharts, sequence diagrams, and more using three rendering engines: mingrammer/diagrams, Mermaid, and PlantUML.3MIT
- AlicenseAqualityCmaintenanceRenders Mermaid diagram markup to PNG images using Puppeteer/Chromium. Enables AI-generated diagrams to be previewed inline and saved to disk.116MIT
- AlicenseAqualityCmaintenanceMCP server for rendering diagrams (Mermaid, Graphviz, PlantUML, D2) via Kroki. Provides tools to render diagrams and list available engines.210MIT
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tkoba1974/mcp-kroki'
If you have feedback or need assistance with the MCP directory API, please join our Discord server