Files
jgraph__drawio-mcp/project-instructions/README.md
T
Gaudenz Alder 3366c8e7b3 feat: single source of truth for XML generation prompt
Move the draw.io XML generation reference to shared/xml-reference.md
and wire all four consumers to use it instead of duplicating the
content. Add layers, tags, and metadata/placeholders documentation.

- MCP app server: reads at startup (Node.js) or pre-builds into
  generated-html.js (Workers) via build-html.js
- MCP tool server: reads at startup with fallback to local copy;
  prepack script bundles the file before npm publish
- Skill: references the GitHub raw URL so it works after install
- Project instructions: tells users to copy from GitHub

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:59:19 +02:00

1.8 KiB

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 uses a hash fragment (#create=...), 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-reference.md — this is the XML generation reference covering edge routing, containers, layers, tags, metadata, dark mode, and more
  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 to compress and encode 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.