Skip to main content
Glama

Draw.io MCP-Server

Lass uns ein wenig „Vibe Diagramming“ mit dem am weitesten verbreiteten Diagramm-Tool namens Draw.io (Diagrams.net) betreiben.

Discord-Kanal Projekt-Build Version

Wichtige Highlights

  • Import und Export von Diagrammen aus/in XML, SVG (mit eingebettetem XML) oder PNG (mit eingebettetem XML) v2.0.0

  • Steuerung der Kanten-Geometrie mit Wegpunkten und automatischem Self-Connector-Routing v2.0.0

  • Eltern-Kind-Beziehungen für verschachtelte Formen und Gruppierungen v2.0.0

  • Vereinheitlichter Server und Erweiterung im selben Mono-Repo v2.0.0

  • Integrierter Draw.io-Editor – keine Browser-Erweiterung erforderlich v1.8.0

  • MCP-Server, der es KI-Agenten ermöglicht, Draw.io-Diagramme zu steuern

  • Programmgesteuerte Diagrammerstellung, Inspektion und Änderung über MCP-Tools

  • Ebenenverwaltung für komplexe Diagramme

  • Funktioniert mit jedem MCP-Client (Claude Desktop, Claude Code, Zed, Codex, etc.)

Related MCP server: Draw.io MCP Server

Einführung

Der Draw.io MCP-Server bringt Draw.io-Diagrammfunktionen zu KI-Agenten. Er stellt MCP-Tools bereit, die Diagrammelemente erstellen, lesen, aktualisieren und löschen können – so können KI-Assistenten automatisch Architekturdiagramme, Flussdiagramme und visuelle Dokumentationen erstellen.

Zwei Möglichkeiten zur Nutzung:

  1. Integrierter Editor – Der Server hostet Draw.io direkt, zugänglich über Ihren Browser

  2. Browser-Erweiterung – Verbindung zu Draw.io, das in Ihrem Browser läuft, über eine Erweiterung

Anforderungen

  • Node.js (v20 oder höher) – Laufzeitumgebung für den MCP-Server

  • MCP-Client – Claude Desktop, Claude Code, Zed, Codex, OpenCode oder ein beliebiger MCP-kompatibler Host

Für den integrierten Editor

Keine zusätzlichen Anforderungen – läuft sofort mit dem --editor-Flag.

Für die Browser-Erweiterung

Optional

  • pnpm – Bevorzugter Paketmanager (npm funktioniert ebenfalls)

Schnellstart

1. Konfigurieren Sie Ihren MCP-Host

Fügen Sie den Server zu Ihrer MCP-Client-Konfiguration hinzu:

Bearbeiten Sie ~/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"]}'

Fügen Sie dies zu ~/.config/zed/settings.json hinzu:

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

Bearbeiten Sie ~/.codex/config.toml:

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

Fügen Sie dies zu opencode.json in Ihrem Projektstammverzeichnis oder ~/.config/opencode/opencode.json hinzu:

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

Für andere MCP-Clients und detaillierte Konfigurationen (einschließlich pnpm-Optionen), siehe Konfiguration.

2. Öffnen Sie den Editor

Nachdem Sie Ihren MCP-Host neu gestartet haben, öffnen Sie: http://localhost:3000/

3. Beginnen Sie mit dem Diagramm-Erstellen

Beispiel-Prompts, die Sie ausprobieren können:

"Erstelle ein ereignisgesteuertes Architekturdiagramm, das eine Nachrichtenwarteschlange mit Produzenten, Konsumenten und drei Backend-Diensten zeigt"

"Zeichne ein CRUD-API-Diagramm mit einer Datenbank, einem API-Gateway und vier Microservices mit ihren Endpunkten"

"Füge eine neue Ebene namens 'Hintergrund' hinzu und verschiebe alle dekorativen Elemente dorthin, erstelle dann eine neue Ebene für Anmerkungen"

Ihr KI-Assistent kann das Diagramm nun mithilfe von MCP-Tools steuern.

Funktionen

Der Server bietet MCP-Tools für:

  • Diagramminspektion – Lesen von Formen, Ebenen und Zelleneigenschaften

  • Diagrammmodifikation – Hinzufügen/Bearbeiten/Löschen von Formen, Kanten und Beschriftungen

  • Ebenenverwaltung – Erstellen, Wechseln und Organisieren von Ebenen

Siehe Tools-Referenz für die vollständige Liste der verfügbaren Tools.

Installation

Der Server läuft als Teil Ihres MCP-Hosts. Eine detaillierte Konfiguration für alle unterstützten Clients (Claude Desktop, Claude Code, Zed, Codex, oterm) einschließlich npm- und pnpm-Optionen finden Sie unter Konfiguration.

Alternative: Browser-Erweiterung

Anstelle des integrierten Editors können Sie die Browser-Erweiterung verwenden, um eine Verbindung zu Draw.io herzustellen, das in Ihrem Browser läuft. Dies funktioniert mit oder ohne das --editor-Flag.

  1. Öffnen Sie Draw.io in Ihrem Browser

  2. Installieren Sie die Draw.io MCP-Browser-Erweiterung:

  3. Stellen Sie sicher, dass die Erweiterung verbunden ist (grünes Signal-Overlay auf dem Symbol)

Konfiguration ohne --editor:

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

Weitere Details finden Sie in der Erweiterungsdokumentation.

Verwandte Ressourcen

Konfiguration – CLI-Flags und erweiterte Optionen

Tools-Referenz – Vollständige Dokumentation der MCP-Tools

Fehlerbehebung

Prompt-Beispiele

Mitwirken

Architektur

Entwicklung

Star-Verlauf

Bewertungen

MSeeP.ai Sicherheitsbewertungs-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