mcpbeat Sign in

D2 MCP Server

local only

D2 runs on your own machine — the client starts it, so there is no endpoint to ping. 1 454 installs a week from pypi. Last commit 30 Nov 2026.

Look up D2 syntax, check diagrams, and render them locally.

Installs per day peak 669 · avg 48
a month agotoday
1 454
Installs / week
pypi · d2lang
25 997
Stars
322 open issues
30 Nov 2026
Last commit
from GitHub
MPL-2.0
License
Go

Connect this server

This server runs on your own machine — install it with the package manager and the client starts it for you. Package name taken from the official registry entry.

run in your terminal
claude mcp add d2 -- uvx d2lang mcp
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "d2": {
      "command": "uvx",
      "args": [
        "d2lang",
        "mcp"
      ]
    }
  }
}
~/.codex/config.toml
[mcp_servers.d2]
command = "uvx"
args = ["d2lang", "mcp"]
.cursor/mcp.json
{
  "mcpServers": {
    "d2": {
      "command": "uvx",
      "args": [
        "d2lang",
        "mcp"
      ]
    }
  }
}
.vscode/mcp.json
{
  "servers": {
    "d2": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "d2lang",
        "mcp"
      ]
    }
  }
}

What the code does

We read the source, 10 h ago · rules 995398eba69f

Capabilities

What this server is able to do. For an MCP server this is often the job itself — a terminal server runs commands because that is what it is for. Listed so you know what you are plugging in, not as an accusation.

    if not subprocess.check_output(["git", "ls-tree", "--name-only", revision, "--", "go.mod"]):
    joined := filepath.Join(outputDir, component)
  const func = new Function(content);
    select {
    case s.loadSlots <- struct{}{}:
        s.mu.Lock()
        s.stats.ActiveLoads++
        s.mu.Unlock()

Is this your server and something here is wrong? Tell us — corrections are free and do not require a plan.

This code can reach further than it looks

We found places where it runs commands, builds paths or queries from values it is given. None of that is a flaw by itself — it becomes one when the code changes, and code changes quietly between releases. We re-read it on every one.

Three servers free · no card

Alternatives to D2

same job, measured the same way
cysUML
by yschoi9733

MCP server for document-ready UML diagrams: the AI lays them out, cysUML draws and checks them.

911 installs/wk local only
WorkbookAPI
by workbookapi

Check Excel workbooks locally; calculate them through the WorkbookAPI hosted API.

797 installs/wk 4 tools answering
Dgmo MCP
by diagrammo

Generate 40+ diagram types from text; render locally to SVG/PNG, open in the Diagrammo editor

739 installs/wk local only
Agentic Mermaid
by adewale

Render, verify, describe, and safely edit Mermaid diagrams through MCP.

472 installs/wk 9 tools answering
Vgraph MCP
by vithanco

Concept Maps, IBIS, Causal Loop Diagrams and Timelines as images. Runs locally via WebAssembly.

364 installs/wk 6 tools answering
US Code of Federal Regulations
by mccallar

Look up, search, and track changes to the US Code of Federal Regulations (eCFR).

168 installs/wk local only
qlib-sync: China A-share data
by randyy179

Install, update, and read a local Qlib China A-share daily dataset, with checksums and rollback.

127 installs/wk local only
Sounio Compiler
by agourakis82

Check, compile, run, and test Sounio programs locally.

126 installs/wk local only

D2 — questions

Answers built from our own checks of this server.

Why is there no uptime for D2?
D2 runs on your own machine over stdio — there is no network address to reach, so uptime cannot be measured for it by anyone. What can be measured is adoption: the pypi package d2lang was installed 1 454 times last week.
How do I connect D2?
Copy the ready config from this page. We generate it for Claude Code, Claude Desktop, Codex, Cursor and VS Code, each in the form that client actually reads. It runs locally, so the command pulls d2lang straight from pypi; nothing to host, nothing to sign up for.
How many people use D2?
The pypi package d2lang was installed 1 454 times in the last week. We show installs rather than GitHub stars on purpose: a star is a bookmark, an install is someone actually running it.
Is D2 open source?
Yes — it is published under the MPL-2.0 licence, written in Go, 25 997 stars on GitHub and 322 open issues. The source link is on this page, so you can read exactly what it does with your data before you connect it.