Drawio

Design and media

Draw.io Model Context Protocol (MCP) Server.

Your AI app calls the Drawio MCP server, which does the design and media work and sends the result back to the chat.

About Drawio

Drawio is a community MCP server from lgazo, filed in our directory under design and media. Draw.io Model Context Protocol (MCP) Server.

At a glance

Publisher
lgazo (community)
Runs
See the README for setup
Written in
TypeScript
License
MIT
GitHub stars
1,505

How to set up Drawio

  1. Follow the install steps in the Drawio README; it is written in TypeScript, so have that toolchain ready.
  2. Check the Drawio README for keys or settings; the registry lists none that Drawio requires.
  3. Add Drawio to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Drawio tools to confirm the connection.
  5. Run one read-only task with Drawio first, and keep your app asking before each tool call until the results look right.

Drawio compared with similar servers

  • Voicemode by mbailey has fewer GitHub stars than Drawio (1.5k against 1.5k); both are community servers, and both run locally.
  • Clipforge by xixihhhh has more GitHub stars than Drawio (1.5k against 1.5k); both are community servers, and both run locally.
  • Xiaozhi Esp32 Server Java by joey-zhou has fewer GitHub stars than Drawio (1.4k against 1.5k); both are community servers, and both run locally.

Before you connect Drawio

  • Give Drawio its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Drawio tool call until you trust what it does with them.
  • Treat text that Drawio fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Drawio on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Drawio

How marketing and sales teams put Drawio to work, by company size. Pick the size closest to yours and start Drawio on one use case.

Small business

  • A small business can use Drawio to resize and adapt one design for every channel instead of hiring for each version.
  • Owners can ask Drawio to pull brand assets and make quick ad and social variations that still look on brand.
  • Drawio runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Creative teams can connect Drawio so agents produce variants for testing while designers keep control of the master files.
  • Marketing teams can use Drawio to hand off designs to web and ads with specs attached, cutting review rounds.
  • Start Drawio on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises can use Drawio with brand rules and approved assets only, so generated work stays inside the brand system.
  • Large creative ops teams can use Drawio to localize and version assets for many markets with review built in.
  • Drawio is a community server, so have security review the code and pin a version before Drawio touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Drawio README

From lgazo/drawio-mcp-server on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

Draw.io MCP server

English · 简体中文

Let's do some Vibe Diagramming with the most wide-spread diagramming tool called Draw.io (Diagrams.net).

Key Highlights

  • Security hardening (GHSA-c583-5mg8-qmwc / GHSA-r9h6-wmq3-mvjv): the extension WebSocket handshake validates the Host and Origin headers, cross-site pages, spoofed hosts, and the opaque null origin are refused with 403; headerless non-browser clients need the new --allow-headerless-ws-clients flag, and the new --allowed-host flag opts DNS names into the Host guards

  • export-diagram revalidates the draw.io view of a page in a background tab before exporting, so exports no longer capture a stale view

  • Security hardening (GHSA-jvqm-g5ch-jh76): HTTP transport binds to 127.0.0.1 by default, emits no CORS headers unless --cors-origin is configured, validates Host/Origin on /mcp, and confines export-diagram writes to the export directory (--export-dir, XDG data dir by default)

  • Browser extension UI and documentation localized to Simplified Chinese (zh-CN)

  • Claude Code plugin: /plugin marketplace add lgazo/drawio-mcp-server then /plugin install drawio, with /drawio-open and /drawio-status slash commands

  • npx drawio-mcp-server install <host> writes the MCP config for claude-code, claude-desktop, codex, zed, opencode, or all

  • Document persistence tools: set-document-title and save-document

  • Draw.io library API version compatibility mechanism

  • Enable Draw.io MCP in IFrames

  • AWS, GCP, Azure, Cisco19, and CiscoSafe stencils auto-discovered at runtime from drawio's sidebar

  • Multi-document targeting with list-documents and target_document selectors for multi-tab workflows

  • Multi-page targeting with required target_page selectors for page-scoped tools

  • Per-document FIFO serialization for live operations, so multiple agents can work on different files safely

  • Page management tools: list-pages, get-current-page, create-page, copy-page, rename-page

  • Import, embed, or expand Mermaid diagrams

  • Firefox support is back, TLS mode is necessary

  • Server supports TLS mode and optionally generates self-signed certificates

  • Import and export diagrams from/to XML, SVG (with embedded XML), or PNG (with embedded XML)

  • Edge geometry control with waypoints and automatic self-connector routing

  • Parent-child relationships for nested shapes and grouping

  • Unified Server and Extension in the same mono-repo

  • Built-in Draw.io editor - no browser extension required

  • MCP server that lets AI agents control Draw.io diagrams

  • Programmatic diagram creation, inspection, and modification via MCP tools

  • Layer management for complex diagrams

  • Works with any MCP client (Claude Desktop, Claude Code, Zed, Codex, etc.)

Introduction

The Draw.io MCP server brings Draw.io diagramming capabilities to AI agents. It provides MCP tools that can create, read, update, and delete diagram elements - letting AI assistants build architectural diagrams, flowcharts, and visual documentation automatically.

Two ways to use:

  1. Built-in editor - Server hosts Draw.io directly, accessible in your browser
  2. Browser extension - Connect to Draw.io running in your browser via extension

Experimental: integration with the draw.io desktop (Electron) app is in progress but currently blocked by an upstream CSP issue, see DESKTOP.md.

Requirements

  • Node.js (v22 or higher; tested against v22 LTS and v24 LTS) - Runtime environment for the MCP server
  • MCP client - Claude Desktop, Claude Code, Zed, Codex, OpenCode, or any MCP-compatible host
For Built-in Editor

No additional requirements - runs out of the box with --editor flag.

For Browser Extension
Optional
  • pnpm - Preferred package manager (npm works fine too)

Quick Start

1. Configure your MCP host

Fastest path:

  • Claude Code: /plugin marketplace add lgazo/drawio-mcp-server then /plugin install drawio.
  • Any other host: npx drawio-mcp-server install <host> where <host> is claude-code, claude-desktop, codex, zed, opencode, or all.

See docs/PLUGINS.md for the full reference, flags, and uninstall, and docs/release.md for how releases are cut.

Manual install (JSON snippet, Claude Desktop example)

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

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

For other MCP clients and detailed configuration (including pnpm options), see Configuration.

2. Open the editor

After restarting your MCP host, open: http://localhost:3000/

3. Start diagramming

Example prompts you can try:

"Create an event-driven architecture diagram showing a message queue with producers, consumers, and three backend services"

"Create a three-page event-driven architecture diagram. Use three agents in parallel for service topology, message flow, and retry/failure handling, with each agent assigned to a separate target page."

"Draw a CRUD API diagram with a database, API gateway, and four microservices with their endpoints"

"Add a new layer called 'Background' and move all decorative elements to it, then create a new layer for annotations"

Your AI assistant can now control the diagram using MCP tools.

Features

The server provides MCP tools for:

  • Document discovery - list connected Draw.io document instances and route later calls to a specific tab/file instance
  • Diagram inspection - read shapes, pages, layers, and cell properties
  • Diagram modification - add/edit/delete shapes, edges, and labels on a target page
  • Page management - list pages, inspect the current page, create pages, copy pages, and rename pages without forcing a visible page switch on supported runtimes
  • Layer management - create, switch, and organize layers
  • Vendor shape coverage - AWS, GCP, Azure, Cisco19, and CiscoSafe stencils auto-discovered at runtime from drawio's sidebar, so agents can place icons like mxgraph.gcp2.cloud_run or mxgraph.cisco19.router without hand-curated catalogs
  • Built-in TLS, opt-in HTTPS + WSS with manual cert/key or auto-generated self-signed material via a per-user local CA. See CONFIG.md → TLS.

See Tools Reference for the complete list of available tools.

MCP Apps support

On MCP Apps-capable hosts (Claude Desktop, QuixiDesk, MCPJam, VS Code Copilot), the show-diagram tool opens the diagram as an interactive draw.io editor directly inside the conversation. The framed editor displays the diagram, connects to the server's WebSocket bridge, and registers there as a live document: it appears in list-documents (in embed mode) and agent tool calls (e.g. add-rectangle) apply to it, verified in headless E2E. Syncing user-side edits made in the framed editor so the agent sees them remains pending real-browser verification.

Enable it by running the server with the --editor flag; no other configuration is needed. On hosts without MCP Apps support, show-diagram falls back to returning plain diagram XML text.

Limitation: the MCP host must be able to reach http://localhost:<http-port>, where the locally served draw.io editor is framed. Native desktop hosts like Claude Desktop work; remote browser sessions may not be able to.

See the show-diagram tool for details.

Installation

The server runs as part of your MCP host. Detailed configuration for all supported clients (Claude Desktop, Claude Code, Zed, Codex, oterm) including npm and pnpm options is available in Configuration.

Alternative: Browser Extension

Instead of the built-in editor, you can use the browser extension to connect to Draw.io running in your browser. This works with or without the --editor flag.

  1. Open Draw.io in your browser
  2. Install the Draw.io MCP Browser Extension:
  3. Ensure the extension is connected (green signal overlay on icon)

Configuration without --editor:

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

See the extension documentation for more details.

Experimental: Draw.io Desktop

Integration with the draw.io desktop (Electron) app is experimental and currently blocked end-to-end by an upstream CSP issue. The plugin loads inside draw.io desktop, but its WebSocket connection back to the MCP server is rejected by draw.io's hard-coded connect-src 'self' policy.

See DESKTOP.md for the full setup steps and the current limitation.

Related Resources

Configuration - CLI flags and advanced options

Tools Reference - Complete MCP tools documentation

Troubleshooting

Prompt examples

Contributing

Architecture

Development

Draw.io Desktop (experimental) - install path and known CSP limitation

Star History

Assessments

Questions about Drawio

What is the Drawio MCP server?

Draw.io Model Context Protocol (MCP) Server. Drawio is maintained by lgazo on GitHub at lgazo/drawio-mcp-server, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Drawio MCP server?

Drawio doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (lgazo/drawio-mcp-server). Like most servers, Drawio ends with a command or URL you paste into your AI app's MCP config.

Does Drawio need an API key?

The registry lists no required keys for Drawio. Check the Drawio README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Drawio an official MCP server?

No. Drawio is a community server maintained by lgazo. Community servers can be excellent; read the code and the open issues before you give Drawio access to company data.

What license is Drawio under?

Drawio is released under the MIT license, according to its GitHub repository. The license covers the code of Drawio; the service it connects to has its own terms.