Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 2.11 KB

README.md

File metadata and controls

31 lines (21 loc) · 2.11 KB

Draw.io Project Instructions (No MCP Required)

An alternative approach that works without installing the MCP server. Instead of using MCP tools, you add instructions to a Claude Project that teach Claude to generate draw.io URLs using Python code execution.

Advantages

  • No installation required - works immediately in Claude.ai
  • No desktop app needed - works entirely in the browser
  • Easy to use - just add instructions to your Claude Project
  • Privacy-friendly - the generated URL carries the diagram in its hash fragment (#R... for XML, #create=... for Mermaid and CSV), which stays in the browser and is never sent to any server

How to Install

  1. Open your Claude Project settings
  2. Add the contents of claude-project-instructions.txt to your project instructions
  3. Also add the contents of shared/xml-essentials.md — the condensed XML rules (skeleton, cell templates, labels, shapes, the layout grid, containers, swimlanes, edge styles). Add the full shared/xml-reference.md as well only if you need layers, tags, metadata, tables, cross-functional grids or dark-mode colors
  4. Ask Claude to create diagrams - it will generate clickable draw.io URLs

How It Works

The instructions teach Claude to:

  1. Generate diagram code (Mermaid, XML, or CSV)
  2. Execute Python code that repairs common XML slips, checks that the XML is well-formed, and compresses and encodes the diagram
  3. The script outputs a complete HTML page with the URL embedded as a clickable button
  4. Claude presents the HTML as an artifact - the user clicks the button to open draw.io

Why HTML Output?

The generated URL contains compressed base64 data. LLMs are known to silently corrupt base64 strings when reproducing them token by token - even a single changed character breaks the link completely.

By having the Python script output a complete HTML page with the link already embedded, the URL never passes through Claude's text generation. Claude simply presents the script output as an artifact, ensuring the link is always correct.