Authors UML and related text-based diagrams (PlantUML, Mermaid, D2, BPMN, and more)...
Maintainers: Keep the
generate_umltable (especiallyoutput_dir) aligned with uml-mcp repo-local skills when you edit either side:.cursor/skills/uml-mcp-diagrams/SKILL.mdand.skill/skills/uml-mcp-diagrams/SKILL.md. Portable prose (Smithery/agents everywhere) belongs in this uml-skill bundle; repo-only links (e.g. relative paths into sequential-thinking under.skill) stay in the uml-mcp copies only.
diagram_type (still confirm with uml://types).scripts/kroki_url.py when MCP is unavailable.Turn the user’s [PROMPT] into correct, readable diagram source for their [PURPOSE], using [TARGETLANGUAGE] for labels. When uml-mcp is available, do not stop at raw source only: run generate_uml (and optionally validate_uml) so the user gets a shareable Kroki url and playground when present.
| Placeholder | Role |
|---|---|
| DIAGRAM TYPE | e.g. Sequence, Class, Activity, Component, State, Deployment, Use Case, BPMN, C4, Gantt, Mind map, … |
| ELEMENT TYPE | e.g. Actors, messages, objects, classes, interfaces, components, states, nodes, edges, swimlanes, constraints |
| PURPOSE | Communication, planning, design, analysis, modeling, documentation, implementation, testing, debugging |
| DIAGRAMMING TOOL | PlantUML, Mermaid, D2, or another type exposed by uml-mcp (uml://types) |
| TARGETLANGUAGE | Natural language for names and labels in the diagram |
| PROMPT | Concrete scenario, system, or question to depict |
Prefer one primary notation per diagram unless the user asks for a hybrid.
diagram_type is unknown or ambiguous, read uml://types or uml://capabilities before authoring. If the client cannot read MCP resources, call list_diagram_types for the same metadata. Do not guess unsupported types or formats.code. Do not substitute guesses for documented syntax.validate_uml / generate_uml.uml_diagram_with_thinking (plan then code) or uml_diagram before finalizing code. Type-specific prompts (e.g. class_diagram, sequence_diagram, activity_diagram, c4_model, wireviz_harness, bpmn_executable_process) are available when listed by the server.diagram_type. Use uml://templates, uml://examples, and uml://mermaid-examples when you need starter syntax.validate_uml with the same diagram_type, code, and planned output_format. Use strict: true for stricter Mermaid/D2 checks when needed.generate_uml (or generate_uml_batch for multiple independent diagrams in one round-trip). Handle error by fixing source or parameters, then present results (see below).generate_uml| Input | Guidance |
|---|---|
diagram_type |
Required. Must match a key from uml://types (e.g. class, sequence, mermaid, d2). |
code |
Required. Source in the language that matches diagram_type. |
output_dir |
Omit or null for URL-first output (no file write; responses may include content_base64 when no directory is set). Set only if the user wants a saved image. |
output_format |
Default svg is usually best for URLs; use png / pdf / jpeg / txt only if valid for that type (see uml://formats). |
theme |
PlantUML-related types only; omit otherwise. |
scale |
SVG only; optional size multiplier. |
validate_uml| Input | Guidance |
|---|---|
diagram_type, code, output_format |
Same intent as for generate_uml. |
strict |
Optional. Set true for stricter Mermaid/D2 structural checks before render. |
generate_uml_batchPass an items array of objects, each like generate_uml (diagram_type, code, optional output_format, theme, scale). Optional shared output_dir for all items. Per-index failures are returned without stopping the rest; use for multi-diagram documentation or comparisons.
diagram_type| User intent | Typical diagram_type |
|---|---|
| Classes, associations, packages | class (PlantUML) or mermaid with classDiagram |
| Messages over time, lifelines | sequence or Mermaid sequenceDiagram |
| Flows, swimlanes, process / BPMN | activity, bpmn, or Mermaid flowchart |
| Components, deployment | component, deployment, or C4-style types if listed in uml://types |
| Quick graphs, Gantt, pie | mermaid |
| Declarative layout / modern DSL | d2 |
| ASCII box drawings, monospace diagrams | ditaa or svgbob (still use generate_uml with that diagram_type) |
When several types fit, pick the one the user named; otherwise prefer the type with the clearest template in uml://templates.
Activity-style behavior: For strict UML activity or swimlanes, PlantUML activity or bpmn is often clearer than Mermaid. If the user insists on Mermaid, use flowchart or stateDiagram-v2 appropriately and set diagram_type to mermaid with valid Mermaid source.
generate_umlerror, adjust code, diagram_type, or output_format, then retry (or re-run validate_uml).url — primary Kroki link to the rendered diagram.playground — if present, link for interactive editing.local_path — only when output_dir was set.code in the reply so the user can edit and regenerate.Kroki is a unified HTTP API that renders many text diagram languages to SVG, PNG, PDF, etc. uml-mcp maps each supported diagram_type to a Kroki backend and may report a source field such as kroki, plantuml_server, or mermaid_ink depending on configuration and fallbacks.
Logical vs Kroki path: scripts/kroki_url.py takes a Kroki URL path segment (e.g. plantuml, mermaid, d2). uml-mcp generate_uml uses logical keys from uml://types (e.g. class, sequence → prepared PlantUML). Prefer MCP tools when connected; use the script only when MCP is unavailable.
generate_uml, validate_uml, list_diagram_types, generate_uml_batchuml://types, uml://formats, uml://templates, uml://examples, uml://capabilities, uml://server-info, uml://mermaid-examples, uml://bpmn-guide, uml://workflowPrompts (when the client exposes them): uml_diagram, uml_diagram_with_thinking, and type-specific prompts (class_diagram, sequence_diagram, activity_diagram, usecase_diagram, mermaid_sequence_api, mermaid_gantt, bpmn_process_guide, c4_model, wireviz_harness, bpmn_executable_process, convert_class_to_mermaid) help structure code before generate_uml.
Always use the MCP APIs exposed in the environment; do not guess unsupported diagram_type or output_format values when unsure — confirm with uml://types / uml://formats.
For presentation intents (timeline vs roadmap, Venn, quadrant, ER, architecture trees, optional constraints like direction / max_nodes) and a summary table of Kroki diagram_type keys, see references/DIAGRAM-TYPES.md. Always still confirm keys and formats with uml://types and uml://formats for the connected server.
plantuml, mermaid, d2, …).url for the same source when the server is connected.These rules apply to diagram source (Mermaid, PlantUML, D2, etc.), not to HTML layout:
activate / deactivate; Mermaid activate / deactivate when appropriate). Close every activation interval you open.* / global exception path where the DSL allows.classDef / highlighted participant, one PlantUML skinparam / styled element, one D2 node style). Avoid rainbow or per-node rainbow fills — hierarchy and labels carry meaning.For assistant-facing explanations (summaries, caveats, next steps), you may use a Humanizer skill if it is installed in the client, to keep tone clear and direct. Do not run humanizer output through diagram code — Kroki needs valid DSL only.
Contributors who work inside the uml-mcp repo may also use .cursor/skills/uml-mcp-diagrams/SKILL.md and .skill/skills/uml-mcp-diagrams/SKILL.md as focused MCP workflow references. This SKILL.md stays self-contained for the uml-skill bundle.
Optional directories (add when needed):
scripts/ — small helpers agents can run. scripts/kroki_url.py prints a Kroki GET URL from diagram source (file or stdin); use when MCP is not available. See scripts/README.md.references/ — extra docs on demand (e.g. references/DIAGRAM-TYPES.md).assets/ — templates, images, or data files.