Best of · Design & diagrams
Best diagramming APIs and diagram-as-code for AI agents
The 10 highest-scoring of 15 diagramming APIs and diagram-as-code on the Anchor benchmark, with a pick for each need and where each one falls short. Scores come from public evidence, re-checked as vendors change.
- 15 ranked
- 0 agent-ready
- 12 hosted endpoints
- Updated 9 October 2026
Top three
Picks by need
Worked out from the scores, prices and facts, so they change when the research does.
Schema & documentation
85/100 on schema & documentation, against 65 for the overall leader.
Agent ergonomics
85/100 on agent ergonomics, against 78 for the overall leader.
Maintenance & community
89/100 on maintenance & community, against 73 for the overall leader.
Transparency & trust
77/100 on transparency & trust, against 73 for the overall leader.
Self-hosting under an open licence
self-hosted, Apache-2 licence.
Also Structurizr + MCP, self-hosted, Apache-2 licence.
The shortlist
| # | Tool | Grade | Best for | Price | Where |
|---|---|---|---|---|---|
| 1 | PlantUML PlantUML project (Arnaud Roques) |
B 66.9 | Agents that write sequence, class, state, component, deployment, Gantt or C4 diagrams as text and render them locally or in CI. | Free · OSS | local |
| 2 | D2 D2 project (The Hack Foundation) |
B 65.3 | Agents that need to produce or edit architecture, sequence, grid, SQL table or class diagrams as reviewable text and render them locally. | Free · OSS | local |
| 3 | Miro API + MCP Miro |
B 65 | Agents that draw diagrams, maps and planning boards people will keep editing. | $8 / seat-mo | hosted |
| 4 | draw.io + MCP draw.io |
B 62.2 | An agent that writes the diagram itself and wants a person to keep editing it, free and keyless. | Free · OSS | hosted and local |
| 5 | tldraw SDK + MCP tldraw |
C 60.7 | Teams building a product where a person and an agent share a canvas. | Paid | hosted |
| 6 | Lucid API + MCP Lucid Software |
C 60.6 | Organisations already on Lucid that want an agent to create or update diagrams inside governed workspaces, with read-only scopes and audit logs. | $9 / seat-mo | hosted |
| 7 | Diagrams.so API + MCP Diagrams.so (RedHold LLC) |
C 60 | Best when an agent has to produce a cloud architecture diagram from a description and a person will keep editing it in draw.io. | $15 / mo | hosted and local |
| 8 | Structurizr + MCP Structurizr |
C 59.9 | Teams that model architecture in C4 and want an agent to write and check the model as text. | $400 / mo | hosted |
| 9 | Kroki Yuzu tech |
C 59.2 | Agents that write diagrams in several text formats and want one render endpoint, on a private network or through the public instance for non-sensitive diagrams. | Free · OSS | local |
| 10 | Excalidraw Excalidraw s.r.o. |
C 54.5 | Teams already on Excalidraw+ that want agents to create and edit hand-drawn diagrams, slides and wireframes in a shared workspace, and one-off sketches through the free MCP App. | $6 / seat-mo | hosted |
5 more are ranked in the full table.
How to choose
- Diagram as code formatCheck that diagrams are text the agent can write and diff, since a line-by-line format makes later edits cheaper than a full redraw.
- Editability after generationConfirm that a generated diagram can be opened and changed in the editor, since an agent that cannot revise its output forces a human to redraw the diagram.
- Export formats and embeddingCheck which export formats and embed modes are supported, since an agent that publishes to a document needs a format that the destination can display.
- Licence and usage limitsRead the licence and any limits on diagram count or size, because an agent that generates many diagrams can hit a cap that a single demo never shows.
Each one in detail
PlantUML
B 66.9/100PlantUML is open-source software that turns text descriptions into UML, architecture, Gantt, mind map and other diagrams. Agents run it as a Java command-line tool, a Java library, a local HTTP server or the @plantuml/mcp-js MCP server.
Verdict One Java command reads diagram text from stdin and writes PNG, SVG, PDF or ASCII with no account, and CI passed on the last eight pushes. The default security profile lets diagram text read any local file and fetch any URL, and the documentation still lists chronology diagrams that release 1.2026.2 switched off.
Choose it for Agents that write sequence, class, state, component, deployment, Gantt or C4 diagrams as text and render them locally or in CI.
Strengths
java -jar plantuml.jar -pipereads a diagram from stdin and writes PNG, SVG, PDF, EPS, LaTeX or ASCII to stdout, with no account or key--check-syntaxand-stdrptreport errors asfile:line:errorlines, and exit codes 0, 50, 100 and 200 are documented- The official
@plantuml/mcp-jsserver has four tools, needs only Node.js, and returns the same SVG bytes for the same source on any machine
Weaknesses
- The default security profile is LEGACY, which gives diagram text full access to local files and URLs through
!include. The docs say it will be removed, with no date -picoweblistens on all network interfaces by default and has no authentication- Chronology diagrams were switched off in 1.2026.2 on 27 February 2026 and are still listed in the README and documented on plantuml.com
Price Free · OSSAuth Nonex402 nolocal
D2
B 65.3/100D2 is an open-source diagram scripting language that turns text into SVG, PNG, PDF, PPTX, GIF or ASCII diagrams. Agents run it as a local CLI, a Go library or the @d2lang/d2 WebAssembly package.
Verdict 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.
Choose it for Agents that need to produce or edit architecture, sequence, grid, SQL table or class diagrams as reviewable text and render them locally.
Strengths
- One command reads D2 from stdin and writes SVG, PNG, PDF, PPTX, GIF or ASCII to stdout, with no account or key
- MPL-2.0 throughout, and the TALA layout engine has been open source and bundled since 0.9.0 on 7 September 2026
d2 validateandd2 fmt --checklet an agent test a diagram before rendering it
Weaknesses
- 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
- Terrastruct, the company that built D2, is shutting down. The project is now donation-funded under The Hack Foundation
- All 317 commits since 8 July 2026 are by one maintainer, who says his time on D2 is limited
Price Free · OSSAuth Nonex402 nolocal
Miro API + MCP
B 65/100Miro's REST API v2 reads and writes boards and board items (sticky notes, shapes, connectors, frames, cards, text, images, documents), tags and members, so an agent can lay out diagrams as well as notes.
Verdict REST creates shapes, connectors and frames, so flowcharts and architecture sketches can be drawn directly. Legacy MCP board tools were removed nine days after the deprecation notice.
Choose it for Agents that draw diagrams, maps and planning boards people will keep editing.
Strengths
- REST creates shapes, connectors and frames, so flowcharts and architecture sketches can be drawn directly
- Hosted MCP server with OAuth 2.1 on every plan including Free, and no delete tool in its 18
- Published REST credit limits and MCP daily caps per plan
Weaknesses
- Legacy MCP board tools were removed nine days after the deprecation notice
- No prompt-injection guidance for board content written by collaborators
- OAuth scopes are coarse (
boards:read,boards:write)
Price $8 / seat-moAuth OAuthx402 nohosted
draw.io + MCP
B 62.2/100The open-source diagram editor (also diagrams.net) with an official MCP server.
Verdict Free, keyless and Apache 2.0, with a Docker image for self-hosting. Tool descriptions embed a 34.5 KB XML reference and a 14 KB Mermaid reference, roughly 13,000 tokens.
Choose it for An agent that writes the diagram itself and wants a person to keep editing it, free and keyless.
Strengths
- Free, keyless and Apache 2.0, with a Docker image for self-hosting
- The hosted
create_diagramtakes Mermaid or draw.io XML, with optional ELK layout and libavoid edge routing search_shapescovers about 10,000 stencils plus an icon service and returns exact style strings
Weaknesses
- Tool descriptions embed a 34.5 KB XML reference and a 14 KB Mermaid reference, roughly 13,000 tokens
- No REST API to save, list or render diagrams
- PNG, SVG and PDF export need draw.io Desktop's CLI or a person in the editor
Price Free · OSSAuth Nonex402 nohosted and local
tldraw SDK + MCP
C 60.7/100A React infinite-canvas SDK that an agent can drive through the editor API, creating, reading and changing shapes, turning Mermaid into shapes and exporting images.
Verdict 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.
Choose it for Teams building a product where a person and an agent share a canvas.
Strengths
- Full editor API to create, read, bind and export shapes from code, with agent, chat and workflow starter kits
- Hosted MCP App with two model-facing tools, all six tools annotated
- At least six releases between 15 July and 30 September 2026, with dated release notes
Weaknesses
- Source-available, and commercial prices aren't published
execruns model-written JavaScript on the canvas with no approval step- Licence pings send the licence ID and full page URL for trial and hobby keys, more than the licence page says
Price PaidAuth Nonex402 nohosted
Lucid API + MCP
C 60.6/100REST API and hosted MCP server for creating, reading and managing Lucidchart and Lucidspark diagrams.
Verdict OAuth 2.0 scopes with :readonly variants, and audit log endpoints in the REST API. No public changelog for the API or the MCP server.
Choose it for Organisations already on Lucid that want an agent to create or update diagrams inside governed workspaces, with read-only scopes and audit logs.
Strengths
- OAuth 2.0 scopes with
:readonlyvariants, and audit log endpoints in the REST API - Mermaid in through REST, PlantUML sequence diagrams through MCP, both editable afterwards
- Per-operation rate limits in each reference page's OpenAPI fragment, such as 60 a minute on Create Mermaid Diagram
Weaknesses
- No public changelog for the API or the MCP server
- The status page doesn't monitor the API or the MCP server
- No single OpenAPI file and no official REST SDK
Price $9 / seat-moAuth OAuth or keyx402 nohosted
Diagrams.so API + MCP
C 60/100Turns a plain-English description into an editable draw.io diagram with cloud icons (AWS, Azure, GCP, OCI, Kubernetes).
Verdict API, MCP and SDKs on every plan, including a Free plan marked "No Card Required". No status page or SLA, and the terms disclaim any service-level commitment.
Choose it for Best when an agent has to produce a cloud architecture diagram from a description and a person will keep editing it in draw.io.
Strengths
- API, MCP and SDKs on every plan, including a Free plan marked "No Card Required"
- OpenAPI 3.1 with 32 operations, and an Idempotency-Key on every billable call
- All 23 MCP tools carry readOnlyHint or destructiveHint annotations
Weaknesses
- No status page or SLA, and the terms disclaim any service-level commitment
- Rate limits exist per key and per IP but no numbers are published
- Per-action credit costs are shown only in the app
Price $15 / moAuth OAuth or keyx402 nohosted and local
Structurizr + MCP
C 59.9/100Diagram-as-code tool for software architecture using the C4 model.
Verdict One model can generate several C4 architecture views. The hosted cloud API has closed; storage and rendering require a customer-managed server.
Choose it for Teams that model architecture in C4 and want an agent to write and check the model as text.
Strengths
- One text model yields context, container, component, dynamic and deployment views
- Free hosted MCP at mcp.structurizr.com validates, parses, inspects and exports DSL with no key
- Apache 2.0 code, an OpenAPI 3.0 definition and dated changelogs
Weaknesses
- The hosted cloud API is gone. Storage and rendering need your own server
- Prebuilt server binaries need a paid licence counted per unique user, including API clients
- The MCP module is labelled experimental, with one-line tool descriptions
Price $400 / moAuth OAuth or keyx402 nohosted
Kroki
C 59.2/100Kroki is an open-source HTTP server from Yuzu tech that converts diagram text in 29 formats, including PlantUML, Mermaid, GraphViz and D2, into SVG, PNG or PDF. Owners run it from Docker images, and kroki.io is a free public instance.
Verdict One unauthenticated POST with diagram text returns an image for 29 diagram types, and five versions shipped between 15 July and 5 October 2026. Four advisories were published in July and August 2026, one an unauthenticated remote code execution on /tikz/svg, all fixed. No OpenAPI file exists, and the public instance has no terms, privacy policy or status page.
Choose it for Agents that write diagrams in several text formats and want one render endpoint, on a private network or through the public instance for non-sensitive diagrams.
Strengths
POST /withdiagram_source,diagram_typeandoutput_format, or plain text to/<type>/<format>, returns the image. No account or key- One API covers 29 diagram types, among them PlantUML, C4, Structurizr, Mermaid, GraphViz, D2, DBML, BPMN, Excalidraw and Vega
KROKI_SAFE_MODEdefaults toSECURE, which blocks file and network reads by diagram libraries, and the container runs as the non-root userkroki
Weaknesses
- GHSA-wmpp-fj9c-w766 (CVSS 9.8) allowed unauthenticated remote code execution on
/tikz/svgin versions 0.21.0 up to 0.32.0, whatever the safe mode. Fixed 3 August 2026 - Three more advisories in July and August 2026 let TikZ, Mermaid and Vega diagrams read local files or fetch URLs in
SECUREmode. All are fixed in 0.32.1 - No OpenAPI file, llms.txt or error catalogue. The JSON error shape is in the source and not in the documentation
Price Free · OSSAuth Nonex402 nolocal
Excalidraw
C 54.5/100Excalidraw is a hand-drawn style whiteboard and diagram editor from Excalidraw s.r.o. in Brno. Agents reach it through the Excalidraw+ REST API and MCP server (public beta), a free keyless MCP App, and the open-source editor on npm (MIT).
Verdict Excalidraw+ keys carry read or full permission, route restrictions and an expiry, and the MCP server shows a key only the tools its routes allow. The API and MCP server are in public beta with breaking changes expected, sit behind the $6 Plus plan, and have no published OpenAPI file, SDK or idempotency keys.
Choose it for Teams already on Excalidraw+ that want agents to create and edit hand-drawn diagrams, slides and wireframes in a shared workspace, and one-off sketches through the free MCP App.
Strengths
- API keys take
readorfullpermission, route restrictions and an expiry, and can be rotated. The MCP server lists only the tools a key's routes allow create_diagramlays out nodes, edges and groups into editable shapes with bound arrows, andtake_screenshotreturns a PNG to check the resultsearch_scene_contentreturns only matching elements, so an agent need not load a whole scene
Weaknesses
- The API and MCP server are in public beta. The docs say endpoints, tool names and schemas may change and to expect breaking changes
- API and MCP access needs the Plus plan at $6 a user a month. No per-call price, and no SDK for the API
- No OpenAPI file is linked from the docs, although the reference pages are generated from one. No idempotency keys and no SLA found
Price $6 / seat-moAuth API keyx402 nohosted
Head to head
- D2 vs PlantUML B 65.3 vs B 66.9
- draw.io + MCP vs PlantUML B 62.2 vs B 66.9
- PlantUML vs tldraw SDK + MCP B 66.9 vs C 60.7
- D2 vs draw.io + MCP B 65.3 vs B 62.2
- D2 vs tldraw SDK + MCP B 65.3 vs C 60.7
- draw.io + MCP vs tldraw SDK + MCP B 62.2 vs C 60.7
Questions
What are the highest-rated diagramming APIs and diagram-as-code for AI agents?
PlantUML has the highest benchmark score of the 15 ranked diagramming APIs and diagram-as-code, 66.9 (B). D2 is second with 65.3 (B).
How many diagramming APIs and diagram-as-code are agent-ready?
0 of the 15 ranked here grade BB or better, the bar for agent-ready on the Anchor benchmark.
Which diagramming APIs and diagram-as-code accept x402 payments?
None of the ranked listings here accepts x402 for its main call yet.
How is this list ranked?
By the Anchor benchmark score out of 100, a weighted mean of the scored categories minus deductions for negative events, from public evidence re-checked as vendors change. Listings cannot pay for a place. The latest assessment behind this page is from 9 October 2026.
How this list is made
The order is the Anchor benchmark score, the same number as on each listing and in the top list. Each listing is graded from public evidence against the benchmark checklist, and the picks above are worked out from those grades, prices and facts. No listing pays for its place, and paid audits or listing help never change a score.
Full ranked table · 99 head-to-head comparisons · Best tools in every category