d2-mcp
d2-mcp
D2 다이어그램 언어를 위한 MCP 서버입니다. MCP 호환 AI 어시스턴트에서 D2 다이어그램을 컴파일, 검증 및 탐색하세요.
네이티브 D2 CLI 바이너리(Docker 이미지에 자동 설치됨)를 사용하여 다이어그램을 SVG 및 PNG로 컴파일합니다.
도구
도구 | 설명 |
| D2 소스 코드 → SVG/PNG. 레이아웃 엔진, 테마, 스케치 모드, 다크 테마, 멀티 보드 타겟팅 등을 지원합니다. |
| 렌더링 없이 D2 구문을 확인합니다. 유효성 상태와 오류 세부 정보를 반환합니다. |
| ID(라이트 및 다크)와 함께 사용 가능한 모든 D2 테마를 나열합니다. |
| 사용 가능한 레이아웃 엔진( |
| 카테고리별(AWS, GCP, Azure, K8s, dev, essentials, tech)로 icons.terrastruct.com의 아이콘을 탐색합니다. |
Related MCP server: PlantUML MCP Server
리소스
리소스 | 설명 |
| 마크다운 형식의 전체 D2 언어 구문 참조입니다. |
로컬 개발
사전 요구 사항
Node.js 22+
D2 CLI — d2lang.com에서 설치하거나
D2_PATH환경 변수를 바이너리 위치로 설정하세요.아이콘 (선택 사항) —
scripts/download-icons.sh ./icons를 실행한 다음ICONS_DIR=./icons를 설정하여 로컬 아이콘 확인을 활성화하세요. 이 설정이 없으면 아이콘 URL이 D2 CLI로 그대로 전달됩니다.
npm install
npm run build
npm start자동 재시작을 포함한 개발 환경:
npm run dev서버는 기본적으로 3000번 포트에서 시작됩니다(PORT 환경 변수로 재정의 가능).
상태 확인:
GET /healthMCP 엔드포인트:
POST /mcp(스트리밍 가능한 HTTP 전송)
환경 변수
변수 | 기본값 | 설명 |
|
| HTTP 서버 포트 |
|
| D2 CLI 바이너리 경로 (기본적으로 |
|
| 로컬 확인을 위해 다운로드된 SVG 아이콘이 포함된 디렉토리 |
배포 (Render)
이 프로젝트에는 Render에 원클릭으로 배포할 수 있는 Dockerfile 및 render.yaml 블루프린트가 포함되어 있습니다. Docker 이미지는 빌드 시점에 D2 CLI 바이너리를 자동으로 설치하고 모든 아이콘을 다운로드합니다.
이 저장소를 GitHub에 푸시합니다.
Render에서 새로운 Blueprint를 생성하고 저장소를 연결합니다.
Render가 자동으로
render.yaml을 감지하고 배포합니다.
또는 다음 설정으로 Web Service를 수동으로 생성하세요:
환경: Docker
상태 확인 경로:
/health플랜: Free
MCP 서버 연결
배포가 완료되면 스트리밍 가능한 HTTP를 통해 연결되도록 MCP 클라이언트를 구성하세요:
{
"mcpServers": {
"d2": {
"url": "https://your-service.onrender.com/mcp"
}
}
}URL을 실제 Render 서비스 URL(로컬의 경우 http://localhost:3000/mcp)로 바꾸세요.
컴파일 도구 옵션
매개변수 | 유형 | 설명 | |
| string | D2 소스 코드 (필수) | |
|
|
| 레이아웃 엔진 (기본값: dagre) |
| boolean | 손으로 그린 듯한 스케치 모드 | |
| integer | 테마 ID ( | |
| integer | 다크 모드 테마 ID | |
| integer | 픽셀 단위 패딩 (기본값: 100) | |
| boolean | 뷰박스 내 SVG 중앙 정렬 | |
| number | 배율 (기본값: 화면에 맞춤) | |
| string | 멀티 보드 다이어그램을 위한 타겟 보드 | |
| integer | 멀티 보드 SVG를 위한 애니메이션 간격 (ms) | |
| boolean | HTML 삽입을 위한 XML 선언 생략 |
라이선스
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to generate and render Mermaid diagrams (flowcharts, sequence diagrams, etc.) as PNG/SVG images with local file saving and HTTP access URLs. Supports batch processing and intelligent caching for efficient diagram creation.1121MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to generate UML diagrams from text descriptions using PlantUML, supporting multiple output formats (PNG, SVG, PDF), syntax validation, and diagram source extraction.11MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to create and validate workflow diagrams using FlowZap's text-based DSL. Generates shareable playground URLs for visualizing flowcharts, process diagrams, and CI/CD pipelines through natural language descriptions.73175MIT
- FlicenseNot gradedqualityDmaintenanceEnables the dynamic generation of various software development diagrams, such as flowcharts, sequence diagrams, and architecture diagrams, using Mermaid syntax. It includes tools for diagram validation and provides instructions for exporting results to multiple formats including SVG and PNG.
Related MCP Connectors
Generate dynamic Mermaid diagrams and charts with AI assistance. Customize styles and export diagr…
Create, validate, edit, export (markdown/svg/png/mermaid), and search JSON Canvas files.
Let Claude, Cursor, or ChatGPT author Mermaid diagrams your team can read and share.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ryanmccauley/d2-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server