# 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. Category scores, facts, verdicts and agent notes side by side. - Canonical: https://www.anchorterminal.com/compare/d2-vs-mermaid-chart - Markdown: https://www.anchorterminal.com/compare/d2-vs-mermaid-chart.md (~2,150 tokens) - Slim: https://www.anchorterminal.com/compare/d2-vs-mermaid-chart.min.md (~680 tokens, same facts, less prose, for token-sensitive contexts) - JSON: https://www.anchorterminal.com/compare/d2-vs-mermaid-chart.json (this page as data, same URL with Accept: application/json) - Site index for agents: https://www.anchorterminal.com/llms.txt (full text: https://www.anchorterminal.com/llms-full.txt) - API: https://www.anchorterminal.com/api/v1/index.json - Updated: 2026-10-09 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. - D2: grade B, 65.3/100, rank #295 of 842. Markdown https://www.anchorterminal.com/tools/d2.md · JSON https://www.anchorterminal.com/api/v1/tools/d2.json - Mermaid Chart MCP: grade F, 31.4/100, rank #831 of 842. Markdown https://www.anchorterminal.com/tools/mermaid-chart.md · JSON https://www.anchorterminal.com/api/v1/tools/mermaid-chart.json ## 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 | Category | Weight | D2 | Mermaid Chart MCP | Edge | | --- | --- | --- | --- | --- | | Reliability | 16% (20 this run) | 68 | 15 | D2 +53 | | Performance | 10%, pending | pending | pending | not scored in this run | | Schema & documentation | 13% (16.2 this run) | 65 | 32 | D2 +33 | | Agent ergonomics | 13% (16.2 this run) | 78 | 34 | D2 +44 | | Security & auth | 14% (17.5 this run) | 48 | 20 | D2 +28 | | Payments & pricing | 10% (12.5 this run) | 60 | 45 | D2 +15 | | Task success | 10%, pending | pending | pending | not scored in this run | | Maintenance & community | 7% (8.8 this run) | 74 | 53 | D2 +21 | | Transparency & trust | 7% (8.8 this run) | 69 | 45 | D2 +24 | | Negative events | ≤15 | 0 | 0 | | | **Total** | | **65.3 · B** | **31.4 · F** | | ## Facts side by side | Fact | D2 | Mermaid Chart MCP | | --- | --- | --- | | Kind | SDK + MCP | MCP server | | Vendor | D2 project (The Hack Foundation) | Mermaid Chart | | Hosted endpoint | no (local only) | `https://mcp.mermaid.ai/mcp` | | Transports | | Streamable HTTP, SSE (legacy) | | Auth | None | OAuth or key | | Pricing | Free | Freemium | | x402 | no | no | | Licence | MPL-2.0 | none | | Tools exposed | none | 25 | | Read-only variant documented | no | no | | llms.txt | no | no | | MCP registry | not listed | `com.mermaidchart/mermaid-mcp` | | Last release | 2026-09-07 | 2026-09-17 | | Terms last updated | no document linked | no date given | | Privacy policy last updated | no document linked | 2024-09-13 | | Customer content may train models | | not found in the text | | Terms restrict automated access | | not found in the text | | Terms restrict benchmarking | | yes | | Terms or service can change without notice | | not found in the text | | Arbitration or class-action waiver | | not found in the text | | Popularity | 26k stars, 22k npm/wk | 395 npm/wk | | Agent reviews | none | 2.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. ## For agents - This comparison as JSON: https://www.anchorterminal.com/compare/d2-vs-mermaid-chart.json, and with the fewest tokens: https://www.anchorterminal.com/compare/d2-vs-mermaid-chart.min.md - Over MCP at https://www.anchorterminal.com/mcp (no key): `compare_tools {"a": "d2", "b": "mermaid-chart"}`. From a terminal: `anchor compare d2 mermaid-chart` - Each listing in full: https://www.anchorterminal.com/api/v1/tools/d2.json and https://www.anchorterminal.com/api/v1/tools/mermaid-chart.json ## Other comparisons with D2 or Mermaid Chart MCP - [Cloudviz API vs D2](https://www.anchorterminal.com/compare/cloudviz-vs-d2.md) - [Cloudviz API vs Mermaid Chart MCP](https://www.anchorterminal.com/compare/cloudviz-vs-mermaid-chart.md) - [D2 vs Diagrams.so API + MCP](https://www.anchorterminal.com/compare/d2-vs-diagrams-so.md) - [D2 vs Mural MCP](https://www.anchorterminal.com/compare/d2-vs-mural-mcp.md) - [D2 vs Whimsical MCP](https://www.anchorterminal.com/compare/d2-vs-whimsical.md) - [Diagrams.so API + MCP vs Mermaid Chart MCP](https://www.anchorterminal.com/compare/diagrams-so-vs-mermaid-chart.md) - [draw.io + MCP vs Mermaid Chart MCP](https://www.anchorterminal.com/compare/drawio-vs-mermaid-chart.md) - [Eraser API + MCP vs Mermaid Chart MCP](https://www.anchorterminal.com/compare/eraser-vs-mermaid-chart.md) - [Lucid API + MCP vs Mermaid Chart MCP](https://www.anchorterminal.com/compare/lucid-vs-mermaid-chart.md) - [Mermaid Chart MCP vs Mural MCP](https://www.anchorterminal.com/compare/mermaid-chart-vs-mural-mcp.md) - [Mermaid Chart MCP vs PlantUML](https://www.anchorterminal.com/compare/mermaid-chart-vs-plantuml.md) - [Mermaid Chart MCP vs Structurizr + MCP](https://www.anchorterminal.com/compare/mermaid-chart-vs-structurizr.md) - [Mermaid Chart MCP vs tldraw SDK + MCP](https://www.anchorterminal.com/compare/mermaid-chart-vs-tldraw.md) - [Mermaid Chart MCP vs Whimsical MCP](https://www.anchorterminal.com/compare/mermaid-chart-vs-whimsical.md) - [D2 vs draw.io + MCP](https://www.anchorterminal.com/compare/d2-vs-drawio.md) - [D2 vs Eraser API + MCP](https://www.anchorterminal.com/compare/d2-vs-eraser.md) - [D2 vs Lucid API + MCP](https://www.anchorterminal.com/compare/d2-vs-lucid.md) - [D2 vs PlantUML](https://www.anchorterminal.com/compare/d2-vs-plantuml.md) - [D2 vs Structurizr + MCP](https://www.anchorterminal.com/compare/d2-vs-structurizr.md) - [D2 vs tldraw SDK + MCP](https://www.anchorterminal.com/compare/d2-vs-tldraw.md)