Load diagram file
load_diagramLoad a .drawio, .drawio.svg, or raw XML diagram into the session, replacing all pages. Pass it by file path or XML to edit and re-export instead of rewriting files.
Instructions
Load a .drawio diagram into the current session, REPLACING the entire diagram (all pages). To change an existing file, load it here, edit with edit_diagram, then export_diagram to the same path; never rewrite the file by hand. Provide ONE of two mutually exclusive sources: 'path' (the server reads the file from disk — you do NOT need to read the file yourself or pass its XML through create_new_diagram) or 'xml' (the raw file content you already have — from another tool, a repository read, or an API response — so no temporary file needs to be written first). Both accept plain XML and draw.io's compressed save format. .drawio.svg (Editable SVG, the format export_diagram writes) is accepted too; .png files (also draw.io's editable PNG) and plain .svg files cannot be loaded.
After loading from 'path' (or from compressed 'xml'), call get_diagram before edit_diagram — you haven't seen the file's cell IDs yet. Plain-XML 'xml' content you supplied yourself is already known and can be edited immediately.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml | No | Raw .drawio file content: a plain <mxfile>/<mxGraphModel>, or draw.io's compressed save format. Use when the content is already in hand (another tool's output, a repository read, an API response). Mutually exclusive with 'path'. | |
| path | No | Path to the .drawio or .drawio.svg file to load (e.g. /Users/me/diagram.drawio or ~/diagram.drawio). Relative paths resolve against the MCP server's working directory, which is often not your project. Mutually exclusive with 'xml'. |