drawio-open

drawio-open is a command for Claude Code from lgazo/drawio-mcp-server. It costs 17 tokens per session (584 once invoked), scanned A, original, MIT.

A workflow for opening a Draw.io diagram from a local file or web address in a connected diagram editor. Draw.io is a tool for creating diagrams such as flowcharts and system designs.

In plain words
What is it for?
It is for opening XML, SVG, or PNG diagrams from a path or URL and displaying them in Draw.io.
Why use it?
It removes the manual steps needed to load a diagram into the connected editor.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the drawio plugin — 2 commands shipped together

Good fit It is for opening XML, SVG, or PNG diagrams from a path or URL and displaying them in Draw.io.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/lgazo/drawio-mcp-server/drawio-open
About the project

Draw.io MCP Server connects AI agents to Draw.io, a diagramming application, through the Model Context Protocol. Users can create, edit, manage, import, export, and persist diagrams across documents and pages from supported agent environments. The catalogue entries package the server with commands, instructions, a plugin, and settings for agent-based diagram workflows.

lgazo/drawio-mcp-server · 1,457 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/lgazo/drawio-mcp-server

Made for: Claude Code.

Or install drawio, the plugin that ships this one along with the rest of its 2 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for drawio-open

README.md
[![agentmods](https://agentmods.dev/badge/commands/lgazo/drawio-mcp-server/drawio-open.svg)](https://agentmods.dev/commands/lgazo/drawio-mcp-server/drawio-open)
Your own site
<a href="https://agentmods.dev/commands/lgazo/drawio-mcp-server/drawio-open"><img src="https://agentmods.dev/badge/commands/lgazo/drawio-mcp-server/drawio-open.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 584 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00017 $0.00584
Opus 5 $0.00009 $0.00292
Sonnet 5 $0.00003 $0.00117
Haiku 4.5 $0.00002 $0.00058

Measured 5d ago against content hash f9801341efdd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

drawio-open scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

node -e 'const {spawn}=require("child_process"); const url=process.argv[1]; const cmd = process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open"; const args = process.platform==="win32"?["/c","start
packages/drawio-mcp-claude-plugin/commands/drawio-open.md · 43 lines

What it actually says

You are opening a Draw.io diagram from an argument.

Argument: $ARGUMENTS

Steps:

  1. Determine argument type:
    • Starts with http:// or https:// → fetch the body with WebFetch.
    • Otherwise treat it as a local file path and Read it. For .png you must base64-encode.
  2. Call mcp__drawio__list-documents.
  3. Pick the target document:
    • If the result contains 1+ connected documents, use the first one's id as target_document.
    • If 0 → skip step 4; the server is probably running with --editor only.
  4. Call mcp__drawio__import-diagram with the content, appropriate format (xml | svg | png), and target_document when known.
  5. Open the editor URL in the browser:
    • Read env vars: DRAWIO_MCP_HOST (default localhost), DRAWIO_MCP_HTTP_PORT (default 3000), DRAWIO_MCP_TLS (truehttps, else http).
    • Build URL = <scheme>://<host>:<port>/.
    • Launch via a Node spawn that argv-passes the URL (never shell-interpolate it into a command string, since $URL may contain characters from $ARGUMENTS):
      node -e 'const {spawn}=require("child_process"); const url=process.argv[1]; const cmd = process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open"; const args = process.platform==="win32"?["/c","start","",url]:[url]; spawn(cmd,args,{detached:true,stdio:"ignore"}).unref();' "$URL"
      
      $URL becomes argv[1] to node, not part of the shell command, so shell metacharacters in it are inert.
  6. Report to the user:
    • Mode used (extension-import vs editor-only).
    • Which document (if any) received the import.
    • The URL that was opened.

Error handling:

  • File not found → tell the user which path failed.
  • Server unreachable → suggest they run npx drawio-mcp-server --editor or check the port.
  • Import fails → surface the MCP tool's error verbatim.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 43 lines · 17 tokens per session scan A f9801341efdd

Subscribe to this mod's changes

drawio-open is a command published in the GitHub repository lgazo/drawio-mcp-server (1,457 stars, last pushed 6d ago), licensed MIT. It adds 17 tokens to every session and 584 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-02.