Skip to main content
Glama

Draw.io MCPサーバー

最も広く普及しているダイアグラム作成ツールであるDraw.io (Diagrams.net) を使って、快適なダイアグラム作成(Vibe Diagramming)を始めましょう。

Discord channel Build project Version

主なハイライト

  • XML、SVG(XML埋め込み)、PNG(XML埋め込み)形式でのダイアグラムのインポートとエクスポート v2.0.0

  • ウェイポイントと自動自己コネクタルーティングによるエッジジオメトリ制御 v2.0.0

  • ネストされたシェイプとグループ化のための親子関係 v2.0.0

  • サーバーと拡張機能を同一モノレポで統合 v2.0.0

  • Draw.ioエディタ内蔵 - ブラウザ拡張機能は不要 v1.8.0

  • AIエージェントがDraw.ioのダイアグラムを制御できるMCPサーバー

  • MCPツールを介したプログラムによるダイアグラムの作成、検査、変更

  • 複雑なダイアグラムのためのレイヤー管理

  • あらゆるMCPクライアント(Claude Desktop、Claude Code、Zed、Codexなど)で動作

Related MCP server: Draw.io MCP Server

はじめに

Draw.io MCPサーバーは、AIエージェントにDraw.ioのダイアグラム作成機能を提供します。ダイアグラム要素の作成、読み取り、更新、削除が可能なMCPツールを提供し、AIアシスタントがアーキテクチャ図、フローチャート、視覚的なドキュメントを自動的に構築できるようにします。

利用方法は2通りあります:

  1. 内蔵エディタ - サーバーが直接Draw.ioをホストし、ブラウザからアクセス可能

  2. ブラウザ拡張機能 - 拡張機能を通じてブラウザで実行中のDraw.ioに接続

要件

  • Node.js (v20以上) - MCPサーバーの実行環境

  • MCPクライアント - Claude Desktop、Claude Code、Zed、Codex、OpenCode、またはMCP互換ホスト

内蔵エディタの場合

追加要件はありません。--editorフラグを付けて実行するだけです。

ブラウザ拡張機能の場合

オプション

  • pnpm - 推奨パッケージマネージャー(npmでも動作します)

クイックスタート

1. MCPホストの設定

MCPクライアントの設定にサーバーを追加します:

~/Library/Application Support/Claude/claude_desktop_config.json を編集します:

{
  "mcpServers": {
    "drawio": {
      "command": "npx",
      "args": ["-y", "drawio-mcp-server", "--editor"]
    }
  }
}
claude mcp add-json drawio '{"type":"stdio","command":"npx","args":["-y","drawio-mcp-server","--editor"]}'

~/.config/zed/settings.json に追加します:

{
  "context_servers": {
    "drawio": {
      "command": "npx",
      "args": ["-y", "drawio-mcp-server", "--editor"],
      "env": {}
    }
  }
}

~/.codex/config.toml を編集します:

[mcp_servers.drawio]
command = "npx"
args = ["-y", "drawio-mcp-server", "--editor"]

プロジェクトルートまたは ~/.config/opencode/opencode.json の opencode.json に追加します:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "drawio": {
      "type": "local",
      "command": ["npx", "-y", "drawio-mcp-server", "--editor"],
      "enabled": true
    }
  }
}

その他のMCPクライアントや詳細な設定(pnpmオプションを含む)については、Configuration を参照してください。

2. エディタを開く

MCPホストを再起動した後、以下を開きます: http://localhost:3000/

3. ダイアグラム作成を開始

試せるプロンプトの例:

"プロデューサー、コンシューマー、3つのバックエンドサービスを持つメッセージキューを示すイベント駆動型アーキテクチャ図を作成して"

"データベース、APIゲートウェイ、およびエンドポイントを持つ4つのマイクロサービスを含むCRUD API図を描いて"

"'Background'という新しいレイヤーを追加して装飾要素をすべてそこに移動し、注釈用の新しいレイヤーを作成して"

これで、AIアシスタントがMCPツールを使用してダイアグラムを制御できるようになります。

機能

サーバーは以下のためのMCPツールを提供します:

  • ダイアグラムの検査 - シェイプ、レイヤー、セルプロパティの読み取り

  • ダイアグラムの変更 - シェイプ、エッジ、ラベルの追加/編集/削除

  • レイヤー管理 - レイヤーの作成、切り替え、整理

利用可能なツールの完全なリストについては、Tools Reference を参照してください。

インストール

サーバーはMCPホストの一部として実行されます。npmおよびpnpmオプションを含む、サポートされているすべてのクライアント(Claude Desktop、Claude Code、Zed、Codex、oterm)の詳細な設定は Configuration で確認できます。

代替手段:ブラウザ拡張機能

内蔵エディタの代わりに、ブラウザ拡張機能 を使用して、ブラウザで実行中のDraw.ioに接続することもできます。これは --editor フラグの有無にかかわらず動作します。

  1. ブラウザでDraw.ioを開く

  2. Draw.io MCPブラウザ拡張機能をインストール:

  3. 拡張機能が接続されていることを確認(アイコンに緑色の信号オーバーレイが表示されます)

--editor を使用しない設定:

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

詳細については、拡張機能のドキュメント を参照してください。

関連リソース

Configuration - CLIフラグと高度なオプション

Tools Reference - MCPツールの完全なドキュメント

Troubleshooting

Prompt examples

Contributing

Architecture

Development

スターの推移

評価

MSeeP.ai Security Assessment Badge

Available Tools

13 tools
add-cell-of-shapeC

This tool allows you to add new vertex cell (object) on the current page of a Draw.io diagram by its shape name. It accepts multiple optional input parameter.

Inputs: shape_name (required), x, y, width, +3 more.

add-edgeC

This tool creates an edge, sometimes called also a relation, between two vertexes (cells).

Inputs: source_id (required), target_id (required), text, style.

add-rectangleC

This tool allows you to add new Rectangle vertex cell (object) on the current page of a Draw.io diagram. It accepts multiple optional input parameter.

Inputs: x, y, width, height, +2 more.

delete-cell-by-idC

Deletes a cell, whether it is a vertex or edge.

Inputs: cell_id (required).

edit-cellA

Update properties of an existing vertex/shape cell by its ID. Only provided fields are modified; unspecified properties remain unchanged.

Inputs: cell_id (required), text, x, y, +3 more.

edit-edgeA

Update properties of an existing edge by its ID. Only provided fields are modified; unspecified properties remain unchanged.

Inputs: cell_id (required), text, source_id, target_id, +1 more.

get-selected-cellB

This tool allows you to retrieve selected cell (whether vertex or edge) on the current page of a Draw.io diagram. The response is a JSON containing attributes of the cell.

Inputs: no named parameters.

get-shape-by-nameA

Retrieve a specific shape by its name from all available shapes in the diagram's library. It returns the shape and also the category it belongs.

Inputs: shape_name (required).

get-shape-categoriesB

Retrieves available shape categories from the diagram's library. Library is split into multiple categories.

Inputs: no named parameters.

get-shapes-in-categoryC

Retrieve all shapes in the provided category from the diagram's library. A shape primarily contains style based on which you can create new vertex cells.

Inputs: category_id (required).

list-paged-modelA

Retrieves a paginated view of all cells (vertices and edges) in the current Draw.io diagram. This tool provides access to the complete model data with essential fields only, sanitized to remove circular dependencies and excessive data. It allows to filter based on multiple criteria and attribute boolean logic. Useful for programmatic inspection of diagram structure without overwhelming response sizes.

Inputs: page, page_size, filter.

set-cell-dataC

Sets or updates a custom attribute on an existing cell.

Inputs: cell_id (required), key (required), value (required).

set-cell-shapeC

Updates the visual style of an existing vertex cell to match a library shape by name.

Inputs: cell_id (required), shape_name (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 13 tools

    Disambiguation3/5

    The tools have clear purposes but some overlap exists, such as add-cell-of-shape and add-rectangle both adding vertex cells, which could cause confusion. However, descriptions help differentiate them by shape specificity, and most tools target distinct actions like editing, deleting, or retrieving cells.

    Naming Consistency4/5

    Tool names follow a consistent verb_noun pattern with minor deviations, such as list-paged-model using 'paged' instead of a direct noun. Most names are clear and readable, like delete-cell-by-id and get-shape-by-name, maintaining a predictable structure throughout the set.

    Tool Count5/5

    With 13 tools, the count is well-scoped for a diagram editing server, covering essential operations like adding, editing, deleting, and retrieving cells and shapes. Each tool earns its place by addressing specific needs in diagram manipulation without being overwhelming.

    Completeness4/5

    The toolset provides comprehensive coverage for diagram editing, including CRUD operations for cells and edges, shape management, and data inspection. Minor gaps exist, such as no direct tool for creating new pages or handling diagram-level properties, but agents can work around these with existing tools.

    Maintenance

    ActivityMaintained
    ResponsivenessMixed handling

    Related MCP Connectors

    Related MCP Servers