This manual walks you through installing, configuring, and using the UML-MCP diagram server with your AI assistant or MCP client.
UML-MCP is a diagram generation server that speaks the Model Context Protocol (MCP). It lets AI assistants (Cursor, Claude Desktop, etc.) create diagrams for you—UML (class, sequence, activity, use case, state, component, deployment, object), Mermaid, D2, Graphviz, ERD, and more—using PlantUML, Kroki, and other backends.
server.py for full control and optional local PlantUML/Kroki.npx -y @smithery/cli install antoinebou12/uml --client claude
Diagrams are generated by the server; the assistant shows you the image or link. For Cursor, use the same Smithery flow or add the server URL in Cursor’s MCP settings (see Configuration below).
Clone and install (from project root):
With uv:
git clone https://github.com/antoinebou12/uml-mcp.git
cd uml-mcp
uv sync
With Poetry:
git clone https://github.com/antoinebou12/uml-mcp.git
cd uml-mcp
poetry install
With pip:
git clone https://github.com/antoinebou12/uml-mcp.git
cd uml-mcp
pip install -e .
python server.py --list-tools
You should see the server name and the diagram tools generate_uml and generate_diagram_url.
python server.py
Default is stdio. For HTTP (e.g. custom hosting):
python server.py --transport http --host 127.0.0.1 --port 8000
See Installation and Deploy to Vercel and Smithery for more options (Docker, Vercel, etc.).
Your client must know how to start UML-MCP (command + args + working directory) or, for HTTP, the server URL.
Config file locations:
| Client | Config file (typical) |
|---|---|
| Cursor | %APPDATA%\Cursor\User\globalStorage\cursor.mcp\mcp.json (Windows) or Cursor Settings → MCP |
| Claude Desktop | %APPDATA%\Claude\claude_desktop_config.json (Windows), ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) |
Example (stdio, local install):
Use the snippets in config/ in this repo and replace /path/to/uml-mcp with your actual path.
Cursor (local server):
{
"mcpServers": {
"UML-MCP-Server": {
"command": "python",
"args": ["C:\\path\\to\\uml-mcp\\server.py"],
"cwd": "C:\\path\\to\\uml-mcp"
}
}
}
Claude Desktop (local server):
{
"mcpServers": {
"uml-mcp": {
"command": "python",
"args": ["C:\\path\\to\\uml-mcp\\server.py"],
"cwd": "C:\\path\\to\\uml-mcp"
}
}
}
server.py in args.cwd must be the project root (folder containing server.py)."command" to that Python (e.g. C:\path\to\uml-mcp\.venv\Scripts\python.exe on Windows).Optional: set where diagrams are saved:
"env": { "MCP_OUTPUT_DIR": "C:\\path\\to\\diagrams" }
Details: config/README.md, Cursor integration, Claude Desktop integration.
| Variable | Description | Default |
|---|---|---|
MCP_OUTPUT_DIR / UML_MCP_OUTPUT_DIR |
Directory for generated diagrams | ./output |
KROKI_SERVER |
Kroki server URL | https://kroki.io |
PLANTUML_SERVER |
PlantUML server URL | http://plantuml-server:8080 |
USE_LOCAL_KROKI |
Use local Kroki (true/false) |
false |
USE_LOCAL_PLANTUML |
Use local PlantUML (true/false) |
false |
LOG_LEVEL |
Logging level | — |
Full list: Configuration.
For offline use or faster rendering, run PlantUML and/or Kroki locally (e.g. with Docker), then set:
export USE_LOCAL_PLANTUML=true
export PLANTUML_SERVER=http://localhost:8080
export USE_LOCAL_KROKI=true
export KROKI_SERVER=http://localhost:8000
Start the containers:
docker run -d -p 8080:8080 plantuml/plantuml-server
docker run -d -p 8000:8000 yuzutech/kroki
Example prompts:
You can be specific (“use PlantUML”, “output as PNG”) or let the assistant choose. Output is typically SVG or PNG; you can set output_dir via MCP_OUTPUT_DIR so files are saved where you want.
| Tool | Purpose |
|---|---|
generate_uml |
Generate a diagram; optionally save to output_dir. Params: diagram_type, code, output_dir, output_format, theme, scale. |
generate_diagram_url |
Return diagram URL and base64 image only (no file). Params: diagram_type, code, output_format, theme, scale. |
Full reference: API / tools.
The default prompts (uml_diagram, uml_diagram_with_thinking) instruct the model to plan first (decide diagram type, purpose, elements, relationships), then output the diagram code and call generate_uml with the chosen diagram_type and final code. The resource uml://workflow describes this flow.
| Category | Types |
|---|---|
| UML | Class, Sequence, Activity, Use Case, State, Component, Deployment, Object |
| Other | Mermaid, D2, Graphviz, ERD, BlockDiag, BPMN, C4 (PlantUML) |
Output formats depend on the type (e.g. PlantUML: png, svg, pdf, txt; Mermaid: svg, png). See Configuration – Output formats and UML diagrams for syntax and examples.
args and cwd in your MCP config.python server.py --list-tools in a terminal from the project root; if it fails, fix the Python environment (version 3.10+, dependencies installed).claude_desktop_config.json is valid JSON and the path to server.py exists.MCP_OUTPUT_DIR (or default ./output) is writable. If the client runs from another directory, use an absolute path.If you added the server via Smithery and get 401 or OAuth errors, the Vercel project may have Deployment Protection enabled. See Vercel & Smithery – Troubleshooting (disable protection or use a bypass token).