Skip to main content
Glama

Draw.io MCP server

Давайте займемся созданием диаграмм с помощью самого популярного инструмента для построения схем — Draw.io (Diagrams.net).

Discord channel Build project Version

Основные возможности

  • Импорт и экспорт диаграмм из/в XML, SVG (со встроенным XML) или PNG (со встроенным XML) v2.0.0

  • Управление геометрией ребер с помощью контрольных точек и автоматической маршрутизацией соединителей v2.0.0

  • Отношения «родитель-потомок» для вложенных фигур и группировки v2.0.0

  • Единый сервер и расширение в одном монорепозитории v2.0.0

  • Встроенный редактор Draw.io — расширение для браузера не требуется v1.8.0

  • MCP-сервер, позволяющий ИИ-агентам управлять диаграммами Draw.io

  • Программное создание, проверка и изменение диаграмм через инструменты MCP

  • Управление слоями для сложных диаграмм

  • Работает с любым MCP-клиентом (Claude Desktop, Claude Code, Zed, Codex и др.)

Related MCP server: Draw.io MCP Server

Введение

Draw.io MCP server предоставляет ИИ-агентам возможности работы с диаграммами Draw.io. Он предлагает инструменты MCP, которые могут создавать, читать, обновлять и удалять элементы диаграмм, позволяя ИИ-ассистентам автоматически строить архитектурные схемы, блок-схемы и визуальную документацию.

Два способа использования:

  1. Встроенный редактор — сервер размещает Draw.io напрямую, доступен в вашем браузере

  2. Расширение для браузера — подключение к Draw.io, запущенному в браузере, через расширение

Требования

  • Node.js (v20 или выше) — среда выполнения для MCP-сервера

  • MCP-клиент — Claude Desktop, Claude Code, Zed, Codex, OpenCode или любой другой хост, совместимый с MCP

Для встроенного редактора

Дополнительных требований нет — работает «из коробки» с флагом --editor.

Для расширения браузера

  • Расширение для браузера — drawio-mcp-extension

  • Draw.io, открытый в вашем браузере

Опционально

  • pnpm — предпочтительный менеджер пакетов (npm также подходит)

Быстрый старт

1. Настройте ваш MCP-хост

Добавьте сервер в конфигурацию вашего MCP-клиента:

Отредактируйте ~/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"]}'

Добавьте в ~/.config/zed/settings.json:

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

Отредактируйте ~/.codex/config.toml:

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

Добавьте в opencode.json в корне вашего проекта или в ~/.config/opencode/opencode.json:

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

Для других MCP-клиентов и подробной настройки (включая параметры pnpm) см. Configuration.

2. Откройте редактор

После перезапуска вашего MCP-хоста откройте: http://localhost:3000/

3. Начните рисовать диаграммы

Примеры запросов, которые можно попробовать:

"Создай диаграмму архитектуры на основе событий, показывающую очередь сообщений с производителями, потребителями и тремя бэкенд-сервисами"

"Нарисуй диаграмму CRUD API с базой данных, API-шлюзом и четырьмя микросервисами с их эндпоинтами"

"Добавь новый слой под названием 'Background' и перемести на него все декоративные элементы, затем создай новый слой для аннотаций"

Теперь ваш ИИ-ассистент может управлять диаграммой с помощью инструментов MCP.

Функции

Сервер предоставляет инструменты MCP для:

  • Проверки диаграмм — чтение фигур, слоев и свойств ячеек

  • Изменения диаграмм — добавление/редактирование/удаление фигур, ребер и меток

  • Управления слоями — создание, переключение и организация слоев

Полный список доступных инструментов см. в Tools Reference.

Установка

Сервер работает как часть вашего MCP-хоста. Подробная конфигурация для всех поддерживаемых клиентов (Claude Desktop, Claude Code, Zed, Codex, oterm), включая параметры npm и pnpm, доступна в Configuration.

Альтернатива: Расширение для браузера

Вместо встроенного редактора вы можете использовать расширение для браузера для подключения к Draw.io, запущенному в вашем браузере. Это работает как с флагом --editor, так и без него.

  1. Откройте Draw.io в браузере

  2. Установите расширение Draw.io MCP Browser Extension:

  3. Убедитесь, что расширение подключено (зеленый индикатор на иконке)

Конфигурация без --editor:

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

Более подробную информацию см. в документации расширения.

Сопутствующие ресурсы

Configuration — CLI-флаги и расширенные параметры

Tools Reference — Полная документация по инструментам MCP

Troubleshooting

Prompt examples

Contributing

Architecture

Development

История звезд

Оценки

MSeeP.ai Security Assessment 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