D2 MCP Server

A Model Context Protocol (MCP) server for working with [D2: Declarative Diagramming](https://d2lang.com/), enabling seamless integration of diagram

Local serverstdioGo

What is the D2 MCP Server?

D2 MCP connects D2 MCP to AI assistants that speak the Model Context Protocol. A Model Context Protocol (MCP) server for working with D2: Declarative Diagramming, enabling seamless integration of diagram creation and validation into your development workflow.

What D2 MCP does

A Model Context Protocol (MCP) server for working with D2: Declarative Diagramming, enabling seamless integration of diagram creation and validation into your development workflow.

Practical notes

  • Maintained by h0rv, 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.

How to install the D2 MCP Server

{
    "mcpServers": {
        "d2": {
            "command": "/YOUR/ABSOLUTE/PATH/d2-mcp",
            "args": ["--image-type", "png"]
        }
    }
}

Configuration as documented by the project. Restart the client after saving.

Example prompts to try

  • “Use D2 MCP to Debugging.”

Frequently asked questions

A Model Context Protocol (MCP) server for working with [D2: Declarative Diagramming](https://d2lang.com/), enabling seamless integration of diagram creation and Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.