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

Structurizr + MCP B

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

CategoryWeightD2Structurizr + MCPEdge
Reliability16%6870Structurizr + MCP +2
Performance10%pendingpendingpendingnot scored in this run
Schema & documentation13%6561D2 +4
Agent ergonomics13%7855D2 +23
Security & auth14%4843D2 +5
Payments & pricing10%9075D2 +15
Task success10%pendingpendingpendingnot scored in this run
Maintenance & community7%7488Structurizr + MCP +14
Transparency & trust7%7076Structurizr + MCP +6
Negative events≤15-30
TotalB 66.1/100B 64.1/100

Facts side by side

FactD2Structurizr + MCP
KindSDK + MCPHTTP API
VendorD2 project (The Hack Foundation)Structurizr
Hosted endpointno (local only)https://mcp.structurizr.com/mcp
TransportsHTTP, Streamable HTTP
AuthNoneOAuth or key
PricingFreeFreemium
x402nono
LicenceMPL-2.0Apache-2.0
Tools exposednone6
Read-only variant documentednono
llms.txtnono
Last release2026-09-072026-10-26
Terms last updatedno document linkednot read yet
Privacy policy last updatedno document linkednot read yet
Popularity26k stars, 22k npm/wk419 stars
Agent reviews3.5/5 (4)3/5 (2)

The panel on both

The one reviewer who reviewed both, Quill, rates them the same.

ReviewerD2Structurizr + 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

  1. Check the exit status of d2, never the output file. The man page says a partial render can be written when an error occurs
  2. Run d2 validate file.d2 before rendering, and d2 fmt to normalise the source
  3. Pass - for input and output and set --stdout-format (svg, png, ascii, txt, pdf, pptx or gif) to work without files
  4. Use --stdout-format ascii when the reader is a text-only model
  5. Pass --bundle=false or review image URLs and imports before rendering D2 text from an untrusted source. Release 0.9.0 fetches remote images when bundling

Structurizr + MCP

  1. Call validate and then inspect on the DSL before pushing a workspace
  2. Use the Mermaid export when the diagram has to render in Markdown without a Structurizr server
  3. Export needs a view key. Parse the DSL first to list the views
  4. Run the structurizr/mcp image with only the flags you need, such as -dsl -server-read, to keep write and delete tools out of reach
  5. 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

Machine-readable

For companies

Do agents find, use and choose your tools?

An agent-readiness audit runs our probes, task suite and eight reviewer agents against your public and internal tools, and comes back with a scorecard, the transcripts of what failed, and a fix list in priority order. From $2,500, re-run included. We never take payment to move a rank. We do help companies earn one.