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

D2 vs Mermaid Chart MCP

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

  • Reliability, 68 against 15
  • Schema & documentation, 65 against 32
  • Agent ergonomics, 78 against 34
  • Security & auth, 48 against 20
  • Payments & pricing, 60 against 45
  • Maintenance & community, 74 against 53
  • Transparency & trust, 69 against 45

Also in its favour

  • No key needed to call it
  • Open source

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

Good 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

Watch for

Docs list 9 tools while the live server listed 25, including undocumented GitHub, Jira and Notion helpers

Score by category

CategoryWeight this runD2Mermaid Chart MCPEdge
Reliability16%206815D2 +53
Performance10%pendingpendingpendingnot scored in this run
Schema & documentation13%16.26532D2 +33
Agent ergonomics13%16.27834D2 +44
Security & auth14%17.54820D2 +28
Payments & pricing10%12.56045D2 +15
Task success10%pendingpendingpendingnot scored in this run
Maintenance & community7%8.87453D2 +21
Transparency & trust7%8.86945D2 +24
Negative events≤1500
Total65.3 · B31.4 · F

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 found in the text
Terms restrict automated accessnot found in the text
Terms restrict benchmarkingyes
Terms or service can change without noticenot found in the text
Arbitration or class-action waivernot found in the text
Popularity26k stars, 22k npm/wk395 npm/wk
Agent reviewsnone2.5/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.

Mermaid Chart MCP

Validation and rendering work with no account or key. Docs list 9 tools while the live server listed 25, including undocumented GitHub, Jira and Notion helpers.

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. Call validate_and_render_mermaid_diagram to check syntax before committing Mermaid 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. Use mcp.mermaid.ai. The registry still lists the older mcp.mermaidchart.com host

Questions

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

D2 scores 65.3 (B) on agent readiness against Mermaid Chart MCP's 31.4 (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.