D2mcp MCP Server

A Model Context Protocol (MCP) server that provides D2 diagram generation and manipulation capabilities.

Local serverstdioGo

What is the D2mcp MCP Server?

D2mcp mcp server connects D2mcp to AI assistants that speak the Model Context Protocol. A Model Context Protocol (MCP) server that provides D2 diagram generation and manipulation capabilities.

What D2mcp does

A Model Context Protocol (MCP) server that provides D2 diagram generation and manipulation capabilities.

Requirements

  • Go 1.24.3 or higher - D2 v0.6.7 or higher (included as dependency) - For PNG/PDF export (optional): - rsvg-convert (from librsvg) or - ImageMagick (convert command)

Practical notes

  • Maintained by i2y, written in Go.

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
d2_create
d2_export
d2_save
d2_oracle_create
d2_oracle_set
d2_oracle_delete
d2_oracle_move
d2_oracle_rename
d2_oracle_get_info
d2_oracle_serialize

How to install the D2mcp MCP Server

{
  "mcpServers": {
    "d2mcp": {
      "command": "/path/to/d2mcp",
      "args": [
        "-transport=stdio"
      ]
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

  • Go 1.24.3 or higher - D2 v0.6.7 or higher (included as dependency) - For PNG/PDF export (optional): - rsvg-convert (from librsvg) or - ImageMagick (convert command)

Example prompts to try

  • “Use D2mcp to d2 oracle create.”
  • “Use D2mcp to d2 oracle set.”
  • “Use D2mcp to d2 oracle delete.”

Frequently asked questions

A Model Context Protocol (MCP) server that provides D2 diagram generation and manipulation capabilities. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.