Skip to content
Back to search

smart-drawio-next

Editable Draw.io diagrams for research and architecture: Next.js web app, Agent Skill, and local MCP server.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/yunshenwuchuxun--smart-drawio-next/badge.svg)](/listings/yunshenwuchuxun--smart-drawio-next)

HTML

<a href="/listings/yunshenwuchuxun--smart-drawio-next"><img src="/api/listings/yunshenwuchuxun--smart-drawio-next/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Install the fixed release:

npx skills add https://github.com/yunshenwuchuxun/smart-drawio-next/tree/tools-v0.1.0/skills/smart-drawio

The Skill is distributed as GitHub files, with no separate npm package. `npx skills` runs the general [Skills CLI](https://github.com/vercel-labs/skills), which downloads the Skill from the repository. Its Python 3 validator works offline without third-party dependencies; MCP is optional.

Example agent request:

> Use `$smart-drawio` to create an original encoder–decoder Transformer diagram, save it as transformer.drawio, and check its connectors and labels.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 409 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Smart Drawio Next
  2. [中文文档](./README.zh.md)
  3. > Create editable Draw.io diagrams from natural language or reference images, for research, documentation, and presentations.
  4. **Skill & MCP 0.1.0:** [GitHub release](https://github.com/yunshenwuchuxun/smart-drawio-next/releases/tag/tools-v0.1.0) · [MCP on npm](https://www.npmjs.com/package/@yunshenwuchuxun/smart-drawio-mcp) · [Official MCP Registry](https://registry.modelcontextprotocol.io/v0.1/servers/io.github.yunshenwuchuxun%2Fsmart-drawio/versions/0.1.0)
  5. ## Live Demo
  6. - Demo: <https://smart-drawio-next.vercel.app/>
  7. - Note: the hosted version requires your own API key
  8. ## Gallery
  9. | Home | Transformer |
  10. |------|-------------|
  11. | ![Home](./public/images/page.png) | ![Transformer](./public/images/transformer.png) |
  12. | Swin-Transformer | CLIP |
  13. |------------------|------|
  14. | ![Swin-Transformer](./public/images/swin.png) | ![CLIP](./public/images/clip.png) |
  15. ### ProSST
  16. ![ProSST](./public/images/prosst.png)
  17. ## Overview
  18. [smart-drawio-next](https://github.com/yunshenwuchuxun/smart-drawio-next) is a diagram generation tool built with Next.js 16, embedded Draw.io, and streaming LLM APIs. It helps you:
  19. - Generate structured diagrams from natural language prompts
  20. - Upload reference images and convert them into editable diagram content
  21. - Fine-tune XML / JSON in Monaco Editor
  22. - Sync output directly into an embedded Draw.io canvas
  23. - Use post-processing tools to improve layout, connectors, styles, and annotations
  24. The project includes multi-model configuration, workspace recovery, generation history, and notifications. It can be deployed as a personal tool or an internal team service.
  25. ## Core Features
  26. - **Streaming generation** with support for continuing truncated outputs
  27. - **Multimodal input** with both text and image-based workflows
  28. - **Code + canvas workflow** for editing XML and previewing the result side by side
  29. - **Post-processing toolchain** for structure, text, connector, and style refinement
  30. - **Multi-provider config management** for OpenAI / Anthropic-compatible APIs
  31. - **Local history** with replay support for recent generations
  32. ## Agent Skill and MCP
  33. Version **0.1.0 is published**. Choose the entry point that fits your workflow:
  34. | Entry point | What it does | Distribution | Model setup |
  35. | --- | --- | --- | --- |
  36. | Website | Generate from text or images, then edit the diagram in the embedded Draw.io canvas | [Hosted app](https://smart-drawio-next.vercel.app/) or self-hosted Next.js | Configure your provider in the browser |
  37. | `smart-drawio` Skill | Guide an agent through creating, editing, checking and saving editable diagrams | [GitHub Skill](skills/smart-drawio) and [release ZIP](https://github.com/yunshenwuchuxun/smart-drawio-next/releases/download/tools-v0.1.0/smart-drawio-skill-0.1.0.zip) | Uses the agent's own model |
  38. | Smart Drawio MCP | Generate, validate, repair and style XML through local stdio tools | [npm package](https://www.npmjs.com/package/@yunshenwuchuxun/smart-drawio-mcp) and [Registry entry](https://registry.modelcontextprotocol.io/v0.1/servers/io.github.yunshenwuchuxun%2Fsmart-drawio/versions/0.1.0) | Only `generate_drawio` needs model API settings |
  39. ### Install the Skill
  40. Install the fixed release:
  41. ```sh
  42. npx skills add https://github.com/yunshenwuchuxun/smart-drawio-next/tree/tools-v0.1.0/skills/smart-drawio
  43. ```
  44. The Skill is distributed as GitHub files, with no separate npm package. `npx skills` runs the general [Skills CLI](https://github.com/vercel-labs/skills), which downloads the Skill from the repository. Its Python 3 validator works offline without third-party dependencies; MCP is optional.
  45. Example agent request:
  46. > Use `$smart-drawio` to create an original encoder–decoder Transformer diagram, save it as transformer.drawio, and check its connectors and labels.
  47. ### Configure the MCP server
  48. Use Node.js 20.9 or later and a client that supports local stdio MCP. For clients using `mcpServers` JSON:
  49. ```json
  50. {
  51. "mcpServers": {
  52. "smart-drawio": {
  53. "command": "npx",
  54. "args": ["-y", "@yunshenwuchuxun/smart-drawio-mcp@0.1.0"]
  55. }
  56. }
  57. }
  58. ```
  59. The client starts the server and communicates over stdin/stdout. Configure `SMART_DRAWIO_PROVIDER`, `SMART_DRAWIO_BASE_URL`, `SMART_DRAWIO_API_KEY` and `SMART_DRAWIO_MODEL` in the MCP process environment to enable generation through your OpenAI/Anthropic-compatible provider.
  60. | Tool | Function | Model API required |
  61. | --- | --- | --- |
  62. | `generate_drawio` | Create complete, validated XML from a text prompt | Yes |
  63. | `validate_drawio` | Check XML syntax, IDs, parents and references | No |
  64. | `repair_drawio` | Conservatively repair supported missing closing tags | No |
  65. | `style_drawio` | Apply themes, style packs, presets and drawing tricks | No |
  66. | `list_drawio_options` | List supported types, themes and tool options | No |
  67. The MCP server returns uncompressed XML for the client to save. PNG/SVG/PDF previews and exports need an available Draw.io renderer or editor. Version 0.1.0 provides local stdio tools; the Registry link is installation metadata, and the Vercel URL is the website. This package has no remote HTTP MCP endpoint or live canvas session control.
  68. ### Generated examples
  69. Both examples below were rendered using the official Draw.io viewer and are available as editable files:
  70. | Skill workflow | MCP generation workflow |
  71. | --- | --- |
  72. | ![Transformer created with the Skill](docs/images/transformer-skill.png) | ![Transformer created through MCP](docs/images/transformer-mcp.png) |
  73. | [Editable .drawio](https://github.com/yunshenwuchuxun/smart-drawio-next/releases/download/tools-v0.1.0/transformer-skill.drawio) | [Editable .drawio](https://github.com/yunshenwuchuxun/smart-drawio-next/releases/download/tools-v0.1.0/transformer-mcp.drawio) |
  74. The Skill example used the agent's own model. The MCP example used a real OpenAI-compatible API request for `codex/gpt-6.1-sol`, then MCP validation and Draw.io rendering. The original MCP output includes one annotation crossed by a connector; the examples retain their actual outputs.
  75. [Release CI](https://github.com/yunshenwuchuxun/smart-drawio-next/actions/runs/38578657214) passed 291 JavaScript tests, 11 Python tests and 8 browser tests, plus lint, production build and isolated package installation. Public Skill installation and npm MCP handshake/tool calls were also verified.
  76. See [MCP setup](packages/mcp/README.md), [Skill installation](docs/skill-installation.md), and [version downloads](https://github.com/yunshenwuchuxun/smart-drawio-next/releases/tag/tools-v0.1.0). The Next.js application remains independently deployable to Vercel.
  77. ## Supported Diagram Types
  78. The app supports 20+ diagram types. You can choose one explicitly or let the model decide:
  79. - Flowchart
  80. - Mind Map
  81. - Org Chart
  82. - Sequence Diagram
  83. - UML Class Diagram
  84. - ER Diagram
  85. - Gantt Chart
  86. - Timeline
  87. - Tree
  88. - Network Topology
  89. - Architecture Diagram
  90. - Data Flow Diagram
  91. - State Diagram
  92. - Swimlane Diagram
  93. - Concept Map
  94. - Fishbone Diagram
  95. - SWOT Analysis
  96. - Pyramid Diagram
  97. - Funnel Diagram
  98. - Venn Diagram
  99. - Matrix Diagram
  100. - Infographic
  101. ## Built-in Themes
  102. 10 built-in color themes are available:
  103. - Research
  104. - Business
  105. - Warm
  106. - Cool
  107. - Dark
  108. - Contrast
  109. - Pastel
  110. - Forest
  111. - Violet
  112. - Neutral
  113. ## Tools System
  114. After generation, you can continue refining the diagram in the sidebar tools panel. All operations are XML-based transforms.
  115. ### Drawing Tricks
  116. Used for bulk layout and connector refinement:
  117. - **Grid Snap**
  118. - **Orthogonal Routing**
  119. - **Curved Routing**
  120. - **Label Background**
  121. - **Consistent Spacing**
  122. - **Jump Crossings**
  123. - **Rounded Edges**
  124. - **Normalize Arrows**
  125. - **Remove Waypoints**
  126. ### Style Presets
  127. Used for stackable visual effects:
  128. - Shadow
  129. - Gradient
  130. - Rounded
  131. - Glass
  132. - Sketch
  133. - Comic
  134. - Dashed
  135. - Transparent
  136. - Bold Stroke
  137. - No Stroke
  138. - Absolute Arc
  139. - Cross-Hatch
  140. - Dot Fill
  141. - Zigzag Fill
  142. - Semi-Opaque
  143. - Fade Stroke
  144. - Fixed Dash
  145. - Open Arrow
  146. ### Style Packs
  147. Used for one-click full visual styles:
  148. - **Research Clean**
  149. - **Presentation Cards**
  150. - **Business Clean**
  151. - **Flat Minimal**
  152. - **Wireframe**
  153. - **Comic Whiteboard**
  154. - **Watercolor Sketch**
  155. - **Minimal Outline**
  156. - **Sticky Notes**
  157. - **Blueprint Tech**
  158. ### Text Tools
  159. Used for batch text formatting:
  160. - Wrap Labels
  161. - Center Text
  162. - Text Panels
  163. - Bold Text
  164. - Compact Text
  165. - Text Padding
  166. ## Tools System Examples
  167. | Baseline: no style | Preset: comic + cross-hatch |
  168. |--------------------|-----------------------------|
  169. | ![Baseline no style](./public/images/tools-baseline-no-style.png) | ![Comic and cross-hatch preset](./public/images/tools-presets-comic-crosshatch.png) |
  170. | Style pack: blueprint tech | Style pack: business clean |
  171. |----------------------------|----------------------------|
  172. | ![Blueprint tech style pack](./public/images/tools-style-pack-blueprint-tech.png) | ![Business clean style pack](./public/images/tools-style-pack-business-clean.png) |
  173. ## UI Structure
  174. 1. **Input Area (Chat + ImageUpload)**
  175. - Enter prompts
  176. - Upload reference images
  177. - Stop or continue generation
  178. 2. **Code Editor**
  179. - View and edit XML / JSON
  180. - Run clear, optimize, advanced optimize, and apply actions
  181. 3. **Canvas**
  182. - Render the generated result
  183. - Continue editing visually in Draw.io
  184. 4. **Support Modals**
  185. - `ConfigManager`
  186. - `HistoryModal`
  187. - `OptimizationPanel`
  188. - Other supporting panels
  189. ## Developing the Tools
  190. The website and tools share the drawing core. To build and verify the packages from a source checkout:
  191. ```bash
  192. pnpm build:mcp
  193. pnpm test:tools
  194. pnpm test:skill
  195. pnpm verify:mcp
  196. pnpm pack:tools
  197. ```
  198. See [packaging and publication](./docs/publishing.md) for release checks. Publish only `packages/mcp`; the website's root package remains private.
  199. ## Tech Stack
  200. - **Framework**: Next.js 16 (App Router) + React 19
  201. - **Canvas**: Draw.io embed
  202. - **Editor**: `@monaco-editor/react`
  203. - **Styling**: Tailwind CSS v4
  204. - **LLM Integration**: OpenAI / Anthropic-compatible APIs with SSE streaming
  205. - **Persistence**: localStorage
  206. ## Getting Started
  207. ### Requirements
  208. - Node.js >= 20.9 (Node.js 24 LTS recommended)
  209. - pnpm >= 8
  210. - An available OpenAI / Anthropic-compatible API key
  211. ### Install and Run
  212. ```bash
  213. git clone https://github.com/yunshenwuchuxun/smart-drawio-next.git
  214. cd smart-drawio-next
  215. pnpm install
  216. pnpm dev
  217. ```
  218. Then open: <http://localhost:3000>
  219. ### Common Commands
  220. | Command | Description |
  221. |---------|-------------|
  222. | `pnpm dev` | Start development server |
  223. | `pnpm build` | Build for production |
  224. | `pnpm start` | Start production server |
  225. | `pnpm lint` | Run ESLint |
  226. | `pnpm test -- run` | Run unit tests |
  227. ## Docker Deployment
  228. ### Requirements
  229. - Docker >= 20.10
  230. - Docker Compose V2
  231. ### Quick Start
  232. ```bash
  233. docker compose up -d --build
  234. ```
  235. Then open: <http://localhost:3000>
  236. The image uses a multi-stage build and Next.js standalone output for deployment-friendly packaging.
  237. ### LLM Configuration
  238. Configure the provider, base URL, API key and model in the browser settings.
  239. The current release uses the user's configuration for each generation request.
  240. `ACCESS_PASSWORD` and `SERVER_LLM_*` are not implemented server-side configuration options.
  241. ### Proxy and Local Model Setup
  242. If Docker needs a proxy or access to a model running on the host machine:
  243. ```bash
  244. cp docker-compose.override.example.yml docker-compose.override.yml
  245. ```
  246. Edit it for your environment, then restart:
  247. ```bash
  248. docker compose up -d --build
  249. ```
  250. Typical use cases:
  251. - Routing traffic through a host proxy
  252. - Accessing host-local Ollama or LM Studio
  253. - Mounting a custom CA certificate for enterprise proxies
  254. ### Common Docker Commands
  255. ```bash
  256. docker compose logs -f app
  257. docker compose down
  258. docker compose up -d --build
  259. docker compose ps
  260. ```
  261. ## LLM Configuration
  262. ### Client-Side Config Mode
  263. By default, users configure these in the UI:
  264. - Provider
  265. - Base URL
  266. - API Key
  267. - Model
  268. Saved configurations persist in browser localStorage. Generation sends the active model configuration and input to the application's API route, which calls the selected model provider.
  269. ### Workspace Recovery and Request Limits
  270. The applied diagram, unapplied code draft, text input, theme and presets are saved locally after changes and restored on reload. The header reports whether the draft was saved. Workspace snapshots exclude provider credentials and uploaded image data; images must be uploaded again after a reload.
  271. Generation accepts requests up to 4 MiB and images up to 2 MiB to leave room for base64 encoding on Vercel. Model requests have a 240-second total deadline and a 60-second idle deadline. Stopping generation cancels pending retries and continuation requests as well as the upstream model request.
  272. XML validation runs in browsers and Node.js. Each uncompressed page is checked independently for malformed XML, duplicate IDs, invalid parent chains and missing references. Compressed `.drawio` pages are not supported in this phase. Truncated output stays in the editor; explicitly applying it can repair missing closing tags and reports any discarded tail.
  273. Legacy JSON input rejects unsupported or invalid elements without replacing the current diagram or draft. Explicitly applying `[]` creates an empty diagram and can be undone.
  274. ## FAQ
  275. ### Where does my API key go?
  276. The saved configuration is stored locally in your browser. Each generation request sends the selected configuration, including the API key, to the application's server; the server uses that key to authenticate with your selected model provider. MCP generation uses the credentials configured in its process environment. The Skill can generate XML with the agent's own model without a separate diagram-generation API configuration.
  277. ### What if the output is truncated?
  278. The UI provides a continue-generation action automatically when needed.
  279. ### What if image recognition fails?
  280. Use a vision-capable model and make sure the image format and size are valid.
  281. ### Will history grow without limit?
  282. No. The app keeps only the most recent 20 entries by default.
  283. ## Credits and Contributing
  284. - This project is based on [smart-excalidraw-next](https://github.com/liujuntao123/smart-excalidraw-next)
  285. - If it helps you, consider:
  286. - Giving the repo a star
  287. - Sharing it with others
  288. ## License
  289. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.