Skip to content
ReviewRamble

The weekly brief

AI, reviewed, in your inbox.

  • New reviews of tools, models, MCP servers and repos, with the verdict up front
  • Re-checked prices and ratings when something changes
  • New analysis pieces as they are published

Models, agents, MCP servers and the tools actually worth your time.

One email a week. Unsubscribe with the link in any brief. How we use your email

D2

Text-to-diagram language and Go CLI with three bundled layout engines, animated exports and a built-in MCP server for agents.

Reviewed by ReviewRamble editors · Updated

View on GitHub Open source

Share this page:XLinkedInFacebookRedditWhatsAppEmail

Our rating

4.5/5

D2 lays out big architecture diagrams from text more cleanly than Mermaid, and with TALA now free and an MCP server built in, it is a strong first diagram language to teach your agent.

What is D2?

D2 is a diagram scripting language: you write `x -> y -> z` in a text file and the `d2` command renders it. It began at Terrastruct in 2022 and now lives at d2lang/d2 as an independent project fiscally sponsored by Hack Club. It handles flowcharts, architecture diagrams with nested containers, sequence diagrams, SQL tables, UML classes and grids, with themes, a hand-drawn sketch mode and LaTeX labels.

The CLI renders SVG, PNG, GIF, MP4, WebM, PDF, PowerPoint and plain-text diagrams without a browser. It bundles three layout engines: Dagro (a Go port of Dagre), elk-go and TALA, an engine for software architecture that was a paid add-on until it became open source in v0.9.0. Diagrams can hold layers, scenarios and steps that export as animations.

Release v0.10.0 added `d2 lsp` for editors and `d2 mcp`, an MCP server that lets an AI client look up syntax, validate a diagram and render it. Go programs use d2lib, and JavaScript uses the @d2lang/d2 package.

Is D2 worth it?

D2 has two things Mermaid lacks: layout engines that cope with large nested diagrams, and a render pipeline that does not need a browser. TALA, built for software architecture, used to need a licence key; since v0.9.0 on 7 September 2026 it ships inside the open-source binary and the JavaScript package. The repo has 25,983 GitHub stars, 76 contributors and a release cadence that picked up sharply this year after a gap of almost a year between v0.7.1 (August 2025) and v0.8.2 (August 2026).

The v0.10.0 release on 27 November 2026 added the agent tooling. `d2 mcp` exposes syntax lookup, validation and rendering to Claude Code or Codex, so a model can draw, check the PNG and fix the source in a loop. The project also publishes its docs as llms.txt and a formal grammar with conformance cases. Its own benchmarks show a grid of 3,000 rectangles exporting in 159 ms against 8.29 s in v0.9.0. The FAQ says D2 sends no telemetry and goes online only to check GitHub for updates.

The catch is reach. GitHub and most Markdown hosts render Mermaid code blocks natively and do not render D2, so a diagram in a README needs a build step, Kroki or a committed SVG. D2 is still pre-1.0, and the maintainer has warned of one-time breaking renames such as `sequence_diagram` becoming `sequence-diagram`. Animated transitions are labelled alpha, the latest changelog was partly written by AI, as its own notes admit, and 365 issues and pull requests are open.

For a quick flowchart in a pull request description, Mermaid wins on convenience. For architecture docs, conference slides or anything with more than a few dozen boxes, D2's output is cleaner, and its text files diff in review where agent skills such as diagram-design produce HTML you cannot edit by hand.

Where it earns its place

  • A platform engineer documenting 40 services for an internal wiki

    Keep a readable architecture diagram that changes with the code

    Write the system in a .d2 file next to the code, render with --layout=tala in CI using d2lang/setup-d2, and commit the SVG. Free; the TALA engine that once cost money is bundled.

  • A developer who has Claude Code draw diagrams for design docs

    Stop the agent producing broken diagram syntax

    Register d2 mcp with the agent. It looks up syntax, validates the file and renders a PNG it can inspect, then fixes the source. Costs only model tokens.

  • A developer advocate preparing a conference talk

    Turn a system diagram into an animated walkthrough for slides

    Split the diagram into steps, set animate-interval, and export with d2 talk.d2 talk.mp4 or a .pptx. Video export needs FFmpeg 5.1 or newer on the PATH.

Before you commit

Setup
curl -fsSL https://d2lang.com/install.sh | sh -s -- on macOS or Linux, an MSI on Windows, or uvx d2lang with no install. Then d2 hello.d2 writes hello.svg, and d2 --watch opens a live preview.
Integrations
MCP server (d2 mcp, published to the official MCP Registry from v0.10.0), language server, VS Code, Vim and Obsidian plugins, Go library d2lib, @d2lang/d2 for JavaScript, a GitHub Action, and community plugins for MkDocs, Astro, VitePress, Kroki and Confluence.
Data and privacy
Runs locally. Per the FAQ, no telemetry; the only network access after install is a periodic update check against GitHub. MPL-2.0.
Cost at scale
Free for any team; there is no paid tier now that TALA is open source.
Limits
Pre-1.0 syntax with announced breaking changes. Video export needs FFmpeg. GitHub does not render D2 blocks, so diagrams in Markdown need a render step or Kroki.

What’s good

  • TALA, ELK and Dagre layout engines bundled for free
  • Renders SVG, PNG, PDF, PowerPoint, GIF and video without a browser
  • Built-in MCP server and language server
  • Plain-text source that diffs cleanly in review

What’s not

  • Not rendered natively on GitHub, unlike Mermaid
  • Pre-1.0, with breaking renames announced
  • Animated transitions are still alpha
  • 365 open issues and pull requests

Best for

Engineers and technical writers who keep architecture diagrams in a repo and want them readable at scale, drawn by hand or by an agent.

D2 alternatives

Where it fits in the AI stack

D2: common questions

Is D2 worth it?
D2 lays out big architecture diagrams from text more cleanly than Mermaid, and with TALA now free and an MCP server built in, it is a strong first diagram language to teach your agent. We rate it 4.5 out of 5.
How much does D2 cost?
Free and open source (MPL-2.0), including the TALA layout engine since v0.9.0. The project takes sponsorship through Hack Club.
What are the downsides of D2?
Not rendered natively on GitHub, unlike Mermaid; pre-1.0, with breaking renames announced; animated transitions are still alpha; 365 open issues and pull requests.
Who is D2 best for?
Engineers and technical writers who keep architecture diagrams in a repo and want them readable at scale, drawn by hand or by an agent.
How much does D2 cost for a team or in production?
Free for any team; there is no paid tier now that TALA is open source.
Is D2 safe for company data?
Runs locally. Per the FAQ, no telemetry; the only network access after install is a periodic update check against GitHub. MPL-2.0.
What are the best D2 alternatives?
The closest alternatives we have reviewed are LikeC4, Diagram Design, Archify, fireworks-tech-graph and Excalidraw.

Answers checked Nov 28, 2026.

Make D2? Show this rating on your siteD2 rated 4.5 out of 5 on ReviewRamble