A Model Context Protocol (MCP) server that provides D2 diagram generation and manipulation capabilities.
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.
A Model Context Protocol (MCP) server that provides D2 diagram generation and manipulation capabilities.
Once connected, the assistant can call these 11 tools directly:
d2_oracle_create — Create shapes and connections incrementallyd2_oracle_set — Set attributes on existing elementsd2_oracle_delete — Delete specific elements from diagramsd2_oracle_move — Move shapes between containersd2_oracle_rename — Rename diagram elementsd2_oracle_get_info — Get information about shapes, connections, or containersd2_oracle_serialize — Get the current D2 text representation of the diagramStandalone — The Standalone tool exposed by this serverd2_create — Create a new diagram with optional initial content (unified approach):d2_export — The d2_export tool exposed by this serverd2_save — The d2_save tool exposed by this serverSetup follows the standard MCP pattern: clone or install the server, then register it in your client's configuration file and restart the client. The configuration snippets on this page cover Claude Desktop, Claude Code and Cursor.
rsvg-convert (from librsvg) or - ImageMagick (convert command)Developer-tool servers are usually the first ones people connect, because they turn "help me with this code" into an assistant that can actually read the repo and act on it. D2mcp sits in that group, and the shape of its toolset — d2_oracle_create, d2_oracle_set, d2_oracle_delete among others — tells you what it is really for. Worth comparing against the other developer tools servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.
| Tool | What it does |
|---|---|
| d2_oracle_create | Create shapes and connections incrementally |
| d2_oracle_set | Set attributes on existing elements |
| d2_oracle_delete | Delete specific elements from diagrams |
| d2_oracle_move | Move shapes between containers |
| d2_oracle_rename | Rename diagram elements |
| d2_oracle_get_info | Get information about shapes, connections, or containers |
| d2_oracle_serialize | Get the current D2 text representation of the diagram |
| Standalone | The Standalone tool exposed by this server. |
| d2_create | Create a new diagram with optional initial content (unified approach): |
| d2_export | The d2_export tool exposed by this server. |
| d2_save | The d2_save tool exposed by this server. |
**For SSE transport:**
```json
{
"mcpServers": {
"d2mcp": {
"command": "/path/to/d2mcp",
"args": ["-transport=sse", "-addr=:3000"]
}
}
}Configuration as documented by the project. Restart the client after saving.
rsvg-convert (from librsvg) or - ImageMagick (convert command)A knowledge graph your assistant keeps between sessions — entities, relations and observations that persist.
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Your workspace, on speaking terms with AI — search, read and write Notion pages and databases.
A structured scratchpad for hard problems — stepwise reasoning with revisions, branches and visible logic.
Symbol-level code navigation, refactoring and memory for coding agents — the IDE brain your assistant has been missing.
Chat with your second brain — search, read and write vault notes through the Local REST API.