Skip to content

UML-MCP

UML-MCP is an MCP server for diagram generation: AI assistants (Cursor, Claude Desktop, and any MCP-compatible client) can render UML, Mermaid, D2, TikZ, BPMN, C4, Graphviz, and 30+ other diagram types through Kroki, PlantUML, Mermaid, and D2.

Run Tests Build Package Deploy docs GitHub stars License: MIT Python 3.12

sequenceDiagram
    autonumber
    participant U as User
    participant A as AI Assistant
    participant M as UML-MCP server
    participant K as Kroki / PlantUML
    U->>A: "Draw a sequence diagram of login"
    A->>M: generate_uml(diagram_type, code)
    M->>K: render diagram
    K-->>M: SVG / PNG
    M-->>A: { url, playground, content_base64 }
    A-->>U: rendered diagram

Get started in 5 minutes Browse the API reference Add to Cursor / Claude


Features

  • 30+ diagram types


    UML (Class, Sequence, Activity, Use Case, State, Component, Deployment, Object), Mermaid, D2, Graphviz, TikZ, ERD, BlockDiag, BPMN, C4, all in one tool call.

    Diagram catalog

  • MCP-native tools


    generate_uml, validate_uml, list_diagram_types, and generate_uml_batch are MCP tools with annotations (readOnlyHint, idempotentHint, etc.) and resource URIs under uml://.

    Tool reference

  • Multiple output formats


    SVG, PNG, PDF, JPEG, TXT, and base64, depending on diagram type. Save to disk, return a URL, or stream as base64. Configurable themes and SVG scale.

    Configuration

  • Deployment options


    Local stdio for IDE integration. HTTP for shared infra. Docker for offline. Vercel + Smithery for zero-install hosted MCP.

    Deploy guide

  • Rendering with fallbacks


    Kroki first, with optional fallback to a local PlantUML server or Mermaid.ink. Each response includes a source field naming the backend that produced the image.

    Fallback strategy

  • Built-in tutorials


    Step-by-step guides for connecting clients, generating your first diagram, validating, batching, theming, and converting between syntaxes.

    Tutorials


Quick start

Add the published server to your client without managing any process:

npm install -g @smithery/cli@latest
smithery auth login
smithery mcp add antoinebou12/uml --client cursor

Or use the legacy one-liner: npx -y @smithery/cli install antoinebou12/uml --client claude.

Use the live deployment over Streamable HTTP:

{
  "mcpServers": {
    "uml-mcp": {
      "url": "https://uml-mcp.vercel.app/mcp"
    }
  }
}

The MCP route is /mcp, not the domain root.

Clone, install, run. Everything stays on your machine:

git clone https://github.com/antoinebou12/uml-mcp.git
cd uml-mcp
uv sync
uv run python server.py

See Installation for Poetry/pip variants.

Run a self-contained stack with optional local Kroki/PlantUML:

docker compose up -d
# MCP HTTP available at http://127.0.0.1:8000/mcp

See Docker for stdio mode and local backends.


Limitations

What UML-MCP is not

  • Not a graphics editor. It renders diagrams from textual sources; it does not let you draw with a mouse or hand-edit the rendered SVG.
  • Not a Kroki/PlantUML replacement. Rendering is delegated to Kroki, a PlantUML server, or Mermaid.ink. UML-MCP adds the MCP surface, validation, batching, and a fallback chain.
  • Vercel runtime is read-only. The hosted endpoint cannot write files: responses include URL + base64 only. Use a local install when you need output_dir.

Need an end-to-end stack?

Combine UML-MCP with your favourite MCP-aware editor. Cursor and Claude Desktop both work out of the box; see Cursor, Claude Desktop, and Claude Code (plugin + marketplace).


Citation

If UML-MCP helps your research, tooling, or product, please cite the project or star the repo:

@software{uml_mcp,
  author = {Antoine Boucher and contributors},
  title  = {{UML-MCP: Diagram Generation via the Model Context Protocol}},
  url    = {https://github.com/antoinebou12/uml-mcp},
  year   = {2025}
}

Star History Chart


License

UML-MCP is released under the MIT License. You can use, modify, and distribute it freely, including in commercial products, as long as you keep the original copyright and license notice. See the About page for acknowledgements.