Head to head · Diagram as code · October 2026 research run
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.
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
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 this run | D2 | tldraw SDK + MCP | Edge |
|---|---|---|---|---|
| Reliability | 16%20 | 68 | 75 | tldraw SDK + MCP +7 |
| Performance | 10%pending | pending | pending | not scored in this run |
| Schema & documentation | 13%16.2 | 65 | 79 | tldraw SDK + MCP +14 |
| Agent ergonomics | 13%16.2 | 78 | 71 | D2 +7 |
| Security & auth | 14%17.5 | 48 | 40 | D2 +8 |
| Payments & pricing | 10%12.5 | 60 | 35 | D2 +25 |
| Task success | 10%pending | pending | pending | not scored in this run |
| Maintenance & community | 7%8.8 | 74 | 89 | tldraw SDK + MCP +15 |
| Transparency & trust | 7%8.8 | 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
- Check the exit status of
d2, never the output file. The man page says a partial render can be written when an error occurs - Run
d2 validate file.d2before rendering, andd2 fmtto normalise the source - Pass
-for input and output and set--stdout-format(svg, png, ascii, txt, pdf, pptx or gif) to work without files - Use
--stdout-format asciiwhen the reader is a text-only model - Pass
--bundle=falseor 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
- Through the MCP App, call
searchon the Editor API spec first, thenexecwith JavaScript that callseditormethods - Omit
canvasIdto start a blank canvas, and pass the returnedcanvasIdto keep editing the same one - Paste Mermaid into the canvas to get editable shapes instead of placing each shape by hand
- Return
editor.getCurrentPageShapes()fromexecto check what was drawn - 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.
Other comparisons with D2 or tldraw SDK + MCP
- Cloudviz API vs D2
- Cloudviz API vs tldraw SDK + MCP
- D2 vs Diagrams.so API + MCP
- D2 vs Mural MCP
- D2 vs Whimsical MCP
- Diagrams.so API + MCP vs tldraw SDK + MCP
- draw.io + MCP vs tldraw SDK + MCP
- Eraser API + MCP vs tldraw SDK + MCP
- Lucid API + MCP vs tldraw SDK + MCP
- Mermaid Chart MCP vs tldraw SDK + MCP
- Mural MCP vs tldraw SDK + MCP
- Structurizr + MCP vs tldraw SDK + MCP
- tldraw SDK + MCP vs Whimsical MCP
- D2 vs draw.io + MCP
- D2 vs Eraser API + MCP
- D2 vs Lucid API + MCP
- D2 vs Mermaid Chart MCP
- D2 vs PlantUML
- D2 vs Structurizr + MCP
- PlantUML vs tldraw SDK + MCP
Machine-readable
- This page as Markdown
/compare/d2-vs-tldraw.md· slim.min.md· JSON.json(or sendAccept: text/markdown) - Each listing in full
/api/v1/tools/d2.json·/api/v1/tools/tldraw.json - From a terminal
anchor compare d2 tldraw(the CLI) - Over MCP
compare_tools {"a": "d2", "b": "tldraw"}at/mcp, no key