Generate UML and other diagrams from AI assistants via the Model Context Protocol. Supports 30+ diagram types through Kroki, PlantUML, Mermaid, and D2.
Live: MCP endpoint | Add via Smithery
- 30+ diagram types -- UML (Class, Sequence, Activity, Use Case, State, Component, Deployment, Object), Mermaid, D2, Graphviz, TikZ, ERD, BlockDiag, BPMN, C4, and more via Kroki
- MCP integration -- works with Cursor, Claude Desktop, and any MCP client
- Multiple output formats -- SVG, PNG, PDF, JPEG, base64 (varies by diagram type)
- Automatic fallback -- Kroki first, then PlantUML server or Mermaid.ink if unavailable
- Read-only mode --
MCP_READ_ONLY=truedisables file writes (URL + base64 only) - Flexible deployment -- stdio, HTTP, Vercel serverless, Docker, or Smithery
# Via Smithery (one command)
npx -y @smithery/cli install antoinebou12/uml --client claude
# Or manually
git clone https://github.com/antoinebou12/uml-mcp.git && cd uml-mcp
uv sync # recommended
# poetry install # alternative
# pip install -e . # alternativeThe published package installs mcp_core and tools only. The ai_uml/ tree remains in the repository for research; it is not part of the installable distribution.
# MCP stdio transport (default)
uv run python server.py
# HTTP transport
uv run python server.py --transport http --port 8000
# List tools and exit
uv run python server.py --list-toolsCopy the appropriate snippet from config/ into your client:
- Cursor:
config/cursor_config.json - Claude Desktop:
config/claude_desktop_config.json
Replace /path/to/uml-mcp with the actual path. See config/README.md for config file locations.
| Category | Types |
|---|---|
| UML (PlantUML) | Class, Sequence, Activity, Use Case, State, Component, Deployment, Object |
| General | Mermaid, D2, Graphviz, ERD, BlockDiag, BPMN, C4 |
| Specialized | TikZ, Excalidraw, Nomnoml, Pikchr, Structurizr, SVGBob, WaveDrom, WireViz, and more |
Full list with supported output formats: run python server.py --list-tools or query uml://formats.
Tools:
generate_uml-- generate a diagram and optionally save to diskgenerate_diagram_url-- return diagram URL + base64 without file writesvalidate_uml-- structural validation before render (no network by default)
Resources (via uml:// URIs):
types, templates, examples, formats, capabilities, server-info, mermaid-examples, bpmn-guide, workflow
The repo includes vercel.json pre-configured for serverless deployment:
- Connect this repo to Vercel
- Your MCP URL:
https://<project>.vercel.app/mcp(use/mcppath, not root) - Vercel uses read-only filesystem -- diagrams are returned as URLs/base64
After deploying to Vercel:
- Go to smithery.ai/new, choose URL
- Enter
https://<project>.vercel.app/mcp - Set display name, description, and homepage in Settings
See docs/integrations/vercel_smithery.md for detailed instructions and troubleshooting.
docker compose up -d # full stack with Kroki + PlantUML
# or standalone:
docker build -t uml-mcp . && docker run -p 8000:8000 uml-mcp| Variable | Description | Default |
|---|---|---|
KROKI_SERVER |
Kroki server URL | https://kroki.io |
PLANTUML_SERVER |
PlantUML server URL | http://plantuml-server:8080 |
MCP_OUTPUT_DIR |
Diagram output directory | ./output |
MCP_READ_ONLY |
Disable file writes | false |
MCP_MAX_CODE_LENGTH |
Max diagram code length | 500000 |
USE_LOCAL_KROKI |
Use local Kroki instance | false |
USE_LOCAL_PLANTUML |
Use local PlantUML instance | false |
Full options: docs/configuration.md
server.py -- MCP entry point (stdio/HTTP)
app.py -- FastAPI REST API + MCP HTTP at /mcp
api/app.py -- Vercel serverless wrapper
mcp_core/
core/ -- config, server, CLI, utilities, diagram pipeline
tools/ -- generate_uml, generate_diagram_url, validate_uml
prompts/ -- diagram generation prompts
resources/ -- uml:// resource handlers
tools/kroki/ -- Kroki, PlantUML, Mermaid, D2 clients
ai_uml/ -- research code in the repo only; **not** shipped in the PyPI wheel (see docs/ai_uml.md)
Fallback strategy: Kroki (primary) -> PlantUML server (UML types) / Mermaid.ink (Mermaid) -> error with details.
# Install dev dependencies
uv sync --all-groups
# Run tests
uv run pytest tests/ -v
# Lint
uv run ruff check . && uv run ruff format --check .
# Integration tests (requires real FastMCP)
USE_REAL_FASTMCP=1 uv run pytest tests/integration -v
# Local CI
make ci- Online: antoinebou12.github.io/uml-mcp
- Local:
uv run mkdocs servethen open http://127.0.0.1:8000
