@drawio/mcp 1.0.1 → 1.0.2
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 +59 -1
- package/package.json +1 -1
- package/src/index.js +1 -8
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
|
-
##
|
|
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 uses its built-in Python analysis tool to:
|
|
323
|
+
1. Generate Mermaid/CSV/XML diagram code based on your request
|
|
324
|
+
2. Compress and encode the diagram data
|
|
325
|
+
3. Create a draw.io URL with the embedded diagram
|
|
326
|
+
4. Present the URL as a clickable link
|
|
327
|
+
|
|
328
|
+
### Example
|
|
329
|
+
|
|
330
|
+
**You:** Create a flowchart for a user login process
|
|
331
|
+
|
|
332
|
+
**Claude:** Here's your flowchart:
|
|
333
|
+
|
|
334
|
+
👉 [Open in draw.io](https://app.diagrams.net/?pv=0&grid=0#create=...)
|
|
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
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
|
-
|
|
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;
|