Skip to content

D2

D2 is a declarative diagram language with first-class layout engines. UML-MCP renders D2 through Kroki using the same generate_uml tool as other types; set diagram_type to d2 and pass D2 source in code.

Example (source)

service.frontend -> service.api: HTTP
service.api -> db: SQL
service.api -> cache: get/set

Example (rendered SVG)

The SVG below was produced with generate_uml (diagram_type: d2, output_format: svg) against the snippet above, then committed under docs/assets/diagrams/.

D2 service architecture example

Parameters

Property Value
diagram_type d2
Backend D2 (via Kroki)
Output formats svg

See also