d2_createLABSCO SUMMARY
Diagrams that survive a change of mind.
The incremental editing tools are the point: instead of regenerating the whole diagram whenever a detail changes, you add one shape, move one node into a container, or rename one element, and everything else stays where it was. Serialising back to D2 text means the result leaves the conversation in a form you can keep editing by hand.
What it is
A D2 diagram server. It creates a diagram empty or from D2 source you already have, then edits it piece by piece — adding shapes and connections, setting attributes, moving, renaming and deleting elements — and exports or saves the result.
What you get
- A diagram created empty for incremental building, or with initial D2 content
- Shapes and connections added one at a time to an existing diagram
- Attributes set on any element — shape, label, fill and the rest
- Elements moved between containers, renamed, or deleted along with their children
- Information read back about a shape, an edge, or a container's children
- The current diagram serialised back to D2 text, including everything added incrementally
- Export to SVG, PNG or PDF, or saved straight to a path you name
- Every D2 theme, light and dark
- A choice of transports: stdio, event-stream, or streaming HTTP
Requirements
A built binary — the project is Go and compiles to a single executable. PNG and PDF export need a local converter such as librsvg or ImageMagick; SVG needs nothing extra. No account, no key.
Setup effort
One command — go install github.com/i2y/d2mcp/cmd@latest
USE CASES
Turning a design conversation into an architecture diagram
Start with an empty diagram and add each component and connection as it comes up in the discussion.
Changing one node without redrawing everything
Set the attribute or the label on that element alone and leave the rest of the layout untouched.
Reorganising a diagram that grew
Move shapes into containers, with or without their children, and delete the parts that no longer belong.
Checking what you have built so far
Read back the current text of the diagram, or query one shape, edge or container before changing it.
Getting the picture out
Export to the format the document needs, or save it directly to a path.
10 tools
Listed in project docs. Your client may show a different list.
d2_exportd2_saved2_oracle_created2_oracle_setd2_oracle_deleted2_oracle_moved2_oracle_renamed2_oracle_get_infod2_oracle_serializeBEFORE YOU INSTALL
What to know first
Tools you get
10 tools named in the project's documentation.
Requires
- go on PATH
- Go 1.24.3 or later
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
go install github.com/i2y/d2mcp/cmd@latestMCP Clients
Claude Desktop — stdio
{
"mcpServers": {
"d2mcp": {
"command": "<YOUR_PATH_TO_D2MCP>",
"args": [
"-transport=stdio"
]
}
}
}go install names the binary after the last part of the package path, so this one lands as cmd in $(go env GOPATH)/bin (usually ~/go/bin). <YOUR_PATH_TO_D2MCP> is the full path to that file, with your home directory written out.