D2 MCP Server
io.github.RecursiveFunctions/d2mcp·v0.5.0Create, edit, validate, render, and export D2 diagrams with confined workspace access.
0 stars
Reviews
Write oneNobody has reviewed D2 MCP Server yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
D2 MCP Server tools
No tool declarations could be read from the package source. They show once the server is installed.
Public scan report
scanner v0.1.9 · 2026-09-27 · same rubric, same numbers if you re-run it
- –Code scanpackage could not be scannedn/a
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 0 days ago15/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How D2 MCP Server compares
Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 88/100
- higher than 75% of 48,255 servers
Install D2 MCP Server in Claude Code, Cursor or VS Code
claude mcp add d2mcp -- docker run -i --rm ghcr.io/recursivefunctions/d2mcp:0.5.0
What the publisher says
From the D2 MCP Server repository's README, as published. We do not edit it. Read it on GitHub
D2 MCP Server
A Model Context Protocol (MCP) server that provides D2 diagram generation and manipulation capabilities.
D2 is a modern diagram scripting language that turns text to diagrams. This MCP server allows AI assistants like Claude to create, render, export, and save D2 diagrams programmatically.
The server provides 16 MCP tools for complete-source authoring, validation, rendering, embedded D2 guidance, and incremental Oracle editing.
With the new Oracle API integration, AI assistants can now build and modify diagrams incrementally, making it perfect for:
- Converting conversations into architecture diagrams
- Building flowcharts step-by-step as requirements are discussed
- Creating entity relationship diagrams from database schemas
- Generating system diagrams from code analysis
- Refining diagrams based on user feedback without starting over
Features
Source-First Diagram Operations
- d2create** - Create diagrams from complete D2 source or start empty
- d2getsource - Retrieve the canonical source, including Oracle edits
- d2updatesource - Validate then atomically replace complete source
- d2format** - Format valid source without storing it
- d2validate** - Validate raw or stored source and suggest conservative repairs
- d2export** - Export with bundled D2 v0.9 renderers (SVG, PNG, PDF, PPTX, GIF, ASCII)
- d2save** - Save an export inside a configured workspace root
- d2help** - Search or retrieve embedded D2 v0.9 guidance
- d2capabilities** - List the versioned capability catalog
Oracle API for Incremental Editing
- d2oraclecreate - Create shapes and connections incrementally
- d2oracleset - Set attributes on existing elements
- d2oracledelete - Delete specific elements from diagrams
- d2oraclemove - Move shapes between containers
- d2oraclerename - Rename diagram elements
- d2oraclegetinfo** - Get information about shapes, connections, or containers
- d2oracleserialize - Get the current D2 text representation of the diagram
Additional Features
- Bundled layouts - Dagre, ELK, and TALA
- Typed rendering - Layout, theme overrides, bundled fonts, scale, padding, sketch, animation, board selection, and bounded output options
- 20 themes - Support for all D2 themes (18 light + 2 dark)
Project Structure
d2mcp/
├── cmd/ # Application entry point
├── internal/
│ ├── domain/ # Business entities and interfaces
│ │ ├── entity/ # Domain entities
│ │ └── repository/ # Repository interfaces
│ ├── usecase/ # Business logic
│ ├── infrastructure/ # External implementations
│ │ ├── d2/ # D2 library integration
│ │ └── mcp/ # MCP server implementation
│ └── presentation/ # MCP handlers
│ └── handler/ # Tool handlers
└── pkg/ # Public packagesPrerequisites
- Go 1.27 or higher
- D2 v0.9.0 (included as a Go dependency)
All export formats use bundled Go renderers; no rsvg-convert, ImageMagick, or Chromium installation is required.
The embedded capability catalog is based on the official D2 language tour, D2 API documentation, and D2 v0.9.0 release.
Installation
From Source
# Clone the repository
git clone https://github.com/recursivefunctions/d2mcp.git
cd d2mcp
# Build the binary
make build
# Or build for all platforms
make build-allUsing Go Install
go install github.com/recursivefunctions/d2mcp/cmd@latestUsing Docker
docker run --rm -i \
--mount type=bind,src="$PWD",dst=/workspace \
ghcr.io/recursivefunctions/d2mcp:0.5.0Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
D2 MCP Server: common questions
- Is D2 MCP Server safe?
- Yes, by our scan: it is graded A (88/100). Read the D2 MCP Server safety report
- How do I install D2 MCP Server?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does D2 MCP Server need an API key?
- Not as far as the registry entry and our scan can tell: no credentials are declared or required.
- Is D2 MCP Server maintained?
- The last commit was 38 days ago (2026-09-27). The latest release is v0.5.0.
- What can I use instead of D2 MCP Server?
- Servers from other publishers that do the same job: Semiotic MCP server and PartCAD MCP server.
Alternatives to D2 MCP Server
Same job from other publishers: the closest match first, then the best rated.