# Best diagramming APIs and diagram-as-code for AI agents (slim) > PlantUML (B), D2 (B) and Miro API + MCP (B) lead the 15 ranked diagramming APIs and diagram-as-code. Picks by need, strengths, weaknesses and prices from the Anchor benchmark. - Full: https://www.anchorterminal.com/best/diagramming/index.md (~5,450 tokens) · this version ~1,380 tokens · JSON https://www.anchorterminal.com/best/diagramming/index.json · canonical https://www.anchorterminal.com/best/diagramming/ - Index: https://www.anchorterminal.com/llms.txt · API: https://www.anchorterminal.com/api/v1/index.json · Updated: 2026-10-09 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. - Ranked: 15 · agent-ready (BB or better): 0 · accept x402: 0 · hosted endpoints: 12 - Full ranked table: https://www.anchorterminal.com/categories/diagramming.md - Head-to-head comparisons: https://www.anchorterminal.com/compare/diagramming/index.md (99) - Methodology: https://www.anchorterminal.com/benchmark/index.md ## The shortlist | # | Tool | Grade | Score | Best for | Price | Where | | --- | --- | --- | --- | --- | --- | --- | | 1 | [PlantUML](https://www.anchorterminal.com/tools/plantuml.md) | 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](https://www.anchorterminal.com/tools/d2.md) | 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](https://www.anchorterminal.com/tools/miro.md) | B | 65 | Agents that draw diagrams, maps and planning boards people will keep editing. | $8 / seat-mo | hosted | | 4 | [draw.io + MCP](https://www.anchorterminal.com/tools/drawio.md) | 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](https://www.anchorterminal.com/tools/tldraw.md) | C | 60.7 | Teams building a product where a person and an agent share a canvas. | Paid | hosted | | 6 | [Lucid API + MCP](https://www.anchorterminal.com/tools/lucid.md) | 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](https://www.anchorterminal.com/tools/diagrams-so.md) | 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](https://www.anchorterminal.com/tools/structurizr.md) | 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](https://www.anchorterminal.com/tools/kroki.md) | 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](https://www.anchorterminal.com/tools/excalidraw.md) | 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 | ## Picks by need - Highest score overall: [PlantUML](https://www.anchorterminal.com/tools/plantuml.md), B, 66.9/100 on the benchmark. Also [D2](https://www.anchorterminal.com/tools/d2.md), B, 65.3/100. - Schema & documentation: [Miro API + MCP](https://www.anchorterminal.com/tools/miro.md), 85/100 on schema & documentation, against 65 for the overall leader. - Agent ergonomics: [Diagrams.so API + MCP](https://www.anchorterminal.com/tools/diagrams-so.md), 85/100 on agent ergonomics, against 78 for the overall leader. - Security & auth: [Lucid API + MCP](https://www.anchorterminal.com/tools/lucid.md), 80/100 on security & auth, against 50 for the overall leader. - Maintenance & community: [tldraw SDK + MCP](https://www.anchorterminal.com/tools/tldraw.md), 89/100 on maintenance & community, against 73 for the overall leader. - Transparency & trust: [Structurizr + MCP](https://www.anchorterminal.com/tools/structurizr.md), 77/100 on transparency & trust, against 73 for the overall leader. - A hosted MCP endpoint: [Miro API + MCP](https://www.anchorterminal.com/tools/miro.md), remote MCP server, nothing to install. - Self-hosting under an open licence: [draw.io + MCP](https://www.anchorterminal.com/tools/drawio.md), self-hosted, Apache-2 licence. Also [Structurizr + MCP](https://www.anchorterminal.com/tools/structurizr.md), self-hosted, Apache-2 licence. ## How to choose - Diagram as code format: Check 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 generation: Confirm 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 embedding: Check 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 limits: Read 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 listing's verdict, strengths and weaknesses: https://www.anchorterminal.com/best/diagramming/index.md