diagram-mcp
diagram-mcp
다이어그램-애즈-코드 텍스트를 사용자의 디스크에 PNG 파일로 렌더링하는 MCP 서버입니다. 브라우저도, 네트워크도, 외부 서비스도 필요 없습니다. 문서, 티켓 또는 README에 넣을 플로차트를 생성할 때 유용합니다.

도구
render_diagram: 코드를 PNG로 렌더링하고 파일 경로를 반환합니다preview_diagram: 다이어그램을 텍스트 아트로 그려 대화에 바로 표시하며 파일을 쓰지 않습니다validate_diagram: 파싱하고 줄 번호와 함께 오류를 보고하며 아무것도 쓰지 않습니다diagram_syntax: 언어 참조
Related MCP server: mermaid-mcp
설치
Node 20.12+가 필요합니다.
git clone https://github.com/JVmano/diagram-mcp.git
cd diagram-mcp
npm install
npm run build그런 다음 Claude Code에 등록합니다:
claude mcp add diagram --scope user \
--env DIAGRAM_MCP_OUTPUT_DIR=$HOME/Documents/diagram-renders \
-- node "$(pwd)/dist/index.js"또는 .mcp.json / 사용자 구성에 직접 추가합니다:
{
"mcpServers": {
"diagram": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/diagram-mcp/dist/index.js"],
"env": { "DIAGRAM_MCP_OUTPUT_DIR": "/absolute/path/to/renders" }
}
}
}세션을 다시 시작한 다음 다이어그램을 요청하세요. 변경 사항을 pull한 후 npm run build를 다시 실행하세요.
언어
title "Reward approval flow"
direction TB
node event "Conversion recorded" shape=rounded
node auto "Auto-approve?" shape=diamond size=200x100
node queue "Manual review queue"
event -> auto
auto -> queue "no"모양: rect, rounded, ellipse, diamond, hexagon. 연결: from -> to ["label"] [style=solid|dashed]. at=x,y를 사용한 위치는 선택 사항입니다. 생략하면 레이아웃이 모양을 배치합니다. 전체 참조는 diagram_syntax를 호출하세요.
구성
모두 선택 사항이며 모두 기본값이 있습니다. .env.example을 참조하세요. 렌더링 결과는 DIAGRAM_MCP_OUTPUT_DIR(기본값 ~/Documents/diagram-renders)에 저장됩니다. 명시적인 outputPath는 DIAGRAM_MCP_ALLOW_ANY_OUTPUT_PATH=true가 아닌 이상 해당 디렉터리 또는 작업 디렉터리 안에 있어야 합니다.
개발
npm test # unit tests
npm run test:e2e # builds, then drives the server over stdio
npm run verify # typecheck, test, build, e2esrc/core의 파서, 레이아웃 및 SVG 생성 코드는 로컬 다이어그램 편집기 프로젝트와 공유됩니다. npm run check:sync는 해당 프로젝트가 옆에 체크아웃되어 있으면 이를 비교(diff)합니다.
라이선스
MIT
Available Tools
4 toolsdiagram_syntaxDiagram language referenceARead-onlyIdempotent
Return the full diagram-as-code language reference, with shapes, options and a worked example.
Inputs: no named parameters.
preview_diagramPreview diagram as textARead-onlyIdempotent
Draw the diagram as text art so it can be shown directly in the conversation. Writes no file. Use render_diagram when a PNG is needed.
Inputs: code (required), maxCols.
render_diagramRender diagram to PNGA
Render diagram-as-code text to a PNG file and return the path. Runs locally with no browser and no network. Returns an error listing the offending line numbers if the code does not parse.
Inputs: code (required), name, scale, padding, +3 more.
validate_diagramValidate diagram codeARead-onlyIdempotent
Parse diagram code and report errors and warnings with line numbers, without writing any file.
Inputs: code (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct purpose: syntax reference, validation, text preview, and PNG rendering. The descriptions clearly differentiate the outputs, and render_diagram explicitly notes when to use it over preview_diagram.
Three tools follow the verb_diagram pattern (render_diagram, validate_diagram, preview_diagram), while diagram_syntax reverses the order. The convention is still readable and consistent in style, with only a minor deviation.
Four tools is well-scoped for a diagram-as-code server. Each tool covers a necessary part of the workflow without redundancy or unnecessary bulk.
The toolset covers the full authoring loop: learn the syntax, validate the code, preview as text, and render to a PNG file. There are no obvious missing operations for the stated local rendering purpose.
Maintenance
Related MCP Connectors
Render, validate, encode/decode PlantUML diagram-as-code; 22 diagram types. Free, no auth.
Draws UI wireframes from a small text language: multi-screen boards with notes and flow arrows.
Render, verify, describe, and safely edit Mermaid diagrams through MCP.
Diagrams, badges, charts and QR codes as plain image URLs you can paste into Markdown.
Related MCP Servers
- AlicenseAqualityDmaintenanceConverts Markdown files into professional diagrams such as flowcharts, mind maps, and architecture diagrams using Mermaid.js and custom SVG renderers. It enables users to list, render, and export visualizations in multiple formats including SVG, PNG, and PDF.3MIT
- AlicenseAqualityDmaintenanceRenders Mermaid diagram markup to PNG images using Puppeteer/Chromium. Enables AI-generated diagrams to be previewed inline and saved to disk.114 npmMIT
- FlicenseBqualityCmaintenanceEnables creating and maintaining technical diagrams from .dot sources, with validation, rendering to SVG/PNG/PDF, and publishing into Markdown while automatically partitioning oversized graphs.6-
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants and coding tools to turn a few lines describing a system into clean, hand-sketched architecture diagrams in a consistent style, saving them as SVG or PNG files. Supports themes, automatic product icons, groups, sequence diagrams and cloud icon packs.1MIT