MCP Servers / development / d2-mcp

d2-mcp

JSON →
stdionone19development

Create, validate, and render diagrams from D2 (Declarative Diagramming) code into SVG and PNG formats.

Install
How to run this server
[ { "cmd": "npx @modelcontextprotocol/inspector", "imports": [] } ]
server path: d2-mcp
Tools
What this server exposes
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.
Configuration
Environment & auth
authnone
Resources
d2-mcp — MCP Server · libregistry