Get the FREE Ultimate OpenClaw Setup Guide →

drawio

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.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio simonkurtz-msft-drawio-mcp-server deno run --allow-net --allow-read --allow-env /path/to/drawio-mcp-server/src/index.ts \
  --env HTTP_PORT="HTTP server port" \
  --env TRANSPORT="Transport type: stdio, http, or stdio,http" \
  --env LOGGER_TYPE="Logger implementation: console or mcp_server" \
  --env SAVE_DIAGRAMS="Dev mode only — enable auto-saving of diagrams (true/1 to enable)" \
  --env AZURE_ICON_LIBRARY_PATH="Path to Azure icon library XML file (auto-detected from assets/ if unset)"

How to use

This Draw.io MCP Server exposes a server that generates Draw.io XML directly from MCP requests. It supports both stdio and HTTP transports, allowing MCP clients such as Claude Desktop, VS Code, Codex, or Zed to query and export Draw.io diagrams without launching a browser or Draw.io instance. The server leverages Deno to run the TypeScript implementation and produces standard Draw.io XML that can be imported back into Draw.io Desktop or the web app. When starting with HTTP transport enabled, clients can POST or stream requests to /mcp to obtain diagram XML, and the server can be configured to save/export outputs in development mode if SAVE_DIAGRAMS is enabled.

How to install

Prerequisites:

  • Deno v2.3 or higher installed on your system (or use Docker as an alternative).

Option A: Install and run directly with Deno

  1. Install Deno from https://deno.com/
  2. Clone the repository and navigate to the project root
  3. Run the server (example):
deno run --allow-net --allow-read --allow-env /path/to/drawio-mcp-server/src/index.ts

Option B: Run via Docker (recommended for isolation)

  1. Install Docker
  2. Pull the image (if published) or build locally using the Dockerfile in the repo
  3. Run the container:
docker run -i --rm simonkurtzmsft/drawio-mcp-server

Environment variables (optional but recommended):

  • AZURE_ICON_LIBRARY_PATH: Path to the Azure icon library XML
  • LOGGER_TYPE: console or mcp_server
  • HTTP_PORT: Port for HTTP transport (default 8080)
  • TRANSPORT: stdio, http, or stdio,http
  • SAVE_DIAGRAMS: true to enable development mode auto-save of diagrams

Transport configuration examples are shown in the quick-start sections of the README.

Additional notes

Notes and tips:

  • The server exports Draw.io XML directly; no browser-based rendering is required.
  • If using HTTP transport, the health endpoint is available at /health and the main endpoint is /mcp.
  • Development mode SAVE_DIAGRAMS is discouraged for production; enable only for local debugging.
  • Ensure the Azure icon library path is accessible by the running process to populate icon sets.
  • When using MCP clients, ensure the command and arguments match the path to src/index.ts in your deployment (adjust /path/to/drawio-mcp-server/src/index.ts accordingly).

Related MCP Servers

Sponsor this space

Reach thousands of developers