Skip to main content
Glama

Local Draw.io MCP

Local STDIO MCP service that lets Codex directly create and maintain editable draw.io XML files.

Tools

  • server_info: View the version and allowed directories.

  • create_diagram: Create a .drawio based on groups, nodes, and connections.

  • inspect_diagram: Read the node, connection, and geometry information of the first page.

  • validate_diagram: Check duplicate IDs, invalid coordinates, out-of-bounds items, broken connections, and overlapping nodes.

  • update_diagram: Add nodes/connections, or modify existing nodes.

Text in the files is treated only as data and is not executed as MCP instructions.

Related MCP server: draw.io MCP

Local Run

npm install
npm test
npm start

npm start uses STDIO. After a normal startup, it waits for an MCP client to connect and does not display an interactive interface.

Connecting to Codex

In the Codex desktop app, open "Settings → MCP servers → Add server", select STDIO, then fill in:

  • Command: C:\Program Files\nodejs\node.exe

  • Arguments: the absolute path to this project's src\server.mjs

  • Working directory: this project's directory

You can also copy the contents of config.example.toml to ~/.codex/config.toml, modify the paths, and restart Codex.

In the Codex CLI, you can run:

codex mcp list

In the session input box, you can use /mcp to check the connection status.

Path Restrictions

Control the access scope with the following environment variables. On Windows, separate multiple directories with semicolons:

  • DRAWIO_MCP_READ_ROOTS

  • DRAWIO_MCP_WRITE_ROOTS

When not configured, only this MCP project directory is accessible. It is recommended to only open the project workspace and not make the entire disk writable.

Example Call

After connecting, you can directly tell Codex:

Use the drawio MCP to create a 主动预警系统.drawio containing a data platform layer, an alert engine layer, and a response feedback layer. When finished, run validate_diagram to validate it.

The creation tool does not overwrite existing files by default; you must explicitly pass overwrite=true when you need to overwrite.

Available Tools

5 tools
create_diagramCreate draw.io diagramB

Create a new editable .drawio XML diagram from structured groups, nodes, and edges with automatic layout.

Inputs: nodes (required), output_path (required), edges, title, +4 more.

inspect_diagramInspect draw.io diagramA
Read-onlyIdempotent

Read the first page of a draw.io XML file and return nodes, edges, labels, and geometry.

Inputs: input_path (required).

server_infoDraw.io MCP server informationA
Read-onlyIdempotent

Show allowed roots and supported workflow information.

Inputs: no named parameters.

update_diagramUpdate draw.io diagramA

Add nodes/edges or update a node in an existing draw.io file. Writes a separate output unless overwrite is explicitly enabled.

Inputs: input_path (required), operations (required), output_path (required), overwrite.

validate_diagramValidate draw.io diagramA
Read-onlyIdempotent

Check draw.io XML structure, duplicate ids, invalid geometry, page bounds, dangling edges, and node overlaps.

Inputs: input_path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clear and distinct role: informational, create, inspect, validate, and update. There is no meaningful overlap between the tools, and the descriptions make it easy for an agent to select the right one.

    Naming Consistency4/5

    Four of the five tools follow a consistent verb_noun pattern: create_diagram, inspect_diagram, validate_diagram, and update_diagram. server_info breaks the pattern by using a noun_noun form without a verb, which is a minor deviation.

    Tool Count5/5

    Five tools is a well-scoped size for a diagram-focused MCP server. Each tool contributes a necessary part of the workflow without unnecessary bloat or redundancy.

    Completeness4/5

    The core create-read-update-validate lifecycle is well covered for draw.io XML manipulation. Missing capabilities like deleting nodes/edges or inspecting more than the first page are notable but not critical gaps for common diagram workflows.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to create and edit diagrams in the draw.io desktop app through the Model Context Protocol.
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      Renders diagram-as-code to PNG files on your disk, and also provides text-art previews and syntax validation, all locally without a browser or network.
      4
      16 npm
      MIT