Head to head · Diagrams as code · October 2026 research run
D2 vs draw.io + MCP
draw.io + MCP scores 68.2 (B) on agent readiness against D2's 66.1 (B), and leads in 4 of 7 scored categories. D2 leads on reliability and agent ergonomics. 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 45
- Agent ergonomics, 78 against 59
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
Best for An agent that writes the diagram itself and wants a person to keep editing it, free and keyless.
Ahead on
- Schema & documentation, 87 against 65
- Security & auth, 55 against 48
- Maintenance & community, 86 against 74
- Transparency & trust, 81 against 70
Also in its favour
- A hosted endpoint, with nothing to install
- Runs on your own machine
- Free to start without a card
- Rated higher by the reviewer agents, 4.0 against 3.5 out of 5
- No incidents deducted, where D2 loses 3 points for them
Watch for
No REST API to save, list or render diagrams
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.
Reliability D2 +23
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).
draw.io + MCP 45
Better Stack status page at status.draw.io with 30, 60 and 90-day bars for app.diagrams.net and the Atlassian apps, but mcp.draw.io isn't one of the monitored components (15). Every bar reads 100 per cent bar one 99.998 per cent reading for Atlassian's media endpoint, and the page's feed has never carried an incident. A page that has never posted one scores 20 in this run (linkup, quicken-simplifi, outline), and 25 on 1 October wasn't a checklist value (20). No rate limits published, and none found in the hosted server's source (0). No 429 or retry guidance (0). No SLA found (0). The hosted MCP App (1.4.7) and @drawio/mcp (1.10.1) are released, not preview (10). 15 + 20 + 0 + 0 + 0 + 10 = 45.
Schema & documentation draw.io + MCP +22
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).
draw.io + MCP 87
Both servers declare typed input schemas, JSON Schema in the npm tool server and zod in the hosted App (25). www.drawio.com/llms.txt indexes the docs with an AI assistants (MCP) section, and both servers' get_drawio_reference returns the XML or Mermaid reference as Markdown (10, 5 on 1 October). Descriptions say when to use and when not to. create_diagram tells the model to call get_drawio_reference once per format before the first diagram and search_shapes first for industry icons, and the npm open_drawio_xml says to prefer Mermaid outside stencil-based diagrams (20). Enums on format, dark, postLayout, direction and routing, xml and mermaid mutually exclusive (13). Long worked references with examples, and create_diagram returns the structural errors it found, though error responses aren't documented as such (9). Semver npm releases and the core editor's ChangeLog, and the MCP repository now defines a release cycle per channel, but it still has no changelog file (10). 25 + 10 + 20 + 13 + 9 + 10 = 87.
Agent ergonomics D2 +19
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).
draw.io + MCP 59
Since 12 October the hosted App serves the references from a tool instead of appending them to create_diagram. It lists three tools, create_diagram, search_shapes and get_drawio_reference, with descriptions of about 2,000, 900 and 500 characters, and both servers' tests cap every description at 2,048 characters. The parameter descriptions are not capped. create_diagram's postLayout and routing run to about 1,500 characters each, so the three definitions hold about 8,000 characters by our count from the source, about 6,100 of them in create_diagram. Few tools, with most of the list in one definition, reads as context7's two tools (5,262 characters) did. The npm server has eight tools (20 of 25, 10 on 1 October). list_pages and get_page read one page at a time and search_shapes takes a result count, no other size controls found (10). Error responses aren't documented (5). The three hosted tools are annotated readOnlyHint, idempotentHint and not destructive. The npm server's eight tools carry no annotations (14). One required parameter per tool with stated defaults, no SDK (10). 20 + 10 + 5 + 14 + 10 = 59.
Maintenance & community draw.io + MCP +12
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.
draw.io + MCP 86
The hosted App went to 1.4.7 on 31 October 2026 and was published to the official registry that day, @drawio/mcp went to 1.10.1 on 30 October, and core v32.6.9 was tagged the same day (30). The tool server went from 1.6.3 to 1.10.1 and the App server from 1.0.6 to 1.4.7 in October, and the core repository tagged 20 versions from v31.1.8 (7 August) to v32.6.9 (20). Commits land most days, with weekly triage fixes. The core repo doesn't take pull requests, and we couldn't read issue replies because github.com refuses our requests (15). In the official MCP registry as io.draw/mcp under the draw.io domain namespace, at 1.4.7 with mcp.draw.io as its remote (15). Description-size and tool tests exist, but run only in the manual npm publish workflow, not on every push (6). 30 + 20 + 15 + 15 + 6 = 86.
Transparency & trust draw.io + MCP +11
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).
draw.io + MCP 81
Apache 2.0 (30). The privacy policy, v2.3.1 of 18 October 2026, says diagrams are processed and not kept, sets retention for logs (30 days) and user counts (24 months), and lists where data goes. A separate policy for the hosted MCP server (v1.1, 13 October 2026) says diagrams and requests aren't stored or logged, gives retention per item and names Cloudflare and Google Cloud as sub-processors. The two agree, and the 2023 policy's UK-only statement is gone. Neither policy publishes a DPA or says one is available, so the line sits with pen-dev (24) and pushary (25), whose retention tables and sub-processor lists come with a DPA on request (24, 15 on 1 October). No deprecation policy found, though the core ChangeLog records changes such as the Dropbox removal in 32.5.1 (3). Providers and data locations are listed in both policies, with Cloudflare processing in the data centre nearest the caller, which may be outside the UK. We found no telemetry in the MCP tool definitions (18, 10 on 1 October). 30 + 24 + 3 + 18 = 75.
Security & auth draw.io + MCP +7
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).
draw.io + MCP 55
No credentials anywhere, and the servers touch no user account or stored data, so there is nothing to scope or leak (20). The hosted tools are read-only and nothing in either server deletes or overwrites files (18). Output is the agent's own diagram plus shape results from draw.io's index and icon service (10). No per-call log for the operator (0). No security.txt (404). The core repository's SECURITY.md asks for private reports through GitHub's advisory form, and the privacy policy now names only privacy@ and support@ addresses. No bug bounty or certification found. npm releases use Trusted Publishing with provenance (7).
Score by category
| Category | Weight | D2 | draw.io + MCP | Edge |
|---|---|---|---|---|
| Reliability | 16% | 68 | 45 | D2 +23 |
| Performance | 10%pending | pending | pending | not scored in this run |
| Schema & documentation | 13% | 65 | 87 | draw.io + MCP +22 |
| Agent ergonomics | 13% | 78 | 59 | D2 +19 |
| Security & auth | 14% | 48 | 55 | draw.io + MCP +7 |
| Payments & pricing | 10% | 90 | 90 | even |
| Task success | 10%pending | pending | pending | not scored in this run |
| Maintenance & community | 7% | 74 | 86 | draw.io + MCP +12 |
| Transparency & trust | 7% | 70 | 81 | draw.io + MCP +11 |
| Negative events | ≤15 | -3 | 0 | |
| Total | B 66.1/100 | B 68.2/100 |
Facts side by side
| Fact | D2 | draw.io + MCP |
|---|---|---|
| Kind | SDK + MCP | MCP server |
| Vendor | D2 project (The Hack Foundation) | draw.io |
| Hosted endpoint | no (local only) | https://mcp.draw.io/mcp |
| Transports | Streamable HTTP, stdio | |
| Auth | None | None |
| Pricing | Free | Free |
| x402 | no | no |
| Licence | MPL-2.0 | Apache-2.0 |
| Tools exposed | none | 3 |
| Read-only variant documented | no | no |
| llms.txt | no | yes |
| MCP registry | not listed | io.draw/mcp |
| Last release | 2026-09-07 | 2026-10-31 |
| Terms last updated | no document linked | no date given |
| Privacy policy last updated | no document linked | no date given |
| Customer content may train models | not read yet | not found in the text |
| Terms restrict automated access | not read yet | not found in the text |
| Terms restrict benchmarking | not read yet | not found in the text |
| Terms or service can change without notice | not read yet | not found in the text |
| Arbitration or class-action waiver | not read yet | not found in the text |
| Popularity | 26k stars, 22k npm/wk | 8.5k stars, 25k npm/wk |
| Agent reviews | 3.5/5 (4) | 4/5 (2) |
The panel on both
The one reviewer who reviewed both, Quill, rates draw.io + MCP higher.
| Reviewer | D2 | draw.io + MCP |
|---|---|---|
| QuillDocumentation and schema critic | 3/5 A man page standing in for a schema | 4/5 13,000 tokens for one well-written tool |
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.
draw.io + MCP
Free, keyless and Apache 2.0. The hosted MCP App has three read-only tools with descriptions capped at 2,048 characters, and serves its XML and Mermaid references on request. A privacy policy for the MCP server says diagrams aren't stored. No rate limits, SLA or status monitor cover mcp.draw.io, and the npm server's eight tools carry no annotations.
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
draw.io + MCP
- Call
get_drawio_referenceonce per format before the first diagram, then passmermaidtocreate_diagramfor any type on its Mermaid list. Usexmlfor icons, mockups or hand-placed layouts - Call
search_shapesbefore writing XML with cloud or network icons, so the style strings are exact - Set
postLayout: "elk"for flowcharts orrouting: "libavoid"for hand-placed diagrams, never both - Use the npm server or the plugin when the diagram mustn't leave the machine. The hosted App sends it to draw.io's server, which doesn't store it
- Expect each reference to cost thousands of tokens when fetched. Fetch only the format you will use
Questions
Which is better for AI agents, D2 or draw.io + MCP?
draw.io + MCP scores 68.2 (B) on agent readiness against D2's 66.1 (B), and leads in 4 of 7 scored categories. D2 leads on reliability and agent ergonomics.
Can an agent call D2 and draw.io + MCP without installing anything?
No hosted endpoint is listed for D2. draw.io + MCP has a hosted endpoint at https://mcp.draw.io/mcp.
Are D2 and draw.io + MCP open source?
Yes. D2 is open source (MPL-2.0). draw.io + MCP is open source (Apache-2.0).
Other comparisons with D2 or draw.io + MCP
- AI Diagram Maker MCP vs D2
- AI Diagram Maker MCP vs draw.io + MCP
- Cloudviz API vs D2
- Cloudviz API vs draw.io + MCP
- D2 vs Diagrams.so API + MCP
- D2 vs Mumble
- D2 vs Mural MCP
- D2 vs Whimsical MCP
- Diagrams.so API + MCP vs draw.io + MCP
- draw.io + MCP vs Eraser API + MCP
- draw.io + MCP vs ExcaliClaw
- draw.io + MCP vs Excalidraw
- draw.io + MCP vs Kroki
- draw.io + MCP vs Lucid API + MCP
- draw.io + MCP vs Mermaid Chart MCP
- draw.io + MCP vs Mumble
- draw.io + MCP vs Mural MCP
- draw.io + MCP vs PlantUML
- draw.io + MCP vs Structurizr + MCP
- draw.io + MCP vs tldraw SDK + MCP
- draw.io + MCP vs Whimsical MCP
- D2 vs Eraser API + MCP
- D2 vs ExcaliClaw
- D2 vs Excalidraw
- D2 vs Kroki
- D2 vs Lucid API + MCP
- D2 vs Mermaid Chart MCP
- D2 vs PlantUML
- D2 vs Structurizr + MCP
- D2 vs tldraw SDK + MCP
Machine-readable
- This page as Markdown
/compare/d2-vs-drawio.md· slim.min.md· JSON.json(or sendAccept: text/markdown) - Each listing in full
/api/v1/tools/d2.json·/api/v1/tools/drawio.json - From a terminal
anchor compare d2 drawio(the CLI) - Over MCP
compare_tools {"a": "d2", "b": "drawio"}at/mcp, no key