# UML-MCP: LLM-oriented project summary

> Human-oriented docs: https://antoinebou12.github.io/uml-mcp/. Repo: https://github.com/antoinebou12/uml-mcp

UML-MCP is a Python MCP (Model Context Protocol) server that renders diagrams from text: PlantUML UML, Mermaid, D2, Graphviz, Kroki-backed types (30+ diagram kinds), with SVG/PNG/PDF/JPEG and base64 outputs. Pipeline: Kroki first, then PlantUML or Mermaid.ink fallbacks.

## Endpoints

- Public HTTP MCP: https://uml-mcp.vercel.app/mcp (path must be `/mcp`, not site root)
- Smithery: https://smithery.ai/server/antoinebou12/uml

## MCP tools

- generate_uml: diagram_type, code, output_format, optional output_dir/theme/scale; omit output_dir for URL + base64 only (typical on remote)
- validate_uml: validate before render; `strict` for extra Mermaid/D2 checks
- list_diagram_types: same idea as uml://types when resources are awkward
- generate_uml_batch: multiple diagrams; cap via MCP_BATCH_MAX_ITEMS (default 20)

Full parameters: docs/api/tools.md (in repo) or the published docs site under Reference.

## MCP resources (uml://)

- uml://types: types, backends, formats per type
- uml://templates: starters per type; BPMN element/flow reference is documented at docs/tutorials/bpmn.md (not a separate uml:// URI)
- uml://examples: examples per type; named Mermaid samples (sequence API, Gantt) are described in docs/diagrams/mermaid.md (use key mermaid in the resource payload)
- uml://formats: output formats
- uml://capabilities: type → backend → formats matrix
- uml://server-info: version, tools, prompts, backend URLs
- uml://workflow: plan-then-generate workflow

## MCP prompts (optional; when the client lists prompts)

- uml_diagram, uml_diagram_with_thinking: read uml://types and uml://formats, plan, then call generate_uml
- Type-specific prompts (class, sequence, activity, Mermaid, BPMN, C4, …): see docs/reference/prompts.md

## Prompt hint for assistants

Choose diagram type and notation (PlantUML / Mermaid / D2), plan elements and relationships, then call generate_uml (or validate_uml first). Use uml://types for valid diagram_type values.

## Configuration (local / self-hosted)

Notable env vars: KROKI_SERVER, PLANTUML_SERVER, MCP_OUTPUT_DIR / UML_MCP_OUTPUT_DIR, MCP_READ_ONLY, MCP_MAX_CODE_LENGTH, MCP_BATCH_MAX_ITEMS, MCP_RATE_LIMIT_PER_MINUTE, USE_LOCAL_KROKI, USE_LOCAL_PLANTUML. Details: docs/configuration.md

## Run locally

- stdio: `uv sync` then `uv run python server.py` (or `python server.py` with deps installed)
- HTTP: `python server.py --transport http --host 127.0.0.1 --port 8000`, MCP at http://127.0.0.1:8000/mcp
- List tools: `python server.py --list-tools`

## Layout (repo)

- server.py: MCP entry
- app.py: FastAPI + HTTP MCP /mcp
- mcp_core/: server, config, tools, resources, prompts
- tools/kroki/: Kroki, PlantUML, Mermaid, D2 clients
- config/: example Cursor / Claude Desktop JSON

## Meta

- License: MIT
- Python: >=3.12,<3.15 (see pyproject.toml)
- Maintainer: Antoine Boucher
