/ ディレクトリ / プレイグラウンド / draw.io MCP
● 公式 jgraph ⚡ 即起動

draw.io MCP

作者 jgraph · jgraph/drawio-mcp

First-party draw.io MCP — Claude authors and edits .drawio diagrams as XML, validates against the schema, and exports to PNG/SVG.

draw.io's official MCP lets Claude work with its native XML diagram format. Use it to generate architecture diagrams from prose, edit existing diagrams via instructions, validate XML, and export to SVG/PNG for embedding in PRs and docs.

なぜ使うのか

主な機能

ライブデモ

実際の動作

準備完了

インストール

クライアントを選択

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "drawio-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@jgraph/drawio-mcp"
      ]
    }
  }
}

Claude Desktop → Settings → Developer → Edit Config を開く。保存後、アプリを再起動。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "drawio-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@jgraph/drawio-mcp"
      ]
    }
  }
}

Cursor は Claude Desktop と同じ mcpServers スキーマを使用。プロジェクト設定はグローバルより優先。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "drawio-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@jgraph/drawio-mcp"
      ]
    }
  }
}

Cline サイドバーの MCP Servers アイコンをクリックし、"Edit Configuration" を選択。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "drawio-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@jgraph/drawio-mcp"
      ]
    }
  }
}

Claude Desktop と同じ形式。Windsurf を再起動して反映。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "drawio-mcp",
      "command": "npx",
      "args": [
        "-y",
        "@jgraph/drawio-mcp"
      ]
    }
  ]
}

Continue はマップではなくサーバーオブジェクトの配列を使用。

~/.config/zed/settings.json
{
  "context_servers": {
    "drawio-mcp": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@jgraph/drawio-mcp"
        ]
      }
    }
  }
}

context_servers に追加。保存時に Zed がホットリロード。

claude mcp add drawio-mcp -- npx -y @jgraph/drawio-mcp

ワンライナー。claude mcp list で確認、claude mcp remove で削除。

ユースケース

実用的な使い方: draw.io MCP

Generate an architecture diagram from a README

👤 Developers ⏱ ~15 min intermediate

使うタイミング: PR adds a new service; you want a diagram for the design doc.

フロー
  1. Describe
    Paste the README prose; ask for an architecture diagram.✓ コピーしました
    → XML drawio generated
  2. Validate
    drawio_validate the XML.✓ コピーしました
    → Schema OK
  3. Export
    Export to SVG; embed in the design doc.✓ コピーしました
    → SVG ready to commit

結果: Diagram lives in repo as both .drawio (editable) and .svg (renderable).

組み合わせ

他のMCPと組み合わせて10倍の力を

drawio-mcp + filesystem

Save .drawio + .svg next to the doc that references them

Combine drawio-mcp with filesystem: Save .drawio + .svg next to the doc that references them✓ コピーしました

ツール

このMCPが提供する機能

ツール入力呼び出すタイミングコスト
generate_diagram (see docs) NL → drawio XML 1 call
edit_diagram (see docs) Apply instructions to existing XML 1 call
validate (see docs) Schema-check XML 1 call
export (see docs) Render to PNG / SVG / PDF 1 call

コストと制限

運用コスト

APIクォータ
N/A (local rendering)
呼び出しあたりのトークン
XML is moderate size
金額
Free OSS
ヒント
Keep .drawio source in repo; commit .svg next to it for previews

セキュリティ

権限、シークレット、影響範囲

認証情報の保管: No credentials
データ送信先: None (local)

トラブルシューティング

よくあるエラーと対処法

Validation fails on generated XML

Ask the model to regenerate citing the schema; common issues: missing geometry parents

Exported SVG huge

Use --simplify; flatten transforms before export

代替案

draw.io MCP 他との比較

代替案代わりに使う場面トレードオフ
Mermaid (text-only)Simple flow / sequence diagramsLess control over layout
Excalidraw MCPYou prefer hand-drawn aestheticDifferent file format

その他

リソース

📖 GitHub の公式 README を読む

🐙 オープンな issue を見る

🔍 400以上のMCPサーバーとSkillsを見る