@drawio/mcp 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,7 +10,27 @@ The official [draw.io](https://www.draw.io) MCP (Model Context Protocol) server
10
10
  - **URL support**: Fetch content from URLs automatically
11
11
  - **Customizable display**: Lightbox mode, dark mode, and more
12
12
 
13
- ## Installation
13
+ ## Two Ways to Use
14
+
15
+ ### Option 1: MCP Server (Claude Desktop)
16
+
17
+ Install and configure the MCP server for Claude Desktop. The server runs locally and can automatically open diagrams in your browser.
18
+
19
+ ### Option 2: Project Instructions (No MCP)
20
+
21
+ Use draw.io diagram generation with custom project instructions - works in both Claude.ai and Claude Desktop without installing the MCP server. See [Using Project Instructions](#using-project-instructions-no-mcp) below.
22
+
23
+ | Feature | MCP Server | Project Instructions |
24
+ |---------|------------|----------------------|
25
+ | Platform | Claude Desktop | Claude.ai & Claude Desktop |
26
+ | Installation | Required | None |
27
+ | System access | Opens browser automatically | No system access |
28
+ | Link verification | Automatic | User can inspect link before clicking |
29
+ | Complexity | More setup | Just paste instructions |
30
+
31
+ ---
32
+
33
+ ## MCP Server Installation
14
34
 
15
35
  ### Using npx (recommended)
16
36
 
@@ -277,6 +297,44 @@ npm install
277
297
  npm start
278
298
  ```
279
299
 
300
+ ---
301
+
302
+ ## Using Project Instructions (No MCP)
303
+
304
+ You can use draw.io diagram generation without installing the MCP server by using custom project instructions. This works in both Claude.ai (web) and Claude Desktop.
305
+
306
+ **Advantages:**
307
+
308
+ - **No installation** - Just paste instructions into a project
309
+ - **Works everywhere** - Claude.ai and Claude Desktop
310
+ - **No system access** - Claude generates a link without accessing your computer
311
+ - **Transparent** - You can inspect the generated URL before clicking
312
+ - **Verifiable** - The link visibly points to `app.diagrams.net`
313
+
314
+ ### Setup
315
+
316
+ 1. Create a new Project in Claude.ai or Claude Desktop
317
+ 2. In Project Settings, paste the contents of [`claude-project-instructions.txt`](./claude-project-instructions.txt) into the custom instructions
318
+ 3. Start a conversation and ask Claude to create diagrams
319
+
320
+ ### How It Works
321
+
322
+ Claude creates an **HTML artifact** that:
323
+ 1. Generates Mermaid/CSV/XML diagram code based on your request
324
+ 2. Compresses the diagram data using pako.js (loaded from CDN)
325
+ 3. Shows a button to open draw.io with the diagram in lightbox mode
326
+ 4. In draw.io, hover to see the "Edit" button to open the full editor
327
+
328
+ **Note:** The artifact uses draw.io's lightbox mode (`lightbox=1&dark=auto&border=10&edit=_blank`).
329
+
330
+ ### Example
331
+
332
+ **You:** Create a flowchart for a user login process
333
+
334
+ **Claude:** *Creates an HTML artifact with an "Open in draw.io" button*
335
+
336
+ ---
337
+
280
338
  ## Related Resources
281
339
 
282
340
  - [draw.io](https://www.draw.io) - Free online diagram editor
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawio/mcp",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Official draw.io MCP server for LLMs - Open diagrams in draw.io editor",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -95,14 +95,7 @@ function generateDrawioUrl(data, type, options = {})
95
95
  params.set("border", border.toString());
96
96
  params.set("edit", edit);
97
97
 
98
- let createHash = "#create=" + encodeURIComponent(JSON.stringify(createObj));
99
-
100
- // Workaround for unsupported xml type
101
- if (createObj.type === "xml")
102
- {
103
- createHash = "#R" + compressedData;
104
- }
105
-
98
+ const createHash = "#create=" + encodeURIComponent(JSON.stringify(createObj));
106
99
  const paramsStr = params.toString();
107
100
 
108
101
  return DRAWIO_BASE_URL + (paramsStr ? "?" + paramsStr : "") + createHash;