
D2 MCP
by i2y
Programmatic D2 diagram generation and incremental manipulation for AI assistants.
What it does
Provides capabilities to create, render, export, and modify D2 diagrams. It allows AI assistants to turn text descriptions into professional architecture diagrams and flowcharts.
Tools
d2_create: Create new diagrams with initial D2 content.d2_export: Export diagrams to SVG, PNG, or PDF.d2_save: Save diagrams to files.d2_oracle_create: Create shapes and connections incrementally.d2_oracle_set: Set attributes on existing elements.d2_oracle_delete: Remove specific elements from diagrams.d2_oracle_move: Move shapes between containers.d2_oracle_rename: Rename diagram elements.d2_oracle_get_info: Retrieve info about shapes or connections.d2_oracle_serialize: Get the current D2 text representation.
Installation
Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"d2mcp": {
"command": "/path/to/d2mcp",
"args": ["-transport=stdio"]
}
}
}
Supported hosts
- Claude Desktop
Quick install
go install github.com/i2y/d2mcp/cmd@latestInformation
- Pricing
- free
- Published
- 5/18/2026
- stars






