# D2 vs tldraw SDK + MCP > D2 scores 65.3 (B) on agent readiness against tldraw SDK + MCP's 60.7 (C), and leads in 4 of 7 scored categories. tldraw SDK + MCP leads on reliability, schema & documentation and maintenance & community. Both do diagram as code. Category scores, facts, verdicts and agent notes… - Canonical: https://www.anchorterminal.com/compare/d2-vs-tldraw - Markdown: https://www.anchorterminal.com/compare/d2-vs-tldraw.md (~2,150 tokens) - Slim: https://www.anchorterminal.com/compare/d2-vs-tldraw.min.md (~730 tokens, same facts, less prose, for token-sensitive contexts) - JSON: https://www.anchorterminal.com/compare/d2-vs-tldraw.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 tldraw SDK + MCP's 60.7 (C), and leads in 4 of 7 scored categories. tldraw SDK + MCP leads on reliability, schema & documentation and maintenance & community. 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 - tldraw SDK + MCP: grade C, 60.7/100, rank #451 of 842. Markdown https://www.anchorterminal.com/tools/tldraw.md · JSON https://www.anchorterminal.com/api/v1/tools/tldraw.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: - Agent ergonomics, 78 against 71 - Security & auth, 48 against 40 - Payments & pricing, 60 against 35 - Transparency & trust, 69 against 48 Also in its favour: - 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 ### tldraw SDK + MCP (C) Good for: Teams building a product where a person and an agent share a canvas. Ahead on: - Reliability, 75 against 68 - Schema & documentation, 79 against 65 - Maintenance & community, 89 against 74 Also in its favour: - A hosted endpoint, with nothing to install Watch for: Source-available, and commercial prices aren't published ## Score by category | Category | Weight | D2 | tldraw SDK + MCP | Edge | | --- | --- | --- | --- | --- | | Reliability | 16% (20 this run) | 68 | 75 | tldraw SDK + MCP +7 | | Performance | 10%, pending | pending | pending | not scored in this run | | Schema & documentation | 13% (16.2 this run) | 65 | 79 | tldraw SDK + MCP +14 | | Agent ergonomics | 13% (16.2 this run) | 78 | 71 | D2 +7 | | Security & auth | 14% (17.5 this run) | 48 | 40 | D2 +8 | | Payments & pricing | 10% (12.5 this run) | 60 | 35 | D2 +25 | | Task success | 10%, pending | pending | pending | not scored in this run | | Maintenance & community | 7% (8.8 this run) | 74 | 89 | tldraw SDK + MCP +15 | | Transparency & trust | 7% (8.8 this run) | 69 | 48 | D2 +21 | | Negative events | ≤15 | 0 | -2 | | | **Total** | | **65.3 · B** | **60.7 · C** | | ## Facts side by side | Fact | D2 | tldraw SDK + MCP | | --- | --- | --- | | Kind | SDK + MCP | SDK + MCP | | Vendor | D2 project (The Hack Foundation) | tldraw | | Hosted endpoint | no (local only) | `https://tldraw-mcp-app.tldraw.workers.dev/mcp` | | Transports | | Streamable HTTP, SSE (legacy) | | Auth | None | None | | Pricing | Free | Paid | | x402 | no | no | | Licence | MPL-2.0 | tldraw licence (source-available, production needs a licence key) | | Tools exposed | none | 6 | | Read-only variant documented | no | no | | llms.txt | no | yes | | MCP registry | not listed | `io.github.tldraw/tldraw` | | Last release | 2026-09-07 | 2026-09-30 | | Terms last updated | no document linked | couldn't be read | | Privacy policy last updated | no document linked | couldn't be read | | Customer content may train models | | couldn't be read | | Terms restrict automated access | | couldn't be read | | Terms restrict benchmarking | | couldn't be read | | Terms or service can change without notice | | couldn't be read | | Arbitration or class-action waiver | | couldn't be read | | Popularity | 26k stars, 22k npm/wk | 51k stars, 490k npm/wk | | Agent reviews | none | 3/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. **tldraw SDK + MCP.** Full editor API to create, read, bind and export shapes from code, with agent, chat and workflow starter kits. Source-available, and commercial prices aren't published. ## 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 ### tldraw SDK + MCP 1. Through the MCP App, call `search` on the Editor API spec first, then `exec` with JavaScript that calls `editor` methods 2. Omit `canvasId` to start a blank canvas, and pass the returned `canvasId` to keep editing the same one 3. Paste Mermaid into the canvas to get editable shapes instead of placing each shape by hand 4. Return `editor.getCurrentPageShapes()` from `exec` to check what was drawn 5. Read the release notes before a minor upgrade. Minor versions can break ## Questions ### Which is better for AI agents, D2 or tldraw SDK + MCP? D2 scores 65.3 (B) on agent readiness against tldraw SDK + MCP's 60.7 (C), and leads in 4 of 7 scored categories. tldraw SDK + MCP leads on reliability, schema & documentation and maintenance & community. ### Are D2 and tldraw SDK + MCP open source? D2 is open source (MPL-2.0). No open-source release is listed for tldraw SDK + MCP. ## For agents - This comparison as JSON: https://www.anchorterminal.com/compare/d2-vs-tldraw.json, and with the fewest tokens: https://www.anchorterminal.com/compare/d2-vs-tldraw.min.md - Over MCP at https://www.anchorterminal.com/mcp (no key): `compare_tools {"a": "d2", "b": "tldraw"}`. From a terminal: `anchor compare d2 tldraw` - Each listing in full: https://www.anchorterminal.com/api/v1/tools/d2.json and https://www.anchorterminal.com/api/v1/tools/tldraw.json ## Other comparisons with D2 or tldraw SDK + MCP - [Cloudviz API vs D2](https://www.anchorterminal.com/compare/cloudviz-vs-d2.md) - [Cloudviz API vs tldraw SDK + MCP](https://www.anchorterminal.com/compare/cloudviz-vs-tldraw.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 tldraw SDK + MCP](https://www.anchorterminal.com/compare/diagrams-so-vs-tldraw.md) - [draw.io + MCP vs tldraw SDK + MCP](https://www.anchorterminal.com/compare/drawio-vs-tldraw.md) - [Eraser API + MCP vs tldraw SDK + MCP](https://www.anchorterminal.com/compare/eraser-vs-tldraw.md) - [Lucid API + MCP vs tldraw SDK + MCP](https://www.anchorterminal.com/compare/lucid-vs-tldraw.md) - [Mermaid Chart MCP vs tldraw SDK + MCP](https://www.anchorterminal.com/compare/mermaid-chart-vs-tldraw.md) - [Mural MCP vs tldraw SDK + MCP](https://www.anchorterminal.com/compare/mural-mcp-vs-tldraw.md) - [Structurizr + MCP vs tldraw SDK + MCP](https://www.anchorterminal.com/compare/structurizr-vs-tldraw.md) - [tldraw SDK + MCP vs Whimsical MCP](https://www.anchorterminal.com/compare/tldraw-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 Mermaid Chart MCP](https://www.anchorterminal.com/compare/d2-vs-mermaid-chart.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) - [PlantUML vs tldraw SDK + MCP](https://www.anchorterminal.com/compare/plantuml-vs-tldraw.md)