lukendeasy/open-diagram
Python diagram engine with build-time layout checks and an MCP server
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Tracked from daily D1 telemetry snapshots. Hover any data point for exact daily star counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & 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.
save() writes files before raising LayoutError.routing="orthogonal" produces right-angle paths; via_x and via_y can steer individual links.open-diagram mcp ships in the standard v0.6.2 install, and the server is listed in the MCP Registry.aws_etl, aws_architecture, azure_web_app, and gcp_event_pipeline.Engineering teams that version architecture diagrams alongside code and want CI or a coding agent to catch named layout violations before publishing.
Authors need direct canvas editing, editable text in exported SVGs, or fully automatic placement without maintaining relative positions.
Quick Start & Installation
pip install open-diagramComparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| open-diagram ★ | 447 | +57 | Python | MIT | Python diagram engine with build-time layout checks and an MCP server |
| archify | 102k | +2.4k | JavaScript | Apache-2.0 | Agent skill and Node CLI for source-backed, interactive architecture diagrams. |
| diagram-design | 76.8k | +4.4k | HTML | MIT | An Agent Skill for turning diagram prompts into branded HTML and SVG |
| skills | 203k | +3k | Python | — | A Claude Agent Skills catalog for packaging and reusing task workflows |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/lukendeasy/open-diagram.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about open-diagram
Does a project need MCP to generate diagrams?
mcp extra remains for compatibility with older install commands.What runtime resources should we budget for CI?
Can we run it internally and redistribute it commercially?
When should we choose it over Mermaid, D2, or a canvas editor?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy