
i2y/d2mcp
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
D2 다이어그램 생성 및 조작 기능을 제공하는 모델 Context Protocol (MCP) 서버.
개요
D2 다이어그램 생성 및 조작 기능을 제공하는 모델 Context Protocol (MCP) 서버. D2는 다이어그램에 텍스트를 변환하는 현대 다이어그램 스크립트 언어입니다. 이 MCP 서버는 Claude와 같은 AI 조수가 생성하고, 렌더링, 수출하고, D2 다이어그램을 프로그래밍 할 수 있습니다. 서버는 MCP 프로토콜을 통해 Oracle API를 사용하여 간단한 다이어그램 렌더링 및 정교한 증가 다이어그램 빌딩을 가능하게하는 최적의 AI 보조 통합에 대한 향상된 설명을 제공합니다.
개요(AI 번역)
D2 다이어그램 생성 및 조작 기능을 제공하는 모델 Context Protocol (MCP) 서버.
D2는 다이어그램에 텍스트를 변환하는 현대 다이어그램 스크립트 언어입니다. 이 MCP 서버는 Claude와 같은 AI 조수가 생성하고, 렌더링, 수출하고, D2 다이어그램을 프로그래밍 할 수 있습니다.
서버는 MCP 프로토콜을 통해 Oracle API를 사용하여 간단한 다이어그램 렌더링 및 정교한 증가 다이어그램 빌딩을 가능하게하는 최적의 AI 보조 통합에 대한 향상된 설명을 제공합니다.
새로운 Oracle API 통합을 통해 AI Assistants는 이제 다이어그램을 생성하고 수정할 수 있습니다.
- 건축 도표로 대화 변환
- 건축 Flowcharts 단계별 요구 사항
- 데이터베이스 schemas의 기업 관계 다이어그램 만들기
- 코드 분석에서 시스템 다이어그램 생성
- 사용자 피드백을 기반으로 한 Refining 다이어그램
특징
기본 다이어그램 작업
- d2 create - 옵션 초기 콘텐츠로 새로운 다이어그램 만들기 (확인 된 접근)
- d2 export - 다양한 포맷으로 내보내기 다이어그램 (SVG, PNG, PDF)
- d2 save - 파일에 기존의 다이어그램 저장
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
D2 MCP Server
A Model Context Protocol (MCP) server that provides D2 diagram generation and manipulation capabilities.
D2 is a modern diagram scripting language that turns text to diagrams. This MCP server allows AI assistants like Claude to create, render, export, and save D2 diagrams programmatically.
The server provides 10 tools through the MCP protocol with enhanced descriptions for optimal AI assistant integration, enabling both simple diagram rendering and sophisticated incremental diagram building using the Oracle API.
With the new Oracle API integration, AI assistants can now build and modify diagrams incrementally, making it perfect for:
- Converting conversations into architecture diagrams
- Building flowcharts step-by-step as requirements are discussed
- Creating entity relationship diagrams from database schemas
- Generating system diagrams from code analysis
- Refining diagrams based on user feedback without starting over
Features
Basic Diagram Operations
- d2_create - Create new diagrams with optional initial content (unified approach)
- d2_export - Export diagrams to various formats (SVG, PNG, PDF)
- d2_save - Save existing diagrams to files
Oracle API for Incremental Editing
- 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
Additional Features
- 20 themes - Support for all D2 themes (18 light + 2 dark)
Project Structure
d2mcp/
├── cmd/ # Application entry point
├── internal/
│ ├── domain/ # Business entities and interfaces
│ │ ├── entity/ # Domain entities
│ │ └── repository/ # Repository interfaces
│ ├── usecase/ # Business logic
│ ├── infrastructure/ # External implementations
│ │ ├── d2/ # D2 library integration
│ │ └── mcp/ # MCP server implementation
│ └── presentation/ # MCP handlers
│ └── handler/ # Tool handlers
└── pkg/ # Public packages
Prerequisites
- 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 (
convertcommand)
Installation
From Source
# Clone the repository
git clone https://github.com/i2y/d2mcp.git
cd d2mcp
# Build the binary
make build
# Or build for all platforms
make build-all
Using Go Install
go install github.com/i2y/d2mcp/cmd@latest
Building
# Simple build
make build
# Run directly
make run
# Cross-platform builds
make build-all
Usage
With Claude Desktop
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →설정
{
"mcpServers": {
"d2mcp": {
"command": "/path/to/d2mcp",
"args": ["-transport=stdio"]
}
}
}