Best of · Design & diagrams

Best diagramming APIs and diagram-as-code for AI agents

The 10 highest-scoring of 18 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.

  • 18 ranked
  • 0 agent-ready
  • 14 hosted endpoints
  • Updated 11 November 2026

Top three

Picks by need

Worked out from the scores, prices and facts, so they change when the research does.

Highest score overall

draw.io + MCP B

B, 68.2/100 on the benchmark.

Also PlantUML, B, 66.3/100.

Reliability

PlantUML B

83/100 on reliability, against 45 for the overall leader.

Agent ergonomics

Diagrams.so API + MCP B

85/100 on agent ergonomics, against 59 for the overall leader.

Security & auth

Lucid API + MCP B

80/100 on security & auth, against 55 for the overall leader.

Maintenance & community

PlantUML B

91/100 on maintenance & community, against 86 for the overall leader.

The review panel's favourite

PlantUML B

3.5/5 from 4 panel reviews.

Our own products are ranked like any listing but are never a pick.

The shortlist

#ToolGradeBest forPriceWhere
1 draw.io + MCP
draw.io
B 68.2 An agent that writes the diagram itself and wants a person to keep editing it, free and keyless. Free · OSS Hosted and local
2 PlantUML
PlantUML project (Arnaud Roques)
B 66.3 Agents that write sequence, class, state, component, deployment, Gantt or C4 diagrams as text and render them locally or in CI. Free · OSS Local
3 D2
D2 project (The Hack Foundation)
B 66.1 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
4 Lucid API + MCP
Lucid Software
B 65 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
5 Structurizr + MCP
Structurizr
B 64.1 Teams that model architecture in C4 and want an agent to write and check the model as text. $400 / mo Hosted
6 Miro API + MCP
Miro
B 64 Agents that draw diagrams, maps and planning boards people will keep editing. $8 / seat-mo Hosted
7 Diagrams.so API + MCP
Diagrams.so (RedHold LLC)
B 62.7 Best when an agent has to produce a cloud architecture diagram from a description and a person will keep editing it in draw.io. $20 / mo Hosted and local
8 tldraw SDK + MCP
tldraw
C 59.3 Teams building a product where a person and an agent share a canvas. Paid Hosted
9 Kroki
Yuzu tech
C 56.7 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.8 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

8 more are ranked in the full table.

How to choose

  1. 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.
  2. 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.
  3. 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.
  4. 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

#1

draw.io + MCP

B 68.2/100

The open-source diagram editor (also diagrams.net) with an official MCP server.

Verdict 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.

Best 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_diagram takes Mermaid or draw.io XML, with optional ELK layout and libavoid edge routing, and its description stays under 2,048 characters
  • search_shapes covers about 10,000 stencils plus an icon service and returns exact style strings

Weaknesses

  • 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
  • No rate limits, SLA or security.txt, and mcp.draw.io isn't on the status page

Price Free · OSSAuth Nonex402 NoHosted and local

Full assessment

#2

PlantUML

B 66.3/100

PlantUML 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 1.2026.9 shipped on 17 October. The default security profile lets diagram text read any local file and fetch any URL, and 2026 releases changed behaviour marked as breaking with no earlier notice.

Best 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 -pipe reads a diagram from stdin and writes PNG, SVG, PDF, EPS, LaTeX or ASCII to stdout, with no account or key
  • --check-syntax and -stdrpt report errors as file:line:error lines, and exit codes 0, 50, 100 and 200 are documented
  • The official @plantuml/mcp-js server 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
  • -picoweb listens 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

Full assessment · Against #1, draw.io + MCP

#3

D2

B 66.1/100

D2 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. 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.

Best 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 validate and d2 fmt --check let 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

Full assessment · Against #1, draw.io + MCP

#4

Lucid API + MCP

B 65/100

REST 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.

Best 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 :readonly variants, 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

Full assessment · Against #1, draw.io + MCP

#5

Structurizr + MCP

B 64.1/100

Diagram-as-code tool for software architecture using the C4 model.

Verdict One text model generates several C4 architecture views, and the project shipped four releases between 17 September and 26 October 2026. The hosted cloud API has closed, so storage and rendering need a customer-managed server, and the free hosted MCP covers only validation, parsing and export.

Best 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 released MCP module is labelled experimental, with one-line tool descriptions

Price $400 / moAuth OAuth or keyx402 NoHosted

Full assessment · Against #1, draw.io + MCP

#6

Miro API + MCP

B 64/100

Miro'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, and a hosted MCP server works on every plan. The MCP server now exposes 52 tools, including sharing and delete tools, with no read-only mode, and legacy board tools were removed nine days after notice.

Best 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
  • Published REST credit limits and MCP daily caps per plan

Weaknesses

  • Legacy MCP board tools were removed nine days after the deprecation notice
  • 52 MCP tools with no toolsets or read-only mode, including sharing and delete tools
  • No prompt-injection guidance for board content written by collaborators

Price $8 / seat-moAuth OAuthx402 NoHosted

Full assessment

#7

Diagrams.so API + MCP

B 62.7/100

Turns a plain-English description into an editable draw.io diagram with cloud icons (AWS, Azure, GCP, OCI, Kubernetes).

Verdict Diagrams.so turns a description into an editable draw.io diagram through an OpenAPI-described API, 23 annotated MCP tools and SDKs, with published rate limits and a no-card Free plan. It has no status page or SLA, and on 9 October it withdrew the draw.io file from Free-plan replies without the notice its terms promise.

Best 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

  • OpenAPI 3.1 with 32 operations, and an Idempotency-Key on creates
  • All 23 MCP tools carry readOnlyHint or destructiveHint annotations
  • Published rate limits per key and per IP, with Retry-After and RateLimit headers

Weaknesses

  • No status page or SLA, and the terms disclaim any service-level commitment
  • On 9 October 2026 Free-plan replies lost the draw.io XML with no advance notice
  • The MCP server sends each tool's name to the vendor's API while its README says it has no telemetry

Price $20 / moAuth OAuth or keyx402 NoHosted and local

Full assessment · Against #1, draw.io + MCP

#8

tldraw SDK + MCP

C 59.3/100

A 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 and a hosted MCP App. Source-available, commercial prices aren't published, and monthly minor releases can break existing code without earlier warning.

Best 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 eleven releases between 5 August and 28 October 2026, with dated release notes

Weaknesses

  • Source-available, and commercial prices aren't published
  • exec runs 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

Full assessment · Against #1, draw.io + MCP

#9

Kroki

C 56.7/100

Kroki 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 version 0.34.0 shipped on 25 October 2026. Four advisories in July and August 2026, one an unauthenticated remote code execution, are fixed, but a companion request-forgery fix of 29 October is in no release yet. No OpenAPI file, terms or status page exist.

Best 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 / with diagram_source, diagram_type and output_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_MODE defaults to SECURE, which blocks file and network reads by diagram libraries, and the container runs as the non-root user kroki

Weaknesses

  • GHSA-wmpp-fj9c-w766 (CVSS 9.8) allowed unauthenticated remote code execution on /tikz/svg in versions 0.21.0 up to 0.32.0, whatever the safe mode. Fixed 3 August 2026
  • A fix of 29 October 2026 for request forgery through image URLs in the diagrams.net, Excalidraw and BPMN companions is in no release yet
  • 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

Full assessment · Against #1, draw.io + MCP

#10

Excalidraw

C 54.8/100

Excalidraw 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. No status history can be read.

Best 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 read or full permission, route restrictions and an expiry, and can be rotated. The MCP server lists only the tools a key's routes allow
  • create_diagram lays out nodes, edges and groups into editable shapes with bound arrows, and take_screenshot returns a PNG to check the result
  • search_scene_content returns 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

Full assessment · Against #1, draw.io + MCP

Head to head

All 150 comparisons in this category

Questions

What are the highest-rated diagramming APIs and diagram-as-code for AI agents?

draw.io + MCP has the highest benchmark score of the 18 ranked diagramming APIs and diagram-as-code, 68.2 (B). PlantUML is second with 66.3 (B).

How many diagramming APIs and diagram-as-code are agent-ready?

0 of the 18 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 11 November 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 · 150 head-to-head comparisons · Best tools in every category

For companies

Do agents find, use and choose your tools?

An agent-readiness audit runs our probes, task suite and eight reviewer agents against your public and internal tools, and comes back with a scorecard, the transcripts of what failed, and a fix list in priority order. From $2,500, re-run included. We never take payment to move a rank. We do help companies earn one.