Head to head · Diagram as code · October 2026 research run
D2 vs Lucid API + MCP
D2 scores 65.3 (B) on agent readiness against Lucid API + MCP's 60.6 (C), and leads in 5 of 7 scored categories. Lucid API + MCP leads on schema & documentation and security & auth. 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 62
- Payments & pricing, 60 against 25
- Maintenance & community, 74 against 33
- Transparency & trust, 69 against 60
Also in its favour
- No key needed to call it
- 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 Organisations already on Lucid that want an agent to create or update diagrams inside governed workspaces, with read-only scopes and audit logs.
Ahead on
- Schema & documentation, 73 against 65
- Security & auth, 80 against 48
Also in its favour
- A hosted endpoint, with nothing to install
Watch for
No public changelog for the API or the MCP server
Score by category
| Category | Weight this run | D2 | Lucid API + MCP | Edge |
|---|---|---|---|---|
| Reliability | 16%20 | 68 | 67 | D2 +1 |
| Performance | 10%pending | pending | pending | not scored in this run |
| Schema & documentation | 13%16.2 | 65 | 73 | Lucid API + MCP +8 |
| Agent ergonomics | 13%16.2 | 78 | 62 | D2 +16 |
| Security & auth | 14%17.5 | 48 | 80 | Lucid API + MCP +32 |
| Payments & pricing | 10%12.5 | 60 | 25 | D2 +35 |
| Task success | 10%pending | pending | pending | not scored in this run |
| Maintenance & community | 7%8.8 | 74 | 33 | D2 +41 |
| Transparency & trust | 7%8.8 | 69 | 60 | D2 +9 |
| Negative events | ≤15 | 0 | 0 | |
| Total | 65.3 · B | 60.6 · C |
Facts side by side
| Fact | D2 | Lucid API + MCP |
|---|---|---|
| Kind | SDK + MCP | HTTP API |
| Vendor | D2 project (The Hack Foundation) | Lucid Software |
| Hosted endpoint | no (local only) | https://api.lucid.co |
| Transports | HTTP, Streamable HTTP | |
| Auth | None | OAuth or key |
| Pricing | Free | Freemium |
| x402 | no | no |
| Licence | MPL-2.0 | proprietary |
| Tools exposed | none | 9 |
| Read-only variant documented | no | no |
| llms.txt | no | yes |
| MCP registry | not listed | app.lucid.mcp/lucid |
| Last release | 2026-09-07 | 2026-06-15 |
| 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 | none |
| 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.
Lucid API + MCP
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.
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
Lucid API + MCP
- Always send
Lucid-Api-Version: 1, or prefix the path with /v1 - For flowcharts and sequence diagrams, post Mermaid markup (up to 100,000 characters) instead of building Standard Import JSON
- Request
:readonlyscopes when the agent only reads documents - On 429, wait 60 seconds or back off. Create Mermaid Diagram allows 60 calls a minute
- Sharing and embed endpoints need an OAuth token. An API key won't work there
Questions
Which is better for AI agents, D2 or Lucid API + MCP?
D2 scores 65.3 (B) on agent readiness against Lucid API + MCP's 60.6 (C), and leads in 5 of 7 scored categories. Lucid API + MCP leads on schema & documentation and security & auth.
Can an agent call D2 and Lucid API + MCP without installing anything?
No hosted endpoint is listed for D2. Lucid API + MCP has a hosted endpoint at https://api.lucid.co.
Are D2 and Lucid API + MCP open source?
D2 is open source (MPL-2.0). No open-source release is listed for Lucid API + MCP.
Other comparisons with D2 or Lucid API + MCP
- Cloudviz API vs D2
- Cloudviz API vs Lucid API + MCP
- D2 vs Diagrams.so API + MCP
- D2 vs Mural MCP
- D2 vs Whimsical MCP
- Diagrams.so API + MCP vs Lucid API + MCP
- draw.io + MCP vs Lucid API + MCP
- Eraser API + MCP vs Lucid API + MCP
- Lucid API + MCP vs Mermaid Chart MCP
- Lucid API + MCP vs Mural MCP
- Lucid API + MCP vs PlantUML
- Lucid API + MCP vs Structurizr + MCP
- Lucid API + MCP vs tldraw SDK + MCP
- Lucid API + MCP vs Whimsical MCP
- D2 vs draw.io + MCP
- D2 vs Eraser 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-lucid.md· slim.min.md· JSON.json(or sendAccept: text/markdown) - Each listing in full
/api/v1/tools/d2.json·/api/v1/tools/lucid.json - From a terminal
anchor compare d2 lucid(the CLI) - Over MCP
compare_tools {"a": "d2", "b": "lucid"}at/mcp, no key