UK

utain/kroki-mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

20 stars 9 forks 품질 78 트렌드 18MIT

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.

개요

Kroki-MCP is a command-line tool and MCP integration for converting textual diagrams (e.g., PlantUML, Mermaid) into images using a Kroki backend. It supports both local and remote Kroki servers, with flexible configuration and multiple output formats. - - Streams results using Server-Sent Events. - Reads diagram code from stdin and outputs to stdout. - Supports svg (default) and png. SVG is returned as markup text, normalized to scale and stay transparent when rendered inline in chat (e.g., Claude Desktop); PNG is returned as an image. - Configurable backend host (default: https://kroki.io). - Easily add support for more diagram types and output formats. - Exposes diagram conversion as an MCP tool using github.com/mark3labs/mcp-go. 1. Scaffold Go project. 2. Implement CLI with default SSE mode, format flags. 3. Implement Kroki client supporting all formats. 4. Implement SSE and STDIO modes. 5. Integrate with mcp-go for MCP tool support. 6. Add error handling and tests. 7.

README

원문 README의 일부입니다. 원문 보기.

Kroki-MCP

Kroki-MCP is a command-line tool and MCP integration for converting textual diagrams (e.g., PlantUML, Mermaid) into images using a Kroki backend. It supports both local and remote Kroki servers, with flexible configuration and multiple output formats.

Features

  • Modes:
    • SSE: Streams results using Server-Sent Events.
    • STDIO (default): Reads diagram code from stdin and outputs to stdout.
  • Output Formats: Supports svg (default) and png. SVG is returned as markup text, normalized to scale and stay transparent when rendered inline in chat (e.g., Claude Desktop); PNG is returned as an image.
  • Kroki Server: Configurable backend host (default: https://kroki.io).
  • Extensible: Easily add support for more diagram types and output formats.
  • MCP Integration: Exposes diagram conversion as an MCP tool using github.com/mark3labs/mcp-go.

Usage

# Default (SSE mode, PNG, default Kroki host)
kroki-mcp

# Specify output format
kroki-mcp --format svg

# Use STDIO mode
kroki-mcp --mode stdio --format svg

# Specify a custom Kroki server
kroki-mcp --kroki-host http://localhost:8000

Configuration

Option Description Type Default
--host, -h Server host address string localhost
--port, -p Server port int 5090
--mode, -m Operation mode (sse or stdio) string stdio
--format, -f Output format (png, svg) string png
--kroki-host Kroki server URL string https://kroki.io
--log-level Log level (debug, info, warn, error) string info
--log-format Log format (text or json) string text

Project Structure

kroki-mcp/
├── cmd/
│   └── kroki-mcp/           # Main CLI and MCP server entry point
├── internal/
│   ├── kroki/               # Kroki client logic (HTTP, formats)
│   ├── config/              # Configuration management (flags, env, files)
│   └── mcp/                 # MCP tool/server integration
├── test/                    # Unit and integration tests
GitHub에서 전체 README 보기

설치

docker run --rm -it kroki-mcp --help
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "kroki-mcp": { "command": "go", "args": [ "run", "github.com/utain/kroki-mcp/cmd/kroki-mcp@latest", "-m", "stdio", "-f", "png", "--kroki-host", "https://kroki.io" ] } } }