d2-mcp
JSON →Create, validate, and render diagrams from D2 (Declarative Diagramming) code into SVG and PNG formats.
Install
npx @modelcontextprotocol/inspector Tools · 3
- Compile D2 Code Validate D2 syntax and catch errors before rendering. Get immediate feedback on diagram structure and syntax. Accepts either direct code or file path to D2 file.
- Render Diagrams Generate diagrams for visual feedback and refinement. Support PNG, SVG, and ASCII output formats. Accepts either direct code or file path to D2 file.
- Fetch D2 Cheat Sheet Returns a Markdown reference covering shapes, styling, and transport usage.
Links
githubgithub.com/h0rv/d2-mcp ↗
★ 19 GitHub stars