Logotipo de Draw.io MCP 服务器

Draw.io MCP 服务器

ComunidadPopular
lgazo

Draw.io Model Context Protocol (MCP) Server

Editorlgazo
Repositoriodrawio-mcp-server
IdiomaTypeScript
Forks
131
Estrellas
1.5K
Herramientas disponibles
28
Tipo de transportestdio
Categorías
LicenciaMIT
Enlaces
  • Conecta herramientas a flujos de trabajo con IA

    Draw.io MCP 服务器 ofrece funciones MCP que pueden usar los clientes y agentes de IA compatibles.

  • 28 herramientas disponibles

    Explora a continuación las acciones que se pueden invocar, con sus nombres y descripciones cuando el servidor los proporcione.

  • Configuración lista para copiar

    Usa los ejemplos de instalación para configurar este servidor en tu cliente MCP preferido.

  • Indicadores de interés de la comunidad en el repositorio

    NaN estrellas y 131 forks en el repositorio enlazado.

Draw.io MCP server

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

Discord channel Build project Verified on MseeP Version

Key Highlights

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

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

  • Document persistence tools: set-document-title and save-document v2.3.0

  • Draw.io library API version compatibility mechanism v2.2.0

  • 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 v2.1.0

  • Firefox support is back, TLS mode is necessary v2.1.0

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

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

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

  • Parent-child relationships for nested shapes and grouping v2.0.0

  • Unified Server and Extension in the same mono-repo v2.0.0

  • 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.

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

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.

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:

json
{
  "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

MSeeP.ai Security Assessment Badge

Instalación

TypingMind
Requisitos:

Node.js 18+

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

Herramientas disponibles

  • get-selected-cell

    This tool retrieves the selected cell on the target page of the current Draw.io document. If the target page is not currently visible, Draw.io may switch the visible page first because selection is UI-bound.

  • add-rectangle

    This tool allows you to add a new Rectangle vertex cell on the target page of the current Draw.io document.

  • add-edge

    This tool creates an edge, sometimes called also a relation, between two vertexes (cells). When source and target are the same shape (self-connector), a loop edge style is automatically applied if no custom style is provided.

  • delete-cell-by-id

    Deletes a cell from the target page, whether it is a vertex or edge.

  • get-shape-categories

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

  • get-shapes-in-category

    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.

  • get-shape-by-name

    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.

  • add-cell-of-shape

    This tool allows you to add a new vertex cell on the target page of the current Draw.io document by its shape name.

  • set-cell-shape

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

  • set-cell-data

    Sets or updates a custom attribute on an existing cell.

  • edit-cell

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

  • edit-edge

    Update properties of an existing edge by its ID. Only provided fields are modified; unspecified properties remain unchanged. Supports setting waypoints for edge geometry control.

  • list-paged-model

    Retrieves a paginated view of all cells (vertices and edges) on the target page. This tool provides access to the complete model data with essential fields only, sanitized to remove circular dependencies and excessive data.

  • list-layers

    Lists all available layers on the target page with their IDs and names.

  • set-active-layer

    Sets the active layer for creating new elements. All subsequent element creation will happen in this layer. If the target page is not currently visible, Draw.io may switch the visible page first because active-layer state is UI-bound.

  • move-cell-to-layer

    Moves a cell from its current layer to a target layer.

  • set-cell-parent

    Sets the parent of a cell, making it a child of the specified parent cell. This allows creating hierarchical relationships where moving the parent also moves its children.

  • get-active-layer

    Gets the currently active layer information for the target page. If the target page is not currently visible, Draw.io may switch the visible page first because active-layer state is UI-bound.

  • create-layer

    Creates a new layer on the target page.

  • export-diagram

    Export the target page or current diagram as SVG, PNG, or XML. Returns the diagram data as base64 (PNG) or text (SVG/XML). Optionally saves to a file.

  • import-diagram

    Import a diagram from XML, SVG with embedded XML, or PNG with embedded XML into the current Draw.io instance. target_page is required for replace and add, and optional for new-page.

  • import-mermaid

    Insert a Mermaid diagram into the target Draw.io page. Conversion runs inside the Draw.io editor via its bundled Mermaid pipeline (EditorUi.parseMermaidDiagram). mode='native' converts supported Mermaid types into native mxGraph cells; unsupported types fall back to an embedded image cell. mode='embed' always emits a single image cell that preserves the Mermaid source for re-editing inside Draw.io. target_page is required for replace and add, and optional for new-page.

  • list-documents

    Lists all connected Draw.io document instances with their stable instance IDs and basic metadata.

  • list-pages

    Lists all pages in the current Draw.io document with their index, id, name, and current-page flag.

  • get-current-page

    Gets the currently visible page metadata, including index, id, name, and whether it is active.

  • create-page

    Appends a new blank page to the current Draw.io document without changing the visible page when the runtime supports background page insertion.

  • copy-page

    Creates a copy of an existing page in the target/current Draw.io document, appends the copy to the end of the page list, and returns the copied page metadata. When possible, the previously visible page is restored after the copy is created.

  • rename-page

    Renames the selected page without changing the visible page.

Usa el MCP de Draw.io MCP 服务器 con varios modelos de IA

TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que, una vez conectado Draw.io MCP 服务器, puedes usarlo con distintos modelos de IA en TypingMind sin tener que configurarlo por separado para cada modelo. Esta integración MCP se ejecuta localmente en tu dispositivo a través del conector MCP de TypingMind.

Guía de configuración para usar el conector local

Usa esta opción si el servidor MCP necesita acceder a archivos locales, aplicaciones o recursos privados de tu ordenador.

1

Abre los ajustes de MCP

En TypingMind, ve a Ajustes, luego a Ajustes avanzados y a Model Context Protocol, y elige Configurar conector.

  1. Abre TypingMind en tu navegador.
  2. Haz clic en el icono de Ajustes.
  3. Ve a Ajustes avanzados.
  4. Abre la sección Model Context Protocol.
  5. Haz clic en Configurar conector y elige Este dispositivo.
Pantalla de configuración del conector MCP de TypingMind con «Este dispositivo» seleccionado
2

Ejecuta el comando del conector

Elige Este dispositivo, copia el comando de TypingMind y ejecútalo en Terminal. Mantén el proceso en ejecución mientras uses MCP.

  1. Copia el comando de configuración que muestra TypingMind.
  2. Abre Terminal en macOS o Windows Terminal en Windows.
  3. Pega y ejecuta el comando.
  4. Acepta la instalación del paquete si Terminal te pide confirmación para continuar.
  5. Mantén el proceso en ejecución en la ventana de Terminal mientras uses las herramientas MCP.
3

Añade Draw.io MCP 服务器 como servidor

Cuando el estado del conector sea «Listo», haz clic en «Editar servidores» y pega la configuración del servidor MCP.

  1. Espera hasta que el estado del conector indique «Listo».
  2. Haz clic en «Editar servidores».
  3. Pega la configuración del servidor MCP de Draw.io MCP 服务器.
  4. Guarda la lista de servidores.
  5. Actualiza si quieres comprobar que el conector sigue listo.
Ajustes de MCP de TypingMind con un servidor activo y el botón «Editar servidores»
{
  "mcpServers": {
    "lgazo-drawio-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "drawio-mcp"
      ]
    }
  }
}
4

Usa la conexión con distintos modelos

Guarda la lista de servidores, abre Plugins, activa las herramientas MCP de Draw.io MCP 服务器 y selecciona cualquier modelo de IA compatible en TypingMind para usar las herramientas en el chat o asignárselas a un agente de IA.

  1. Abre la página Plugins en TypingMind.
  2. Activa las herramientas MCP de Draw.io MCP 服务器.
  3. Inicia un chat y elige el modelo de IA que quieras usar.
  4. Usa las herramientas MCP en el chat o asígnalas a un agente de IA.
  5. Cambia a otro modelo de IA cuando lo necesites sin volver a conectar MCP.
Chat de TypingMind que usa herramientas MCP activadas con un modelo de IA seleccionado
¿Puedes usar Draw.io MCP 服务器 para ayudarme con esta tarea?
Draw.io MCP 服务器
Claro. Lo he leído.
Esto es lo que he encontrado con Draw.io MCP 服务器.

Preguntas frecuentes

¿Para qué sirve el servidor MCP Draw.io MCP 服务器?

Draw.io MCP 服务器 es un servidor MCP que permite a los clientes de IA compatibles conectarse a herramientas externas y acceder a información de contexto de fuentes externas. En TypingMind, basta con añadir este servidor MCP una vez para que sus herramientas estén disponibles en tu espacio de trabajo de IA.

¿Puedo usar el servidor MCP Draw.io MCP 服务器 con varios modelos de IA en TypingMind?

Sí. TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que puedes usar Draw.io MCP 服务器 con distintos modelos de IA, como Claude, ChatGPT, Gemini u otros que hayas configurado en TypingMind, sin configurar el servidor MCP por separado para cada modelo.

¿Por qué usar el servidor MCP Draw.io MCP 服务器 con TypingMind?

TypingMind es una de las mejores interfaces de chat con LLM porque reúne varios modelos de IA, prompts, plugins, agentes de IA, claves API y herramientas MCP en un solo espacio de trabajo. Con Draw.io MCP 服务器 conectado, puedes usar sus herramientas MCP con tus modelos preferidos y mantener organizado tu trabajo con los chats en TypingMind.

¿Cómo conecto el servidor MCP Draw.io MCP 服务器 a TypingMind?

Draw.io MCP 服务器 funciona a través del conector MCP local de TypingMind. Es la mejor opción cuando el servidor MCP necesita acceder a archivos locales, aplicaciones de escritorio, herramientas de línea de comandos o recursos privados de tu ordenador.

¿Qué herramientas ofrece el servidor MCP Draw.io MCP 服务器 en TypingMind?

Número de herramientas MCP que ofrece Draw.io MCP 服务器: 28. Puedes activar estas herramientas desde la página Plugins de TypingMind y usarlas en el chat o asignarlas a agentes de IA.

¿Tengo que compartir mis claves API con TypingMind para usar el servidor MCP Draw.io MCP 服务器?

No. TypingMind prioriza el funcionamiento local y te permite mantener el control de tus proveedores de modelos, claves API, prompts y configuración MCP. Si Draw.io MCP 服务器 requiere autenticación, añade las cabeceras, los ajustes de OAuth o la configuración local necesarios para ese servidor MCP al crear la conexión.

Servidores MCP relacionados

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇