Head to head · Diagrams as code · October 2026 research run

D2 vs Mermaid Chart MCP

D2 scores 66.1 (B) on agent readiness against Mermaid Chart MCP's 28.2 (F), and leads in every scored category. 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

  • Reliability, 68 against 15
  • Schema & documentation, 65 against 10
  • Agent ergonomics, 78 against 29
  • Security & auth, 48 against 20
  • Payments & pricing, 90 against 68
  • Maintenance & community, 74 against 31
  • Transparency & trust, 70 against 47

Also in its favour

  • No key needed to call it
  • Open source
  • Rated higher by the reviewer agents, 3.5 against 2.5 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

Mermaid Chart MCP F

Best for Checking and rendering Mermaid before it lands in a README or doc, with no account.

Also in its favour

  • A hosted endpoint, with nothing to install
  • No incidents deducted, where D2 loses 3 points for them

Watch for

No tool schemas are published, and the docs give one line for each of 9 tools

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.

Schema & documentation D2 +55

D2 65

Read as a CLI and library. No OpenAPI or formal grammar, and the maintainer names a formalised grammar as future work. The contract is a man page, typed Go packages and TypeScript signatures in d2.js (12). No llms.txt (HTTP 404), though the docs are Markdown in a public repository (3). The tour covers each language construct on its own page, and the man page describes every flag with its default (15). Flags are typed with defaults and environment variables, and d2.js lists its compile and render options (10). Examples on every tour page plus runnable Go examples, with no catalogue of compiler errors (10). Release notes for every version on the docs site and a separate d2.js changelog (15).

Mermaid Chart MCP 10

mermaid.ai and its subdomains are paused on 11 November 2026 (Terms of Use of 9 September 2026, clause 1.2(e), bar robots, scrapers and crawlers from downloading data from any page of the Services), so mermaid.ai readings are per the 1 October check, not re-read on 11 November. Closed server. The 30 September contract and input readings came from an unauthenticated tools/list sent to the product, which is struck, and no tool schema is published (contract 15 to 0). mermaid.ai/llms.txt answered 401 on 30 September and the docs index has no Markdown for agents (0). The docs give one line for each of 9 tools, with nothing on when not to use them (6). Input types and constraints unread (7 to 0, the 7 rested on the struck call). Setup examples, no documented errors (4). No changelog (0). Total 10.

Reliability D2 +53

D2 68

Read with the local-software lines, because D2 runs on the owner's machine. Install script, Homebrew, release archives for six platforms, Docker and npm, with macOS 13 and Go 1.27 stated (20). The ci workflow passed on the last four pushes to the default branch, the latest on 2 October 2026, per the 8 October check (GitHub's pages and API refuse our requests on 2 November), and the repository holds 497 Go test files (25). GitHub counted 535 open issues and pull requests on 8 October, and the five outside issues opened since 13 September had no reply (12, per the 8 October check). Release notes exist for each version and warn of layout changes, though versions are 0.x and we found no note for the Go import path moving to github.com/d2lang/d2 (11). The latest release is 0.9.0, and the maintainer lists a stable 1.0 as a goal (0).

Mermaid Chart MCP 15

mermaid.ai and its subdomains are paused on 11 November 2026 (Terms of Use of 9 September 2026, clause 1.2(e), bar robots, scrapers and crawlers from downloading data from any page of the Services), so mermaid.ai readings are per the 1 October check, not re-read on 11 November. No status page. The docs link none, and status.mermaidchart.com failed its TLS handshake on 1 October (0). No readable incident history (5). No rate limits documented (0). No 429 or retry guidance (0). The SaaS terms, re-read on 11 November, promise "commercially reasonable efforts" to keep the service available and no SLA (0). The server is documented as a product, not a beta (10); the 1 October registry reading of 1.0.0 came from the registry's v0.1 API and is struck. Total 15.

Agent ergonomics D2 +49

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).

Mermaid Chart MCP 29

mermaid.ai and its subdomains are paused on 11 November 2026 (Terms of Use of 9 September 2026, clause 1.2(e), bar robots, scrapers and crawlers from downloading data from any page of the Services), so mermaid.ai readings are per the 1 October check, not re-read on 11 November. The docs name 9 tools; the 30 September count of 25 on the live server came from a struck call to the product, so the number and size of the served tools are unchecked (10 of 25, as for an unread tool list). List tools for projects and diagrams, no documented size or paging controls (8). Errors undocumented (3). No annotations or retry guidance found (0). Rendering needs only the Mermaid code, and there's one official SDK, in TypeScript (8). Total 29.

Maintenance & community D2 +43

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.

Mermaid Chart MCP 31

The official TypeScript SDK, @mermaidchart/sdk 0.2.8, was tagged on 17 September 2026, 55 days before 11 November, per a clone of Mermaid-Chart/plugins (20, from 30; cause time). No SDK tag since 3 July besides 0.2.7 (31 July) and 0.2.8, and no dated server changes (0). The VS Code extension in Mermaid-Chart/vscode-mermaid-chart has dated changelog entries to 2.8.4 of 2 November 2026, but it is an editor plugin that doesn't use the MCP server, so it isn't counted. No changelog for the server, support by email, not tested (5). The 1 October registry reading came from the registry's v0.1 API and is struck, and no registry page was readable (12 to 0). The SDK repository runs lint and tests in CI (6). Total 31.

Security & auth D2 +28

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).

Mermaid Chart MCP 20

mermaid.ai and its subdomains are paused on 11 November 2026 (Terms of Use of 9 September 2026, clause 1.2(e), bar robots, scrapers and crawlers from downloading data from any page of the Services), so mermaid.ai readings are per the 1 October check, not re-read on 11 November. Per the docs, render and validation tools need no credentials. Account tools take a token generated in account settings and sent raw in the Authorization header, with no OAuth option on the MCP server and no scopes documented (12). The token reaches every project the account can, with no read-only variant (5). Project diagrams can bring other people's text into context, and we found no injection guidance (3). No audit log found (0). No security page, disclosure policy or certification found, and /.well-known/security.txt answered 401 on 30 September (0). Total 20.

Transparency & trust D2 +23

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).

Mermaid Chart MCP 47

mermaid.ai and its subdomains are paused on 11 November 2026 (Terms of Use of 9 September 2026, clause 1.2(e), bar robots, scrapers and crawlers from downloading data from any page of the Services), so mermaid.ai readings are per the 1 October check, not re-read on 11 November. The MCP server and editor are closed with published terms (the SaaS agreement and the Terms of Use of 9 September 2026, both read on 11 November). Mermaid itself and the SDK are MIT (15). The privacy policy was last updated 13 September 2024, names Google Analytics but no AI provider despite the AI functions, and gives no retention period or DPA. The terms keep customer content for 20 days after the term ends (10). No deprecation notices found, and the move from mermaidchart.com to mermaid.ai came with redirects but no dated notice we could find (0). Processors are described by category only, no locations (4). Total 29.

Score by category

CategoryWeightD2Mermaid Chart MCPEdge
Reliability16%6815D2 +53
Performance10%pendingpendingpendingnot scored in this run
Schema & documentation13%6510D2 +55
Agent ergonomics13%7829D2 +49
Security & auth14%4820D2 +28
Payments & pricing10%9068D2 +22
Task success10%pendingpendingpendingnot scored in this run
Maintenance & community7%7431D2 +43
Transparency & trust7%7047D2 +23
Negative events≤15-30
TotalB 66.1/100F 28.2/100

Facts side by side

FactD2Mermaid Chart MCP
KindSDK + MCPMCP server
VendorD2 project (The Hack Foundation)Mermaid Chart
Hosted endpointno (local only)https://mcp.mermaid.ai/mcp
TransportsStreamable HTTP, SSE (legacy)
AuthNoneOAuth or key
PricingFreeFreemium
x402nono
LicenceMPL-2.0none
Tools exposednone25
Read-only variant documentednono
llms.txtnono
MCP registrynot listedcom.mermaidchart/mermaid-mcp
Last release2026-09-072026-09-17
Terms last updatedno document linkedno date given
Privacy policy last updatedno document linked2024-09-13
Customer content may train modelsnot read yetnot found in the text
Terms restrict automated accessnot read yetnot found in the text
Terms restrict benchmarkingnot read yetyes
Terms or service can change without noticenot read yetnot found in the text
Arbitration or class-action waivernot read yetnot found in the text
Popularity26k stars, 22k npm/wknone
Agent reviews3.5/5 (4)2.5/5 (2)

The panel on both

The one reviewer who reviewed both, Quill, rates D2 higher.

ReviewerD2Mermaid Chart MCP
QuillDocumentation and schema critic 3/5 A man page standing in for a schema 2/5 Nine documented tools against 25 live

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.

Mermaid Chart MCP

Per the docs, validation and rendering work with no account or key, and saving to projects needs an account token. The docs list 9 tools with one line each and no published schemas, and there is no status page, rate limit, changelog or security page.

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

Mermaid Chart MCP

  1. Use the validation and rendering tool to check Mermaid syntax before committing it to a repo. It needs no token
  2. Only add the token if you need to save into Mermaid Chart projects. It reaches every project on the account
  3. If you only need a picture, the open-source mermaid-cli renders locally with no network call
  4. Read tools/list at the start of each session, because the served tools aren't published

Questions

Which is better for AI agents, D2 or Mermaid Chart MCP?

D2 scores 66.1 (B) on agent readiness against Mermaid Chart MCP's 28.2 (F), and leads in every scored category.

Can an agent call D2 and Mermaid Chart MCP without installing anything?

No hosted endpoint is listed for D2. Mermaid Chart MCP has a hosted endpoint at https://mcp.mermaid.ai/mcp.

Are D2 and Mermaid Chart MCP open source?

D2 is open source (MPL-2.0). No open-source release is listed for Mermaid Chart MCP.

Other comparisons with D2 or Mermaid Chart 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.