Skip to content
MCP server

D2 MCP Server

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

Runs locallyStatus and history
Install
Pricing
Open source
Runs
Locally
Version
0.5.0
Listing updated
5 days ago

About D2 MCP Server

D2 MCP Server is an open-source MCP server. It runs locally on your machine and is started by your AI client.

Install

Run in a terminal

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

Add to claude_desktop_config.json

{
  "mcpServers": {
    "d2mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/recursivefunctions/d2mcp:0.5.0"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "d2mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/recursivefunctions/d2mcp:0.5.0"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

{
  "servers": {
    "d2mcp": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/recursivefunctions/d2mcp:0.5.0"
      ]
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "d2mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/recursivefunctions/d2mcp:0.5.0"
      ]
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "d2mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/recursivefunctions/d2mcp:0.5.0"
      ]
    }
  }
}

Using several servers? Build one config file with the MCP config generator.

Pricing

Open source

D2 MCP Server FAQ

Is D2 MCP Server free?

Yes. D2 MCP Server is open source, so you can use and self-host it for free.

How do I add D2 MCP Server to Claude Code?

Run this command in your terminal: claude mcp add d2mcp -- docker run -i --rm ghcr.io/recursivefunctions/d2mcp:0.5.0

Where this comes from

  • Description: from the official MCP Registry entry.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers