Labsco
antoinebou12 logo

UML-MCP

โ˜… 88

from antoinebou12

A diagram generation server supporting multiple UML and other diagram types, with various output formats. It integrates with rendering services like Kroki and PlantUML.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

UML-MCP: Diagram Generation via MCP

Generate UML and other diagrams through the Model Context Protocol.

At a glance

TopicWhat you get
Diagrams30+ types: UML (Class, Sequence, Activity, Use Case, State, Component, Deployment, Object), Mermaid, D2, Graphviz, TikZ, ERD, BlockDiag, BPMN, C4, and more via Kroki
MCP toolsgenerate_uml, validate_uml, list_diagram_types, generate_uml_batch
OutputsSVG, PNG, PDF, JPEG, base64 (availability varies by diagram type)
PipelineKroki first, then PlantUML or Mermaid.ink
DeploymentLocal stdio, local HTTP, Docker, Vercel, Smithery
SourceURL
Live MCP (HTTP)https://uml-mcp.vercel.app/mcp
Smithery catalogAdd via Smithery
577497880-464b5b44-710c-4688-bfdc-432036b59cd1

Remote vs Local

  • Transport: Remote uses HTTP MCP, local uses stdio by default
  • Runtime: Remote runs on Vercel, local runs in your Python environment
  • File writes: Remote is read-only (no output_dir), local supports output_dir
  • Returned data: Both return URL + base64; local can also save files
  • Environment variables: Remote is managed server-side; local reads your env config

MCP clients must call /mcp, not the site root.

Supported Diagram Types

CategoryExamples
UML (PlantUML)Class, Sequence, Activity, Use Case, State, Component, Deployment, Object
GeneralMermaid, D2, Graphviz, ERD, BlockDiag, BPMN, C4
SpecializedTikZ, Excalidraw, Nomnoml, Pikchr, Structurizr, SVGBob, WaveDrom, WireViz, โ€ฆ

Full list with supported formats: run python server.py --list-tools or query uml://types and uml://formats.

MCP Tools and Resources

Tools

ToolPurpose
generate_umlRender a diagram; omit output_dir for URL/base64 only
validate_umlStructural validation before render; strict enables extra Mermaid/D2 checks
list_diagram_typesSame metadata as uml://types when resources are awkward
generate_uml_batchMultiple diagrams in one call (cap: MCP_BATCH_MAX_ITEMS)

Resources (uml://)

ResourceDescription
uml://typesDiagram types, backends, supported formats per type
uml://templatesStarter templates per type; see BPMN 2.0.2 guide for element and flow reference (docs)
uml://examplesExample diagrams per type; Mermaid documents named samples (sequence API, Gantt) alongside uml://examples (key mermaid)
uml://formatsOutput formats per type
uml://capabilitiesType โ†’ backend โ†’ formats matrix used for validation
uml://server-infoServer name, version, tools, prompts, Kroki/PlantUML URLs
uml://workflowRecommended plan-then-generate workflow

Architecture

Typical flow when a user asks an MCP-enabled assistant for a diagram: the assistant calls generate_uml, the server renders via Kroki, then returns URLs and optional base64 to the assistant for the user.

Sequence diagram: User to AI Assistant to UML-MCP server to Kroki and back, showing generate_uml and diagram delivery

server.py              -- MCP entry point (stdio/HTTP)
app.py                 -- FastAPI REST API + MCP HTTP at /mcp
api/app.py             -- legacy re-export of root app (Vercel FastAPI preset uses root app.py)
mcp_core/
  core/                -- config, server, CLI, utilities, diagram pipeline
  tools/               -- generate_uml, validate_uml
  prompts/             -- diagram generation prompts
  resources/           -- uml:// resource handlers
tools/kroki/           -- Kroki, PlantUML, Mermaid, D2 clients

Development

# Install dev dependencies
uv sync --all-groups

# Run tests
uv run pytest tests/ -v

# Lint
uv run ruff check . && uv run ruff format --check .

# Local CI
make ci

Documentation

Built with MkDocs + Material: