UML-MCP
# UML-MCP
[](https://github.com/antoinebou12/uml-mcp/actions/workflows/test.yml)
[](https://github.com/antoinebou12/uml-mcp/actions/workflows/build.yml)
[](https://opensource.org/licenses/MIT)
[](https://www.python.org/downloads/)
<details>
<summary>Project status and links</summary>
[](https://github.com/antoinebou12/uml-mcp/actions/workflows/docs.yml)
[](https://github.com/antoinebou12/uml-mcp/actions/workflows/deploy.yml)
[](https://github.com/antoinebou12/uml-mcp/releases)
[](https://github.com/antoinebou12/uml-mcp/stargazers)
[](https://github.com/antoinebou12/uml-mcp/network/members)
[](https://github.com/antoinebou12/uml-mcp/issues)
[](https://github.com/astral-sh/ruff)
[](https://github.com/astral-sh/uv)
[](https://modelcontextprotocol.io/)
[](https://uml-mcp.vercel.app/mcp)
[](https://mseep.ai/app/antoinebou12-uml-mcp)
</details>
UML-MCP is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for creating and validating diagrams. It supports UML, Mermaid, D2, BPMN, architecture views and other Kroki-backed formats. Connect an MCP client, provide diagram source or describe what you need, and receive a rendered image, URL or editable playground link.
For application development, MCP exposes diagram tools to agents, AG-UI provides a standard event stream for frontends, and OpenUI turns model output into interactive components owned by your application.
| Feature | Details |
| --- | --- |
| Live MCP | [https://uml-mcp.vercel.app/mcp](https://uml-mcp.vercel.app/mcp) |
| Docs | [antoinebou12.github.io/uml-mcp](https://antoinebou12.github.io/uml-mcp/) |
| Catalog | ~37 Kroki-backed diagram types · 5 MCP tools · URL + playground + chat PNG |
| Agent UI | MCP `/mcp` · canonical AG-UI `/ag-ui` · [OpenUI integration guide](docs/integrations/openui.md) |
| Install | `python scripts/install.py` · `uv tool install uml-mcp && uml-mcp setup` · [Installation](docs/installation.md) |
| Console | `uml-mcp admin`: setup form, settings, live logs, charts, Kroki playground ([install](docs/admin/install.md) · [user guide](docs/admin/user-guide.md) · [tour](docs/admin/index.md)) |
<p align="center">
<img src="docs/assets/diagrams/client-server-chat.png" width="720" alt="UML-MCP in chat: Client/Server Mermaid sequence with URL and Playground links" />
</p>
<p align="center"><sub>A diagram preview with links to the rendered image and editable playground (mermaid.live).</sub></p>
## Quick start
### Connect to the hosted server
Add this configuration to your MCP client:
```json
"uml-mcp": {
"transport": "http",
"url": "https://uml-mcp.vercel.app/mcp"
}
```
Connect to the `/mcp` endpoint. Then ask, for example, *“Draw a sequence diagram of a user logging in through an API gateway.”* You can also provide PlantUML, Mermaid or other Kroki source directly.
Repository configurations: [`.cursor/mcp.json`](.cursor/mcp.json) · [`.vscode/mcp.json`](.vscode/mcp.json) · [`.codex/config.toml`](.codex/config.toml).
| Client | Config | Guide |
| --- | --- | --- |
| Cursor | [`.cursor/mcp.json`](.cursor/mcp.json) | [docs/integrations/cursor.md](docs/integrations/cursor.md) |
| VS Code / Copilot | [`.vscode/mcp.json`](.vscode/mcp.json) | [docs/integrations/vscode_copilot.md](docs/integrations/vscode_copilot.md) |
| OpenAI Codex | [`.codex/config.toml`](.codex/config.toml) | [docs/integrations/openai_codex.md](docs/integrations/openai_codex.md) |
| Ollama / Open WebUI | [`config/openwebui_mcp.json`](config/openwebui_mcp.json) | [docs/integrations/ollama.md](docs/integrations/ollama.md) |
| Claude Desktop | [`config/claude_desktop_*.json`](config/) | [docs/integrations/claude_desktop.md](docs/integrations/claude_desktop.md) |
Additional client configurations: [`config/README.md`](config/README.md)
### Install locally
| Method | Command |
| --- | --- |
| Python installer (requires Python, typer and tqdm) | `python scripts/install.py` |
| Setup wizard | `uv tool install uml-mcp && uml-mcp setup` (profile, features, clients, health check) |
| Web setup form | `uml-mcp setup --web` opens the console setup page |
| Manual | `uml-mcp config init --profile local` · `uml-mcp client install --client vscode\|cursor\|claude-desktop\|claude-code` |
Guide: [docs/installation.md](docs/installation.md)
<p align="center">
<img src="docs/assets/admin/desktop-overview.png" width="760" alt="UML-MCP admin console: overview with KPIs, traffic chart and getting-started checklist" />
</p>
<p align="center"><sub>The admin console (<code>uml-mcp admin</code>) includes setup, settings, activity, logs, metrics and plugins, with light and dark themes for desktop and mobile.</sub></p>
<details>
<summary><strong>Run from source (local stdio)</strong></summary>
```bash
git clone https://github.com/antoinebou12/uml-mcp.git
cd uml-mcp
uv sync
uv run python server.py
```
To set the remote for an existing checkout:
```bash
git remote add origin https://github.com/antoinebou12/uml-mcp.git
```
Configs: [`config/README.md`](config/README.md) (Cursor, VS Code, Codex, Claude, Open WebUI, Continue)
</details>
<details>
<summary><strong>Claude Code plugin</strong></summary>
```text
/plugin marketplace add https://github.com/antoinebou12/uml-mcp
/plugin install uml-mcp@uml-mcp-plugins
```
[docs/integrations/claude_code.md](docs/integrations/claude_code.md) · Cursor skill: [`.skill/skills/uml-mcp-diagrams/SKILL.md`](.skill/skills/uml-mcp-diagrams/SKILL.md)
</details>
## Capabilities
Compatible clients discover the diagram workflow with
`skills/list` and load `skill://uml-mcp-diagrams/SKILL.md` through `resources/read`
(one exposed skill; approximately 4316 tokens at connection time). Notation for each diagram type is available in
`.skill/skills/<diagram_type>/SKILL.md` via the [agent-skills index](docs/reference/resources.md#per-type-agent-skills).
See [Skills over MCP](docs/reference/resources.md#diagram-skill-over-mcp).
| Capability | Details |
| --- | --- |
| Diagrams | ~37 types via [Kroki](https://kroki.io/) (UML, Mermaid, D2, TikZ, BPMN, C4, GoAT, UMLet, …) |
| Tools | `generate_uml` · `generate_uml_image` · `validate_uml` · `list_diagram_types` · `generate_uml_batch` |
| Chat | Inline PNG + markdown `` + Playground link |
| Deploy | Local · Docker · Kubernetes ([Helm](deploy/helm/uml-mcp)) · [Vercel](https://vercel.com/) |
| Enterprise | Optional SSO: Microsoft Entra ID / OAuth 2.1 bearer tokens, RFC 9728 metadata, clear 401/403 ([docs/enterprise](docs/enterprise/README.md) · [guide](docs/enterprise/enterprise-guide.md)) |
| Config file | One [`uml-mcp.yaml`](docs/configuration/uml-mcp-yaml.md) (defaults < file < env) · `uml-mcp config init\|show\|validate` · profiles `local` / `docker` / `enterprise` |
| Audit & observability | MXCP-style audit of every tool/resource/prompt call (JSONL rotation, stdout → SIEM) · JSON logs · metrics + Prometheus `/metrics` · rate limits per IP/user/route/tool ([operations](docs/enterprise/operations.md)) |
| Quality | `uml-mcp lint --strict --min-grade A`: mcpx-style grade, token budget, MXCP-style config checks ([rules](docs/developers/linting.md)) |
| Admin console | Setup form, schema-driven settings (save, reset, live apply), activity, live logs, charts, Kroki playground and Docker stack, Stop; local token or `MCP.Admin` ([tour](docs/admin/index.md)) |
| Local Kroki | `uml-mcp kroki up --use`: Kroki + mermaid, blockdiag, bpmn, excalidraw in Docker on `127.0.0.1` ([guide](docs/admin/install.md#4-run-kroki-with-every-companion-docker)) |
| Plugins | Extra MCP tools and diagram renderers from Python packages, allow-listed in `plugins.enabled` ([guide](docs/plugins/index.md) · [author](docs/plugins/authoring.md)). Includes interactive D3 force, cloud architecture and topology diagrams ([D3 plugin](docs/plugins/d3.md)) |
| Tracing | Optional OpenTelemetry spans per request and MCP call (`uml-mcp[otel]`) |
| Frontend | Canonical AG-UI SSE for agent UIs; OpenUI can consume AG-UI and render generated components in your app |
<details>
<summary><strong>MCP tools</strong></summary>
| Tool | Purpose |
| --- | --- |
| `generate_uml` | Render one diagram; tool text includes image markdown, URL, Playground. Use `png` for ImageContent. |
| `generate_uml_image` | Inline chat image (default PNG); fetches bytes even under hosted `MCP_URL_ONLY` |
| `validate_uml` | Local checks; `strict` for Mermaid/D2 (rejects semicolon-packed `sequenceDiagram`) |
| `list_diagram_types` | Catalog (like `uml://types`) |
| `generate_uml_batch` | Many diagrams (`MCP_BATCH_MAX_ITEMS`, `MCP_BATCH_CONCURRENCY`) |
Smoke prompts: [`tests/prompts/chatgpt_mcp_smoke_test.md`](tests/prompts/chatgpt_mcp_smoke_test.md)
</details>
<details>
<summary><strong>Resources (<code>uml://</code>)</strong></summary>
| Resource | Description |
| --- | --- |
| `uml://types` | Types, backends, formats |
| `uml://templates` / `uml://examples` | Starters and samples |
| `uml://formats` / `uml://capabilities` | Formats and validation matrix |
| `uml://server-info` / `uml://workflow` | Version/tools and plan-then-generate |
| `skill://uml-mcp-diagrams/SKILL.md` | Diagram workflow skill (MCP Skills / `resources/read`) |
</details>
<details>
<summary><strong>Diagram types</strong></summary>
| Category | Examples |
| --- | --- |
| UML | Class, Sequence, Activity, Use Case, State, Component, Deployment, Object |
| General | Mermaid, D2, Graphviz, ERD, BlockDiag, BPMN, C4 |
| Specialized | TikZ, Excalidraw, GoAT, UMLet, Nomnoml, Pikchr, Structurizr, SVGBob, WaveDrom, WireViz, … |
[docs/diagrams/index.md](docs/diagrams/index.md)
</details>
<details>
<summary><strong>Remote vs local</strong></summary>
| | Remote (Vercel) | Local |
| --- | --- | --- |
| Transport | HTTP MCP | stdio or HTTP |
| File writes | No | Optional |
| Chat images | PNG tools fetch bytes under URL-only | Same + optional disk |
| Env | Server-side | Your `.env` |
</details>
<details>
<summary><strong>Deployment</strong></summary>
For Vercel, connect the repository and configure clients to use `https://<project>.vercel.app/mcp`.
Docker:
```bash
docker compose up -d
docker build -t uml-mcp . && docker run -p 8000:8000 uml-mcp
docker run -i uml-mcp python server.py --transport stdio
# self-hosted PlantUML + mermaid.ink fallbacks next to local Kroki
MCP_DIAGRAM_FALLBACK=true USE_LOCAL_PLANTUML=true USE_LOCAL_MERMAID_INK=true docker compose --profile fallback up -d
```
[docs/deploy/docker.md](docs/deploy/docker.md)
Kubernetes with SSO: `helm upgrade --install uml-mcp deploy/helm/uml-mcp --set auth.mode=jwt …` (Entra ID or any OIDC provider); add `--set kroki.enabled=true --set plantuml.enabled=true --set mermaidInk.enabled=true` to run the renderers in-cluster. Guide: [docs/enterprise](docs/enterprise/README.md).
</details>
<details>
<summary><strong>Configuration (local)</strong></summary>
| Variable | Default |
| --- | --- |
| `KROKI_SERVER` | `https://kroki.io` |
| `PLANTUML_SERVER` | `http://plantuml-server:8080` |
| `MERMAID_INK_SERVER` | `https://mermaid.ink` |
| `MCP_OUTPUT_DIR` | `./output` |
| `MCP_READ_ONLY` | `false` |
| `MCP_URL_ONLY` | see [docs/configuration.md](docs/configuration.md) |
| `MCP_BATCH_MAX_ITEMS` | `20` |
| `MCP_BATCH_CONCURRENCY` | `4` |
| `MCP_RATE_LIMIT_PER_MINUTE` | `0` |
| `UML_MCP_CONFIG` | discovered `uml-mcp.yaml` (`none` disables) |
| `ADMIN_EMAIL` | unset (hosted `/admin` login off), see [docs/admin/hosted-vercel.md](docs/admin/hosted-vercel.md) |
| `ADMIN_PASSWORD_HASH` / `ADMIN_PASSWORD` | unset; the hash is preferred |
| `ADMIN_SESSION_SECRET` | unset; at least 32 characters, required for the login |
All configuration options: [docs/configuration.md](docs/configuration.md) · single file: [docs/configuration/uml-mcp-yaml.md](docs/configuration/uml-mcp-yaml.md)
</details>
<details>
<summary><strong>Architecture and layout</strong></summary>
Assistant → `generate_uml` / `generate_uml_image` → Kroki (+ fallbacks) → `url`, `playground`, optional image bytes.
<p align="center">
<img src="docs/assets/diagrams/mcp-request-flow.svg" width="100%" style="max-width: 900px;" alt="MCP request flow" />
</p>
```text
server.py / app.py -- MCP + FastAPI (/mcp)
mcp_core/tools/ -- generate_uml, generate_uml_image, validate, batch
tools/kroki/ -- Kroki, PlantUML, Mermaid, D2
```
AG-UI clients use `POST /ag-ui`. The legacy direct-render endpoint is `POST /ag-ui/generate`. See [frontend integration](docs/integrations/frontend.md) and [OpenUI + UML-MCP](docs/integrations/openui.md).
</details>
<details>
<summary><strong>Development</strong></summary>
```bash
uv sync --all-groups
uv run pytest tests/ -v
uv run ruff check . && uv run ruff format --check .
make ci
```
Serve the documentation locally with `uv run mkdocs serve`, then open http://127.0.0.1:8000.
</details>
<details>
<summary><strong>Enterprise SSO: OAuth 2.1 · OpenID Connect · Microsoft Entra ID</strong></summary>
Enterprise SSO is optional and disabled by default (`MCP_AUTH_MODE=none`). The public Vercel endpoint is open.
| Topic | Summary |
| --- | --- |
| Modes | `jwt`: validate Entra / OIDC access tokens (resource server) · `entra-proxy`: adds RFC 8414 + RFC 7591 facade with S256-only PKCE for DCR clients |
| OAuth 2.1 | Authorization Code + PKCE S256; header-only bearer tokens; 401 → `WWW-Authenticate: Bearer resource_metadata, scope`; 403 `insufficient_scope` step-up |
| OpenID Connect | Discovery + JWKS for signing keys; ID tokens are rejected, access tokens only |
| Entra ID | v2 tokens (`requestedAccessTokenVersion: 2`), `mcp.read` / `mcp.write` / `.default`, app roles, VS Code + Visual Studio pre-authorized ([setup](docs/enterprise/entra-id.md)) |
| MSAL | Client side only (VS Code, Visual Studio, Azure CLI, daemons); examples in [OAuth/OIDC/MSAL](docs/enterprise/oauth-oidc.md) |
| Try it | [`tests/http/entra-auth.http`](tests/http/entra-auth.http) · `python -m mcp_core.auth generate az-script` · [checklist](docs/enterprise/checklist.md) |
</details>
## Community
> If this survives a real production repo, it beats a lot of polished launch demos.
Source: [@AIDailyGems](https://x.com/AIDailyGems/status/2060894196777509037) on [antoinebou12/uml-mcp](https://github.com/antoinebou12/uml-mcp)
Daily and monthly activity (stars, forks, merged PRs, issues): [trendshift.io/repositories/42725](https://trendshift.io/repositories/42725)
## Links
| Resource | Links |
| --- | --- |
| Docs | [Site](https://antoinebou12.github.io/uml-mcp/) · [Cursor](docs/integrations/cursor.md) · [Claude Code](docs/integrations/claude_code.md) · [Frontend](docs/integrations/frontend.md) · [Enterprise SSO](docs/enterprise/README.md) · [OpenUI](docs/integrations/openui.md) |
| Contribute | [CONTRIBUTING.md](CONTRIBUTING.md) · [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) · [SECURITY.md](SECURITY.md) |
| License | [MIT](LICENSE) |
Maintained by [Antoine Boucher](https://github.com/antoinebou12). Built on [PlantUML](https://plantuml.com/), [Kroki](https://kroki.io/), [Mermaid](https://mermaid.js.org/), and [D2](https://d2lang.com/).
TDQS
Scored across 4 tools
Each tool serves a distinct function: validation, listing supported types, single generation, and batch generation. There is no overlap or ambiguity between them, making it easy for an agent to select the right tool.
All tool names follow a consistent snake_case verb_noun pattern: validate_uml, list_diagram_types, generate_uml, generate_uml_batch. The two generate tools share a clear prefix, and the batch suffix differentiates them predictably.
With only 4 tools, the server is tightly scoped to its purpose of UML/diagram generation. Each tool earns its place, covering validation, type discovery, and both single and batch generation without unnecessary bloat.
The tool surface fully covers the core workflow: discover supported types, validate code, generate a diagram, and generate multiple at once. Since generation is stateless, there are no missing lifecycle operations; the set is complete for its stated purpose.