Draw.io MCP Serverのロゴ

Draw.io MCP Server

コミュニティ
simonkurtz-MSFT

A Model Context Protocol (MCP) server for programmatic diagram generation using Draw.io (Diagrams.net). This server generates Draw.io XML directly — no browser extension or Draw.io instance required.

公開者simonkurtz-MSFT
リポジトリdrawio-mcp-server
言語TypeScript
フォーク
18
スター
81
利用可能なツール
0
通信方式stdio, streamable-http
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Draw.io MCP Serverは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには81件のスターと18件のフォークがあります。

Draw.io MCP Server

A Model Context Protocol (MCP) server for programmatic diagram generation using Draw.io (Diagrams.net). This server generates Draw.io XML directly — no browser extension or Draw.io instance required.

Build project

Docker Hub

AgentSeal MCP

Demo Video

Draw.io MCP Server Demo

Acknowledgements

This project would not exist in this manner if it weren't for the following repositories and their authors. Thank you!

Features

  • 700+ Azure Architecture Icons — Official Microsoft icons with embedded SVG data, organized into ~20 categories (Compute, Networking, Storage, Databases, AI + ML, Security, and more)
  • Basic Shapes — Rectangles, ellipses, diamonds, parallelograms, and other flowchart primitives
  • Fuzzy Search — Find shapes by partial name across the entire icon library
  • Batch Operations — Create and update multiple cells in a single call for better performance
  • Layer Management — Create, list, and organize cells across layers
  • Style Presets — Built-in Azure, flowchart, and general color presets
  • Multiple Transports — stdio (default) and streamable HTTP
  • XML Export — Standard Draw.io XML format compatible with Draw.io desktop and web

For PNG/SVG/PDF conversion, use jgraph's Draw.io skill-cli workflow: https://github.com/jgraph/drawio-mcp/blob/main/skill-cli/README.md.

Documentation

Requirements

  • Deno v2.3 or higher

Quick Start

From Source

sh
deno run --allow-net --allow-read --allow-env src/index.ts

MCP Client Configuration

Configure your MCP client (Claude Desktop, VS Code, Codex, etc.) to use the server:

Claude Desktop

Edit claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
json
{
  "mcpServers": {
    "drawio": {
      "command": "deno",
      "args": ["run", "--allow-net", "--allow-read", "--allow-env", "/path/to/drawio-mcp-server/src/index.ts"]
    }
  }
}

VS Code

Add to your VS Code settings or .vscode/mcp.json:

json
{
  "mcpServers": {
    "drawio": {
      "command": "deno",
      "args": ["run", "--allow-net", "--allow-read", "--allow-env", "/path/to/drawio-mcp-server/src/index.ts"]
    }
  }
}

Zed

In the Assistant settings, add a Context Server:

json
{
  "drawio": {
    "command": "deno",
    "args": ["run", "--allow-net", "--allow-read", "--allow-env", "/path/to/drawio-mcp-server/src/index.ts"],
    "env": {}
  }
}

Codex

Edit ~/.codex/config.toml:

toml
[mcp_servers.drawio]
command = "deno"
args = ["run", "--allow-net", "--allow-read", "--allow-env", "/path/to/drawio-mcp-server/src/index.ts"]

For a locally running HTTP transport:

toml
[mcp_servers.drawio]
url = "http://localhost:8080/mcp"

oterm (Ollama)

Edit ~/.local/share/oterm/config.json:

json
{
  "mcpServers": {
    "drawio": {
      "command": "deno",
      "args": ["run", "--allow-net", "--allow-read", "--allow-env", "/path/to/drawio-mcp-server/src/index.ts"]
    }
  }
}

Configuration

Transport Selection

The --transport flag controls which transports to start. Default is stdio.

FlagDescription
--transport stdiostdio only (default)
--transport httpHTTP only
--transport stdio,httpBoth transports

Environment Variables

VariableDescriptionDefault
AZURE_ICON_LIBRARY_PATHPath to Azure icon library XML file (auto-detected from assets/ if unset)(detected)
LOGGER_TYPELogger implementation: console or mcp_serverconsole
HTTP_PORTHTTP server port (CLI --http-port takes precedence)8080
TRANSPORTTransport type: stdio, http, or stdio,http (CLI --transport takes precedence)stdio
SAVE_DIAGRAMS⚠️ DEV MODE ONLY — Auto-save diagram XML to ./diagrams/ on export/finish(disabled)

Tip: You can create a .env file from .env.example to configure environment variables locally:

sh
cp .env.example .env
# Edit .env and uncomment/set SAVE_DIAGRAMS=true or other variables

The server automatically loads .env files at startup. The .env file is gitignored and won't be committed to the repository.

Development Mode — Auto-save Diagrams

⚠️ WARNING: DEVELOPMENT MODE ONLY — NOT FOR PRODUCTION USE

For local debugging and development, you can enable automatic saving of diagram XML to a local diagrams/ folder. This is useful for inspecting generated diagrams without manually copying XML output.

To enable:

sh
export SAVE_DIAGRAMS=true
deno task start

or

sh
SAVE_DIAGRAMS=true deno task start

Behavior when enabled:

  • Every call to export-diagram or finish-diagram automatically saves the XML to ./diagrams/<timestamp>_<tool-name>.drawio
  • Timestamp format: YYYYMMDD_HHMMSS (e.g., 20260219_143052_export-diagram.drawio)
  • The diagrams/ folder is created automatically if it doesn't exist
  • Errors during file saving are logged but do not fail the tool operation

To disable (default):

Simply unset the environment variable or set it to any value other than true or 1:

sh
unset SAVE_DIAGRAMS

or

sh
export SAVE_DIAGRAMS=false

Security note: This feature is disabled by default and should never be enabled in production or containerized deployments. It is intended solely for local development and debugging.

HTTP Transport

The HTTP transport exposes a streamable HTTP endpoint at /mcp (default port 8080).

sh
deno task start:http
# or with a custom port:
deno run --allow-net --allow-read --allow-env src/index.ts --transport http --http-port 4000

MCP client configuration for HTTP:

json
{
  "mcpServers": {
    "drawio": {
      "command": "deno",
      "args": [
        "run",
        "--allow-net",
        "--allow-read",
        "--allow-env",
        "/path/to/drawio-mcp-server/src/index.ts",
        "--transport",
        "http",
        "--http-port",
        "4000"
      ]
    }
  }
}

Health check: curl http://localhost:8080/health

Docker

The Docker image uses deno compile to produce a self-contained native binary, then runs it on a minimal distroless base image (~20MB) with no shell, no package manager, and a non-root user.

Pulling from Docker Hub

A pre-built image is available on Docker Hub. This is the fastest way to get started — no cloning or building required.

1. Pull the latest image:

sh
docker pull simonkurtzmsft/drawio-mcp-server:latest

2. Start the container:

sh
docker run -d --name drawio-mcp-server -p 8080:8080 simonkurtzmsft/drawio-mcp-server:latest

This starts the server in the background, exposing the HTTP transport on port 8080.

3. Verify the server is running:

sh
curl http://localhost:8080/health

You should receive an OK response, confirming the server is healthy and ready to accept connections.

4. Point your MCP client to the running container. For example, in VS Code (.vscode/mcp.json):

json
{
  "mcpServers": {
    "drawio": {
      "url": "http://localhost:8080/mcp"
    }
  }
}

Or in Claude Desktop (claude_desktop_config.json):

json
{
  "mcpServers": {
    "drawio": {
      "url": "http://localhost:8080/mcp"
    }
  }
}

5. To stop and remove the container:

sh
docker stop drawio-mcp-server
docker rm drawio-mcp-server

Building Locally

To build the image from source instead of pulling from Docker Hub:

sh
# Build
docker build -t drawio-mcp-server .

# Run (exposes HTTP on port 8080)
docker run -d --name drawio-mcp-server -p 8080:8080 drawio-mcp-server

Docker Compose

sh
cp .env.example .env   # Configure REGISTRY and IMAGE_VERSION
docker compose up -d

The .env file supports:

  • REGISTRY — Docker registry URL (e.g., docker.io/myusername)
  • IMAGE_VERSION — Semantic version for image tags (e.g., 1.0.0)

Note: The distroless image has no shell, so in-container health checks (wget, curl) are not available. Use external health checks (e.g., Kubernetes liveness probes, load balancer health checks) to monitor the /health endpoint.

Tools

Performance tip: All cell-manipulation tools accept arrays — pass ALL items in a single call rather than calling a tool repeatedly.

Stateless contract: Diagram tools are stateless per call. Pass the full prior diagram_xml into each diagram-related tool call, and carry forward the returned diagram_xml from the response for the next call.

Shape Discovery

ToolDescription
search-shapesFuzzy search for shapes including 700+ Azure icons. Pass all queries in the queries array.
get-shape-categoriesList all shape categories (General, Flowchart, Azure categories).
get-shapes-in-categoryList all shapes in a category by category_id.
get-style-presetsGet built-in style presets (Azure colors, flowchart shapes, edge styles).

Diagram Modification

ToolDescription
add-cellsAdd vertices and/or edges. Supports shape_name for icon resolution, temp_id for within-batch references, and dry_run validation.
edit-cellsUpdate vertex cell properties (position, size, text, style).
edit-edgesUpdate edge properties (text, source, target, style).
set-cell-shapeApply library shape styles to existing cells.
delete-cell-by-idRemove a cell (vertex or edge) by ID. Cascade-deletes connected edges for vertices.

Diagram Inspection

ToolDescription
list-paged-modelPaginated view of all cells with filtering by type.
get-diagram-statsStatistics about cell counts, bounds, and layer distribution.
export-diagramExport the diagram as Draw.io XML.
import-diagramImport a Draw.io XML string, replacing the current diagram.
clear-diagramClear all cells and reset the diagram.

Layer Management

ToolDescription
list-layersList all layers with IDs and names.
set-active-layerSet the active layer for new elements.
create-layerCreate a new layer.
move-cell-to-layerMove a cell to a different layer.

Page Management

ToolDescription
create-pageCreate a new page (tab) in the diagram.
list-pagesList all pages with IDs and names.
get-active-pageGet the currently active page.
set-active-pageSwitch to a different page.
rename-pageRename an existing page.
delete-pageDelete a page and all its contents. Cannot delete the last page.

Group / Container Management

ToolDescription
create-groupsCreate group/container cells for VNets, subnets, resource groups, etc.
add-cells-to-groupAssign cells to groups.
remove-cell-from-groupRemove a cell from its group, returning it to the active layer.
list-group-childrenList all cells contained in a group.

Add Cells Example

Use add-cells with temp_id references to create vertices and edges in a single call:

json
{
  "cells": [
    {
      "type": "vertex",
      "temp_id": "web",
      "x": 100,
      "y": 100,
      "width": 60,
      "height": 60,
      "text": "Web",
      "style": "aspect=fixed;html=1;image;image=img/lib/azure2/compute/Container_Instances.svg;"
    },
    {
      "type": "vertex",
      "temp_id": "api",
      "x": 220,
      "y": 100,
      "width": 60,
      "height": 60,
      "text": "API",
      "style": "aspect=fixed;html=1;image;image=img/lib/azure2/compute/Container_Instances.svg;"
    },
    { "type": "edge", "source_id": "web", "target_id": "api", "text": "HTTPS" }
  ]
}

Azure Icon Library

The server includes 700+ official Azure architecture icons from dwarfered/azure-architecture-icons-for-drawio, organized into categories:

CategoryExamples
AI + Machine LearningCognitive Services, Azure OpenAI, Bot Service, Machine Learning
AnalyticsSynapse Analytics, Databricks, Data Factory, Event Hubs
App ServicesApp Service, Static Web Apps
ComputeVirtual Machines, Functions, AKS, Container Instances, Batch
ContainersContainer Registry, Container Instances, AKS
DatabasesSQL Database, Cosmos DB, Cache for Redis, PostgreSQL
DevOpsAzure DevOps, Pipelines, Repos
IdentityAzure AD, Key Vault
IntegrationService Bus, Logic Apps, API Management, Event Grid
Management + GovernanceMonitor, Automation, Policy, Log Analytics
NetworkingFront Door, Load Balancer, Application Gateway, VPN Gateway, Firewall
SecuritySentinel, Security Center
StorageStorage Account, Blob Storage, File Storage, Disk Storage

Icons use embedded base64 SVG data — no external dependencies, works fully offline with correct Azure branding and colors.

The library loads lazily on first access (singleton pattern). Search operations are <5ms after initial load.

Development

Setup

sh
git clone https://github.com/simonkurtz-MSFT/drawio-mcp-server.git
cd drawio-mcp-server

No install step needed — Deno resolves dependencies on first run.

Common Commands

CommandDescription
deno task startStart with stdio + HTTP transports
deno task start:httpStart with HTTP transport only
deno task devWatch mode — auto-restart on changes
deno task testRun tests
deno task test:watchRun tests in watch mode
deno task test:coverageRun tests with coverage
deno task benchRun focused performance benchmarks
deno task lintLint and type-check
deno task fmtFormat code
deno task fmt:checkCheck formatting without writing
deno task compileCompile to a self-contained binary
deno task updateUpdate dependencies and Docker Deno

deno task update refreshes deno.json dependency requirements and deno.lock via deno outdated --update --latest, then updates the Docker builder image's DENO_VERSION argument to the latest stable Deno GitHub release.

MCP Inspector

Use the MCP Inspector to debug the server:

sh
deno task inspect

After making changes, Restart the Inspector. After changing tool definitions, Clear and List the tools again.

Related Approaches

Note: The comparisons below are all as of February 2026. Both projects and the agent skill continue to evolve — check their repositories for the latest state.

This project is a fork of lgazo/drawio-mcp-server by Ladislav Gazo. The original acts as a bridge to a live Draw.io instance via a WebSocket browser extension for interactive, real-time diagram control. This fork is a standalone XML generator — it builds diagrams in memory and outputs Draw.io XML without needing a browser or Draw.io instance. thomast1906/github-copilot-agent-skills takes yet another approach: a Copilot Agent Skill that constructs raw Draw.io XML and sends it to the hosted mcp.draw.io service, guided by prompt instructions and a static Azure icon catalog.

Aspectsimonkurtz-MSFTOriginal (lgazo)Agent Skill (thomast1906)
ArchitectureStandalone MCP server — generates XML in memoryBridge to live Draw.io via WebSocket browser extensionCopilot Agent Skill + hosted mcp.draw.io endpoint
RuntimeDeno (TypeScript)Node.js + pnpm (TypeScript + JavaScript)None (prompt-driven)
Draw.io instance required❌✅ Browser + MCP extension❌ (uses hosted endpoint)
Setup effortClone + Deno, or docker pullnpx + browser extension + open Draw.ioDrop SKILL.md + catalog into repo
Batch operations✅ Arrays in add-cells, edit-cells, etc.❌ One tool call per cell✅ Full XML in one shot
Azure icons✅ 700+ embedded base64 SVG✅ From live Draw.io libraries✅ Static catalog (img/lib/azure2/…)
Fuzzy shape search✅ search-shapes❌ Exact name lookup only❌
Page management✅❌❌
Group / container management✅❌❌
Iterative editing✅ Stateful model, incremental calls✅ Live edits in Draw.io❌ Regenerate full XML each time
Interactive features❌ Stateless XML generation✅ get-selected-cell, set-cell-data❌
Docker / cloud deployment✅ Distroless image (~20 MB)❌ npm package only❌ Relies on hosted endpoint
Offline support✅ Fully offline⚠️ Needs browser with Draw.io❌ Requires internet
Best forCI/CD, containers, headless / offline batch generationInteractive diagramming with real-time visual feedbackQuick one-shot diagrams with zero install

All three approaches are valid — the right choice depends on whether you need interactive visual feedback (original), headless batch generation (this fork), or a zero-install agent skill.

License

MIT

インストール

TypingMind
{
  "mcpServers": {
    "drawio-mcp-server": {
      "command": "deno",
      "args": [
        "run",
        "--allow-net",
        "--allow-read",
        "--allow-env",
        "/path/to/drawio-mcp-server/src/index.ts"
      ]
    }
  }
}

Draw.io MCP ServerのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Draw.io MCP Serverに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 お使いのデバイス上でMCPをローカル実行することも、リモートMCPサーバーのURLに接続することもできます。

方法1:ローカルコネクタを使用

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Draw.io MCP Serverをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Draw.io MCP ServerのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "drawio-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてDraw.io MCP ServerのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Draw.io MCP ServerのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Draw.io MCP Serverを使ってこのタスクを手伝ってもらえますか?
Draw.io MCP Server
はい、読みました。
Draw.io MCP Serverで調べた結果をお伝えします。

方法2:MCPサーバーのURLを追加

Draw.io MCP Serverがすでにリモートでホストされている場合や、チームの複数のユーザーで1つのコネクタを共有したい場合は、この方法を使います。

1

MCPコネクタを開く

TypingMindで「プラグイン」に移動し、「MCPコネクタ」を開いて「URLを追加」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 「プラグイン」に移動してください。
  3. 「MCPコネクタ」を開いてください。
  4. 「URLを追加」をクリックします。
TypingMindの「カスタムMCPサーバーURLを追加」フォーム
2

サーバーURLを貼り付け

「サーバーURL」欄にプロバイダーから提供されたMCPサーバーのURLを入力してください。サーバーで必要とされる場合は、接続名、説明、アイコン、カスタムHTTPヘッダー、OAuthクライアント設定を追加してください。

  1. 「サーバーURL」欄にプロバイダーから提供されたMCPサーバーのURLを貼り付けてください。
  2. Draw.io MCP Serverの接続名を入力してください。
  3. 接続を識別しやすくするには、説明とアイコンを追加してください。
  4. サーバーで認証が必要な場合は、カスタムHTTPヘッダーまたはOAuthクライアントの詳細情報を追加してください。
3

接続を作成

「接続を作成」をクリックし、プラグイン一覧に戻って、新しいMCP接続が有効になっていることを確認してください。

  1. 「接続を作成」をクリックします。
  2. MCPコネクタの一覧に戻ってください。
  3. Draw.io MCP Serverの接続が「有効」と表示されていることを確認してください。
  4. 接続がすぐに表示されない場合は、プラグイン一覧を更新してください。
4

再接続せずにモデルを切り替え

お好みのモデルでチャットを開始し、「プラグイン」でDraw.io MCP Serverのツールを有効にしてください。必要に応じて別のモデルに切り替えられます。MCP接続は、TypingMindのワークスペースで引き続き利用できます。

  1. TypingMindで新しいチャットを開始してください。
  2. 使用するAIモデルを選択してください。
  3. 「プラグイン」でDraw.io MCP Serverのツールを有効にしてください。
  4. 必要に応じて、ツールを使うようモデルに依頼してください。
  5. 別のAIモデルに切り替えて、同じMCP接続を再利用してください。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Draw.io MCP Serverを使ってこのタスクを手伝ってもらえますか?
Draw.io MCP Server
はい、読みました。
Draw.io MCP Serverで調べた結果をお伝えします。

よくある質問

Draw.io MCP Server MCPサーバーは何に使いますか?

Draw.io MCP Serverは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでDraw.io MCP Server MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでDraw.io MCP Serverを利用できます。

TypingMindでDraw.io MCP Server MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Draw.io MCP Serverを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Draw.io MCP Server MCPをTypingMindに接続するにはどうすればよいですか?

Draw.io MCP Serverは、ローカルMCPコネクタを使うか、リモートMCPサーバーのURLを追加することでTypingMindに接続できます。サーバーがデバイス上のファイル、アプリ、プライベートリソースにアクセスする必要がある場合はローカルコネクタを、MCPサーバーがリモートでホストされている場合はサーバーURLを使用してください。

TypingMindでDraw.io MCP Server MCPのどのようなツールを利用できますか?

Draw.io MCP ServerはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Draw.io MCP Server MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Draw.io MCP Serverで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇