Skip to main content
Glama

diag2md-mcp

Model Context Protocol (MCP) 서버로, AI 코딩 에이전트에게 Draw.io C4 및 UML 아키텍처 가드레일과 다이어그램 변환 기능을 제공합니다.

GitHub Release License: MIT TypeScript

diag2md-mcp는 Draw.io 아키텍처 다이어그램(.xml, .drawio)과 AI 코딩 에이전트(예: Antigravity, Cursor, Claude Desktop, VS Code MCP 클라이언트)를 연결하여 C4 및 UML 다이어그램을 실시간으로 구조화된 Mermaid Markdown으로 변환합니다.

diag2md 기반.


주요 기능

  • 자동 워크스페이스 검색: 구성 가능한 glob 패턴(**/architecture/**/*.xxml, **/*.drawio)과 일치하는 Draw.io 다이어그램 파일을 프로젝트 디렉터리에서 검색합니다.

  • 고성능 인메모리 변환: 하위 ell 프로세스 생성 오버헤드 없이 Draw.io XML 모델을 메모리 내에서 Mermaid C4 및 UML Markdown으로 변환합니다.

  • AI 컨텍스트 제공자(convert_diagrams_read): 다이어그램을 동적으로 읽고 변환하여 채팅 세션 중 AI 코딩 어시스턴트에게 풍부한 아키텍처 컨텍스트를 직접 제공합니다.

  • 일괄 다이어그램 동기화(convert_diagrams_write): 다이어그램 소스 옆에 .md 파일을 생성하여 아키텍처 문서를 최신 상태로 유지합니다.


Related MCP server: drawio-mcp

빠른 시작

npx로 실행하기

MCP 서버를 사전 설치 없이 직접 실행할 수 있습니다:

npx -y diag2md-mcp

전역 설치

npm install -g diag2md-mcp

MCP 서버 구성

diag2md-mcp를 선호하는 AI 어시스턴트 또는 MCP 클라이언트에 연결하려면 클라이언트 구성 파일(예: mcp_config.json, claude_desktop_config.json, Cursor 또는 Antigravity MCP 설정)에 서버를 추가하세요.

권장(전역 설치 패키지)

{
  "mcpServers": {
    "diag2md-mcp": {
      "command": "diag2md-mcp"
    }
  }
}

대안: 로컬 빌드 소스

{
  "mcpServers": {
    "diag2md-mcp": {
      "command": "node",
      "args": ["/path/to/diag2md-mcp/dist/index.js"]
    }
  }
}

대안: npx를 통한 온디맨드

{
  "mcpServers": {
    "diag2md-mcp": {
      "command": "npx",
      "args": ["-y", "diag2md-mcp"]
    }
  }
}

MCP 도구 참조

diag2md-mcp는 AI 코딩 에이전트에 3가지 핵심 도구를 제공합니다:

도구 이름

설명

인자

list_diagrams

워크스페이스에서 glob 패턴과 일치하는 모든 Draw.io 아키텍처 다이어그램 파일(.xxml, .drawio)을 검색합니다.

patterns (선택적 string[]), ignore (선택적 string[])

convert_diagrams_write

glob 패턴과 일치하는 워크스페이스 다이어그램 파일을 일괄 검색하여 변환하고, 업데이트된 .md 파일을 디스크에 작저합니다.

patterns (선택적 string[]), diagramType (선택적 "c4" | "uml")

convert_diagrams_read

워크스페이스 다이어그램 파일을 일괄 검색하고 변환된 Mermaid Markdown을 AI 어시스턴트의 컨텍스트로 직접 반환합니다.

patterns (선택적 string[]), diagramType (선택적 "c4" | "uml")


서버 구성

MCP 서버 설정은 환경 변수를 통해 사용자 지정할 수 있습니다:

환경 변수

설명

기본값

DIAG2MD_PATTERNS

다이어그램 파일을 검색하기 위한 쉼표로 구분된 glob 패턴.

**/architecture/**/*.xml, **/architecture/*.xml, **/*.drawio

DIAG2MD_IGNORE

파일 검색 중 무시할 쉼표로 구분된 glob 패턴.

**/node_modules/**, **/dist/**, **/.git/**

DIAG2MD_TYPE

기본 변환 다이어그램 유형(c4 또는 uml).

c4

env 패턴을 사용한 구성 예시

env 블록을 사용하여 MCP 서버 JSON 구성에서 직접 사용자 지정 검색 패턴을 구성할 수 있습니다:

{
  "mcpServers": {
    "diag2md-mcp": {
      "command": "diag2md-mcp",
      "env": {
        "DIAG2MD_PATTERNS": "**/architecture/**/*.xml, **/docs/**/*.drawio",
        "DIAG2MD_IGNORE": "**/tmp/**, **/node_modules/**",
        "DIAG2MD_TYPE": "c4"
      }
    }
  }
}

patterns를 사용한 동적 도구 호출 예시

AI 어시스턴트나 도구는 요청별로 검색 패턴을 동적으로 재정의할 수도 있습니다:

{
  "name": "convert_diagrams_read",
  "arguments": {
    "patterns": [
      "**/architecture/**/*.xml",
      "**/docs/**/*.drawio"
    ]
  }
}

개발

# Clone the repository
git clone https://github.com/diag2md/diag2md-mcp.git
cd diag2md-mcp

# Install dependencies
npm install

# Build TypeScript to JavaScript dist/
npm run build

# Run unit tests
npm run test

# Run type checker
npm run typecheck

라이선스

MIT © polymatic.ventures

Available Tools

3 tools
convert_diagrams_readA

Batch scan and convert all workspace diagram files (.xml, .drawio) into Mermaid Markdown, returning their content directly as AI context.

Inputs: patterns, diagramType.

convert_diagrams_writeA

Batch scan workspace diagrams matching glob patterns and convert them to updated .md files on disk.

Inputs: patterns, diagramType.

list_diagramsA

Discover all Draw.io architecture diagram files (.xml, .drawio) in the workspace using glob patterns.

Inputs: ignore, patterns.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 3 tools

    Disambiguation5/5

    list_diagrams is clearly discovery-only, while the two convert tools are separated by output behavior: _write persists .md files to disk and _read returns content as AI context. There is no meaningful overlap between any pair.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in lowercase snake_case, using the same 'diagrams' resource. The _read/_write suffixes are a coherent way to distinguish output modes, and list_diagrams fits the pattern as an independent discovery action.

    Tool Count5/5

    Three tools is a well-scoped set for a focused converter utility: discover source files, convert to files, and convert to context. Each tool addresses a distinct workflow step without unnecessary expansion.

    Completeness5/5

    The core workflow of finding Draw.io diagrams and converting them to Mermaid Markdown is fully covered in both output modes (disk and context). No obvious dead ends or missing lifecycle operations are apparent for this narrow domain.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables AI agents to programmatically create, modify, and analyze Draw.io diagrams through the Model Context Protocol. Supports generating architectural diagrams, flowcharts, and visualizations with bidirectional communication between AI systems and Draw.io.
      13
      1,500
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to generate professional UML diagrams (class, use case, activity, sequence) from natural language descriptions, producing editable .drawio files compatible with diagrams.net.
      7
      85 npm
      ISC
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to create, read, update, and delete Draw.io diagrams, allowing automated generation of architectural diagrams, flowcharts, and visual documentation.
      MIT