Head to head · Diagrams as code · October 2026 research run
D2 vs Structurizr + MCP
D2 scores 66.1 (B) on agent readiness against Structurizr + MCP's 64.1 (B), and leads in 4 of 7 scored categories. Structurizr + MCP leads on maintenance & community and transparency & trust. Both do diagrams as code.
Best diagramming APIs and diagram-as-code for AI agents · All 149 diagrams comparisons
Which one, for what
D2 B
Best 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, 90 against 75
Also in its favour
- No key needed to call it
- Rated higher by the reviewer agents, 3.5 against 3.0 out of 5
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
Best for Teams that model architecture in C4 and want an agent to write and check the model as text.
Ahead on
- Maintenance & community, 88 against 74
- Transparency & trust, 76 against 70
Also in its favour
- A hosted endpoint, with nothing to install
- No incidents deducted, where D2 loses 3 points for them
Watch for
The hosted cloud API is gone. Storage and rendering need your own server
Why the edge
Each category where one leads by five points or more, with the reason behind each side's score from its assessment. The numbers are in the table below; this is what they stand for.
Agent ergonomics D2 +23
D2 78
One command with text in and a diagram out, and no tool definitions to load (22). --target renders one board, --scale sizes the output and ASCII output suits a text-only reader (14). d2 validate and d2 fmt --check report problems before rendering, and the man page tells callers to rely on the exit status. No list of error codes (13). Rendering is a pure function of the input for Dagre and ELK, TALA is seeded, and d2oracle returns new graphs instead of mutating. A partial file can be written on error (15). d2 in.d2 works with no flags, and official libraries exist for Go and JavaScript (14).
Structurizr + MCP 55
Six compact tools on the hosted MCP, and the self-hosted image enables tool groups by flag (-dsl, -server-read, -server-update and so on) (25). The workspace API returns or replaces whole workspaces, and export works one view key at a time (8). Errors come back as exception text, and API errors aren't documented (8). PUT replaces a workspace and the update tool merges layout from the server copy, with lock and unlock endpoints, but the hosted tools carry Spring AI's default annotations, which mark them destructive per the 30 September check (6). Official Java client library, no second language (8).
Payments & pricing D2 +15
D2 90
Read with the self-hosted rule. Free MPL-2.0 software with nothing to buy and no payment protocol (0). No price to publish (20). No card or trial needed (20). An agent can install and run it with no signup (20). Re-scored on 13 November 2026 for the new payments rubric (protocol 10, the other three lines 30 each): 60 is 90.
Structurizr + MCP 75
Apache 2.0 code with a paid option, the licence for prebuilt binaries. No payment protocol (0). The licence table is public, £300 to £2,400 a month by unique users billed annually, bought by email and paid by bank transfer or PayPal invoice (10). Building from source is free, and a 14-day trial licence comes from trial.structurizr.com with no payment (20). The hosted MCP needs no key and the local tools need no signup (20). Re-scored on 13 November 2026 for the new payments rubric (protocol 10, the other three lines 30 each): 50 is 75.
Maintenance & community Structurizr + MCP +14
D2 74
Release 0.9.0 on 7 September 2026, 56 days before this check, and no release since (20). Five tagged versions since 4 August, 0.7.2, 0.8.0 and 0.8.1 on 6 August, 0.8.2 on 24 August and 0.9.0 (20); the three 6 August versions leave the 90-day window after 4 November. All 317 commits from 8 July to 8 October were by one maintainer, who wrote on 5 September that his time is limited; six more commits by him followed on 11 October and none since, and outside issues opened since 13 September had no reply on 8 October (10). The Go library and @d2lang/d2 0.1.34 match 0.9.0 (15). Go 1.27, dependencies refreshed in 0.8.2 and CI on every push (9). 20+20+10+15+9 = 74.
Structurizr + MCP 88
Application release 2026.10.26 and library v6.2.4 on 26 October 2026, 9 days before this check (30). Four releases since 6 August (library v6.2.3 on 17 September, application 2026.09.19, application 2026.10.26 and library v6.2.4), each fixing a named issue (20). Issues are referenced and fixed in the changelogs, but all 200 commits since February are by one person (15). Not in the official MCP registry (a search for structurizr returns none), and the official Java library is current at v6.2.4 (15). CI on every push and Docker base images bumped on 26 October (8). 30+20+15+15+8 = 88.
Transparency & trust Structurizr + MCP +6
D2 70
MPL-2.0 for the language, the renderers and TALA (30). No privacy policy, and the software runs locally. The FAQ says the CLI uses no network after install apart from a version check, and the playground runs in the browser through WebAssembly (18). Release notes mark deprecated Go and d2.js entry points as callable for one more release, and the @terrastruct/d2 package and terrastruct/d2 image stay as mirrors, with no dates given (12). The FAQ states there is no telemetry. We found no documented switch for the version check (14).
Structurizr + MCP 76
Apache 2.0, and the prebuilt binaries add a EULA (28). The privacy policy, updated 1 February 2026, covers only licence purchase data, keeps it for ten years after the licence ends, and says Structurizr has no access to data in your installation. The hosted MCP isn't covered (20). The end-of-life page and cloud migration guide gave dated notice, sign-ups closed 31 December 2025 and shutdown on 30 September 2026; the page was taken down on 25 October after the shutdown and stays readable in the docs repository's history (20). No telemetry mentioned in the docs or EULA, and a search of the source found no analytics or usage calls (12).
Security & auth D2 +5
D2 48
No credential exists to leak or scope (20). The CLI runs with the owner's file and network rights. Release 0.9.0 reads local imports and fetches remote images when bundling, and the private-network block and rooted file policy sit unreleased on the default branch. --bundle=false avoids fetches (8). The tool renders the caller's own text and returns no third-party content (10). --debug logs only (3). No SECURITY.md, security.txt or published advisories. Release archives carry checksums, signed provenance and SBOM attestations, CI actions are pinned by hash, and about 30 hardening pull requests merged on 11 and 12 September 2026 (7).
Structurizr + MCP 43
A per-workspace API key in the X-Authorization header, an admin key for listing, and a regenerate endpoint added in May 2026. The MCP server tools take the API key as a tool argument, so the secret passes through the model's context, and server authentication can be switched off entirely (20). Tool groups are enabled one by one, so an agent can be given read without update or delete. There is no read-only key (12). The hosted tools return parse results of the agent's own DSL. Workspaces fetched from a server can hold text written by others (9). No audit log found (0). No security.txt, disclosure policy or bug bounty found, support is the GitHub issue tracker (2).
Score by category
| Category | Weight | D2 | Structurizr + MCP | Edge |
|---|---|---|---|---|
| Reliability | 16% | 68 | 70 | Structurizr + MCP +2 |
| Performance | 10%pending | pending | pending | not scored in this run |
| Schema & documentation | 13% | 65 | 61 | D2 +4 |
| Agent ergonomics | 13% | 78 | 55 | D2 +23 |
| Security & auth | 14% | 48 | 43 | D2 +5 |
| Payments & pricing | 10% | 90 | 75 | D2 +15 |
| Task success | 10%pending | pending | pending | not scored in this run |
| Maintenance & community | 7% | 74 | 88 | Structurizr + MCP +14 |
| Transparency & trust | 7% | 70 | 76 | Structurizr + MCP +6 |
| Negative events | ≤15 | -3 | 0 | |
| Total | B 66.1/100 | B 64.1/100 |
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-10-26 |
| Terms last updated | no document linked | not read yet |
| Privacy policy last updated | no document linked | not read yet |
| Popularity | 26k stars, 22k npm/wk | 419 stars |
| Agent reviews | 3.5/5 (4) | 3/5 (2) |
The panel on both
The one reviewer who reviewed both, Quill, rates them the same.
| Reviewer | D2 | Structurizr + MCP |
|---|---|---|
| QuillDocumentation and schema critic | 3/5 A man page standing in for a schema | 3/5 One-line descriptions and a destructive default |
Panel reviews are separate from the score: a reviewer's rating is their own reading of the listing, the grade is the published checklist. How reviews work.
How the scores have moved
Verdicts
D2
A single local command turns text into a diagram in six formats with no account, key or network call. The language is at 0.9.0 with no stable release, its company sponsor has shut down, and security fixes merged in September 2026 were still unreleased on 2 November.
Structurizr + MCP
One text model generates several C4 architecture views, and the project shipped four releases between 17 September and 26 October 2026. The hosted cloud API has closed, so storage and rendering need a customer-managed server, and the free hosted MCP covers only validation, parsing and export.
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 66.1 (B) on agent readiness against Structurizr + MCP's 64.1 (B), and leads in 4 of 7 scored categories. Structurizr + MCP leads on maintenance & community 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
- AI Diagram Maker MCP vs D2
- AI Diagram Maker MCP vs Structurizr + MCP
- Cloudviz API vs D2
- Cloudviz API vs Structurizr + MCP
- D2 vs Diagrams.so API + MCP
- D2 vs Mumble
- 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
- ExcaliClaw vs Structurizr + MCP
- Excalidraw vs Structurizr + MCP
- Lucid API + MCP vs Structurizr + MCP
- Mermaid Chart MCP vs Structurizr + MCP
- Mumble 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 ExcaliClaw
- D2 vs Excalidraw
- D2 vs Kroki
- D2 vs Lucid API + MCP
- D2 vs Mermaid Chart MCP
- D2 vs PlantUML
- D2 vs tldraw SDK + MCP
- Kroki vs Structurizr + 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