LocalFree

D2 MCP server

recursivefunctions/d2mcp

Create, edit, validate, render, and export D2 diagrams with confined workspace access.

Install D2 in Claude Code

Claude Code
claude mcp add d2 -- docker run -i --rm ghcr.io/recursivefunctions/d2mcp:0.5.0
mcp.json (Claude Desktop, Cursor, VS Code, Windsurf)
{
  "mcpServers": {
    "d2": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/recursivefunctions/d2mcp:0.5.0"
      ]
    }
  }
}

Frequently asked questions

What does the D2 MCP server do?

Create, edit, validate, render, and export D2 diagrams with confined workspace access.

Is the D2 MCP server free?

Yes, most likely. Open source and no paid account or API key is mentioned in the listing. Check the provider for current pricing.

Does D2 run locally or remotely?

Local. Runs on your machine (stdio). You install it with npx, uvx, Docker or from source.

How do I add D2 to Claude Code?

Run: claude mcp add d2 -- docker run -i --rm ghcr.io/recursivefunctions/d2mcp:0.5.0

More productivity & project management MCP servers

View all