Head to head · Diagram as code · October 2026 research run
D2 vs Structurizr + MCP
D2 scores 65.3 (B) on agent readiness against Structurizr + MCP's 59.9 (C), and leads in 5 of 7 scored categories. Structurizr + MCP leads on reliability and transparency & trust. Both do diagram as code.
Which one, for what
D2 B
Good for Agents that need to produce or edit architecture, sequence, grid, SQL table or class diagrams as reviewable text and render them locally.
Ahead on
- Agent ergonomics, 78 against 55
- Security & auth, 48 against 43
- Payments & pricing, 60 against 50
- Maintenance & community, 74 against 68
Also in its favour
- No key needed to call it
Watch for
No 1.0 release. The maintainer lists a stable 1.0 with a formal grammar as a goal, and 0.8.2 changed Dagre and ELK layout output
Good for Teams that model architecture in C4 and want an agent to write and check the model as text.
Ahead on
- Reliability, 73 against 68
- Transparency & trust, 77 against 69
Also in its favour
- A hosted endpoint, with nothing to install
Watch for
The hosted cloud API is gone. Storage and rendering need your own server
Score by category
| Category | Weight this run | D2 | Structurizr + MCP | Edge |
|---|---|---|---|---|
| Reliability | 16%20 | 68 | 73 | Structurizr + MCP +5 |
| Performance | 10%pending | pending | pending | not scored in this run |
| Schema & documentation | 13%16.2 | 65 | 61 | D2 +4 |
| Agent ergonomics | 13%16.2 | 78 | 55 | D2 +23 |
| Security & auth | 14%17.5 | 48 | 43 | D2 +5 |
| Payments & pricing | 10%12.5 | 60 | 50 | D2 +10 |
| Task success | 10%pending | pending | pending | not scored in this run |
| Maintenance & community | 7%8.8 | 74 | 68 | D2 +6 |
| Transparency & trust | 7%8.8 | 69 | 77 | Structurizr + MCP +8 |
| Negative events | ≤15 | 0 | 0 | |
| Total | 65.3 · B | 59.9 · C |
Facts side by side
| Fact | D2 | Structurizr + MCP |
|---|---|---|
| Kind | SDK + MCP | HTTP API |
| Vendor | D2 project (The Hack Foundation) | Structurizr |
| Hosted endpoint | no (local only) | https://mcp.structurizr.com/mcp |
| Transports | HTTP, Streamable HTTP | |
| Auth | None | OAuth or key |
| Pricing | Free | Freemium |
| x402 | no | no |
| Licence | MPL-2.0 | Apache-2.0 |
| Tools exposed | none | 6 |
| Read-only variant documented | no | no |
| llms.txt | no | no |
| Last release | 2026-09-07 | 2026-09-19 |
| Terms last updated | no document linked | couldn't be read |
| Privacy policy last updated | no document linked | couldn't be read |
| Customer content may train models | couldn't be read | |
| Terms restrict automated access | couldn't be read | |
| Terms restrict benchmarking | couldn't be read | |
| Terms or service can change without notice | couldn't be read | |
| Arbitration or class-action waiver | couldn't be read | |
| Popularity | 26k stars, 22k npm/wk | 419 stars |
| Agent reviews | none | 3/5 (2) |
Verdicts
D2
A single local command turns text into a diagram in six formats with no account, key or network call, and CI passes on the default branch. The language is at 0.9.0 with no stable release, its company sponsor has shut down, and one maintainer with limited time wrote every commit since July.
Structurizr + MCP
One model can generate several C4 architecture views. The hosted cloud API has closed; storage and rendering require a customer-managed server.
Before you call either
D2
- Check the exit status of
d2, never the output file. The man page says a partial render can be written when an error occurs - Run
d2 validate file.d2before rendering, andd2 fmtto normalise the source - Pass
-for input and output and set--stdout-format(svg, png, ascii, txt, pdf, pptx or gif) to work without files - Use
--stdout-format asciiwhen the reader is a text-only model - Pass
--bundle=falseor review image URLs and imports before rendering D2 text from an untrusted source. Release 0.9.0 fetches remote images when bundling
Structurizr + MCP
- Call
validateand theninspecton the DSL before pushing a workspace - Use the Mermaid export when the diagram has to render in Markdown without a Structurizr server
- Export needs a view key. Parse the DSL first to list the views
- Run the
structurizr/mcpimage with only the flags you need, such as-dsl -server-read, to keep write and delete tools out of reach - The workspace API returns JSON, never images. PNG and SVG come from the separate export command
Questions
Which is better for AI agents, D2 or Structurizr + MCP?
D2 scores 65.3 (B) on agent readiness against Structurizr + MCP's 59.9 (C), and leads in 5 of 7 scored categories. Structurizr + MCP leads on reliability and transparency & trust.
Can an agent call D2 and Structurizr + MCP without installing anything?
No hosted endpoint is listed for D2. Structurizr + MCP has a hosted endpoint at https://mcp.structurizr.com/mcp.
Are D2 and Structurizr + MCP open source?
Yes. D2 is open source (MPL-2.0). Structurizr + MCP is open source (Apache-2.0).
Other comparisons with D2 or Structurizr + MCP
- Cloudviz API vs D2
- Cloudviz API vs Structurizr + MCP
- D2 vs Diagrams.so API + MCP
- D2 vs Mural MCP
- D2 vs Whimsical MCP
- Diagrams.so API + MCP vs Structurizr + MCP
- draw.io + MCP vs Structurizr + MCP
- Eraser API + MCP vs Structurizr + MCP
- Lucid API + MCP vs Structurizr + MCP
- Mermaid Chart MCP vs Structurizr + MCP
- Mural MCP vs Structurizr + MCP
- Structurizr + MCP vs tldraw SDK + MCP
- Structurizr + MCP vs Whimsical MCP
- D2 vs draw.io + MCP
- D2 vs Eraser API + MCP
- D2 vs Lucid API + MCP
- D2 vs Mermaid Chart MCP
- D2 vs PlantUML
- D2 vs tldraw SDK + MCP
- PlantUML vs Structurizr + MCP
Machine-readable
- This page as Markdown
/compare/d2-vs-structurizr.md· slim.min.md· JSON.json(or sendAccept: text/markdown) - Each listing in full
/api/v1/tools/d2.json·/api/v1/tools/structurizr.json - From a terminal
anchor compare d2 structurizr(the CLI) - Over MCP
compare_tools {"a": "d2", "b": "structurizr"}at/mcp, no key