# Repository Briefing: lukendeasy/open-diagram
> Source: https://repoforai.com/repo/lukendeasy/open-diagram (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/lukendeasy/open-diagram
- **Official Docs / Website**: https://open-diagram.dev
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: A+ (89/100 · Maintenance 35/35 · Adoption 14/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.6.2 (2026-11-25) — https://github.com/lukendeasy/open-diagram/releases
- **Review Snapshot**: 2026-11-29
- **Deployment / Stack Signals**: MCP, CLI
- **Momentum**: 447 ★ total (+8 24h / +57 7d) · 36 forks
- **Topics**: `agent-skills`, `ai-agents`, `architecture-diagrams`, `claude`, `diagrams`, `diagrams-as-code`, `python`, `svg`
- **When to Use**: Best for: Engineering teams that version architecture diagrams alongside code and want CI or a coding agent to catch named layout violations before publishing. Skip if: Authors need direct canvas editing, editable text in exported SVGs, or fully automatic placement without maintaining relative positions.

## Overview
```text
### Architecture & Core Mechanics
open-diagram is an MIT-licensed Python diagram engine exposed as a library, CLI, and MCP server. Authors build up a `Diagram` from panels, tiles, groups, and links. Relative placement methods such as `right_of` establish the arrangement, while fontTools supplies font spacing and kerning to size labels before placement. Validation then checks the resulting geometry. SVG text is drawn as paths, so viewers do not need the bundled Inter font installed.

The package maps the `open-diagram` executable to `open_diagram.cli:run`; the MCP server starts through `open-diagram mcp`. Python is the direct API, JSON provides a declarative input, and Mermaid has an import path. The manifest lists `fonttools>=4.40` and `mcp>=2.3,<3` as runtime dependencies, with `pillow>=9` in the optional `png` extra. MCP is an integration surface for coding agents, not a requirement for the layout engine to run.

### Key Capabilities & Differentiators
The primitives cover software system maps, layered stacks, release pipelines, data models, and business processes. Panels can carry tiles, footers, and statuses; links can carry labels and kinds. The generated legend includes only the statuses and link kinds used in the diagram. v0.6.0 added packaged JSON templates for AWS ETL, AWS architecture, Azure web apps, and GCP event pipelines.

The layout checker identifies the actual objects involved in a violation: it can report the gap between two named panels or identify the link and panel involved in a crossing. Authors can reposition blocks, specify a route with `via_x` or `via_y`, or explicitly permit an intentional crossing with `cross_ok=True`. v0.6.2 adds diagram-wide `routing="orthogonal"` for horizontal and vertical line segments. Orthogonal routing changes the shape of links; it does not remove the need to check the layout.

### Trade-offs & Limitations
Compared with Mermaid or D2, open-diagram asks authors to make more placement decisions. That is useful when a system map needs a specific reading order or tight control over grouping, but adds work for a simple graph that an automatic layout can handle. Mermaid import offers a starting point, not a reason to assume identical output. Compared with draw.io or Excalidraw, the source-first workflow favors reviewable changes over direct canvas editing. Path-based text avoids font substitution but is less convenient to edit as text after export.

`save()` writes output and prints a summary before raising `LayoutError`, so the presence of an SVG is not proof that validation passed. In CI, gate publication on a successful build and keep failed renders only if they are useful for debugging. PNG adds a browser dependency that SVG-only jobs can avoid. MIT covers the project code; check the separate notices for bundled fonts and cloud-provider assets before redistribution.

### Hardware & Deployment Guide
Install with `pip install open-diagram` on Python 3.10 or later. SVG generation does not require a browser. The documented PNG workflow uses Chrome, Chromium, or Microsoft Edge; set `CHROME` if the executable is outside the usual locations. Start the MCP server with `uvx open-diagram mcp`, or register it with Claude Code using `claude mcp add open-diagram -- uvx open-diagram mcp`. A GitHub Action is also available for repository workflows.

v0.6.1 added Windows test coverage alongside Linux and normalized SVG line endings for consistent output across those platforms. v0.6.2 moved MCP into the standard install, kept the empty `mcp` extra for older commands, and added an MCP Registry listing. The rendering stack does not call for a GPU or model VRAM. For a repeatable CI setup, pin the package and decide whether PNG justifies provisioning a browser; initial package retrieval is separate from local rendering.
```

## Key Capabilities
```text
- Font metrics: fontTools supplies spacing and kerning for label measurement; bundled Inter text is rendered as SVG paths.
- Build validation: diagnostics name panels that violate spacing requirements and links that cross panels; `save()` writes files before raising `LayoutError`.
- Routing controls: `routing="orthogonal"` produces right-angle paths; `via_x` and `via_y` can steer individual links.
- Authoring formats: Python and JSON support source-controlled diagrams, and Mermaid import provides a migration starting point.
- Agent integration: `open-diagram mcp` ships in the standard v0.6.2 install, and the server is listed in the MCP Registry.
- Cloud templates: packaged JSON examples include `aws_etl`, `aws_architecture`, `azure_web_app`, and `gcp_event_pipeline`.
```

## Quick Start / Clone
```bash
pip install open-diagram
```
