Smart Drawio
io.github.yunshenwuchuxun/smart-drawio · 367 stars · JavaScript · MIT
MCP server Generate, validate, repair and style editable draw.io XML diagrams.
Install
The repo has no one-line install. Follow its README.
Published as
- npm
@yunshenwuchuxun/smart-drawio-mcpstdio
From the server's entry in the official MCP Registry.
Configuration
| Name | Set as | What it is |
|---|---|---|
SMART_DRAWIO_PROVIDEROptional | Env var | openai or anthropic; required only for model generation |
SMART_DRAWIO_BASE_URLOptional | Env var | Model provider HTTP(S) base URL; required only for model generation |
SMART_DRAWIO_API_KEYOptional · Secret | Env var | Your model provider API key; required only for model generation |
SMART_DRAWIO_MODELOptional | Env var | Model identifier; required only for model generation |
Files
Smart Drawio MCP
A local MCP server for generating, validating, repairing and styling editable draw.io XML. It shares the diagram core with Smart Drawio Next. It uses stdio and does not require the Next.js website, a browser, or draw.io Desktop.
Install from npm
Use Node.js 20.9 or later. Configure a client that supports local stdio MCP servers:
{
"mcpServers": {
"smart-drawio": {
"command": "npx",
"args": ["-y", "@yunshenwuchuxun/smart-drawio-mcp@0.1.0"]
}
}
}
The client starts the MCP process. Validation, repair, styling and option discovery work immediately. Configure the four model environment variables below to enable generation.
The Smart Drawio Skill can also use the agent's own model to create XML and then optionally call these tools.
Run from this repository
Use Node.js 20.9 or later. Build from the repository root:
pnpm install --frozen-lockfile pnpm build:mcp
Configure a client that supports local stdio MCP servers:
{
"mcpServers": {
"smart-drawio": {
"command": "node",
"args": ["/absolute/path/smart-drawio-next/packages/mcp/dist/stdio.js"]
}
}
}
Replace the absolute path with your checkout path. The client launches the process; running the executable directly waits for JSON-RPC on stdin. stdout contains only MCP messages.
The npm executable is smart-drawio-mcp. Running it directly waits for JSON-RPC on stdin; it is intended to be started by an MCP client.
Optional model configuration
Validation, repair, styling and the options catalog work without model credentials. Only generate_drawio requires the following four environment variables, set on the MCP process:
| Variable | Meaning |
|---|---|
SMART_DRAWIO_PROVIDER |
openai or anthropic |
SMART_DRAWIO_BASE_URL |
Compatible HTTP(S) base URL, e.g. https://api.openai.com/v1 or a local model endpoint |
SMART_DRAWIO_API_KEY |
Provider API key; for a local endpoint that ignores authentication, use a non-empty placeholder |
SMART_DRAWIO_MODEL |
Model ID supported by that provider |
Use your client's environment or secret settings. Credentials are absent from tool arguments and results. Localhost and custom HTTP(S) providers are supported. A base URL must not contain embedded credentials, query parameters or fragments.
Example using placeholder settings in the client configuration:
{
"mcpServers": {
"smart-drawio": {
"command": "node",
"args": ["/absolute/path/smart-drawio-next/packages/mcp/dist/stdio.js"],
"env": {
"SMART_DRAWIO_PROVIDER": "openai",
"SMART_DRAWIO_BASE_URL": "http://localhost:11434/v1",
"SMART_DRAWIO_API_KEY": "local-placeholder",
"SMART_DRAWIO_MODEL": "your-local-model-id"
}
}
}
}
Restart the MCP process after changing its model settings. Generation has a 240-second total deadline and a 60-second inactivity deadline. Client cancellation aborts the provider request.
Tools
| Tool | Inputs | Behavior |
|---|---|---|
list_drawio_options |
{} |
Discover IDs and descriptions for chart types, themes, style packs, presets, text tools and tricks |
validate_drawio |
xml |
Validate XML syntax, IDs, parents and edge references |
repair_drawio |
xml |
Repair supported missing closing tags and validate the repaired result |
style_drawio |
xml; optional theme, sourceTheme, stylePack, presets, textTool, trick |
Return a transformed XML document; presets is an ID-to-boolean map |
generate_drawio |
prompt; optional chartType="auto", theme="research" |
Generate with the configured provider and return complete, validated XML |
Every result includes structuredContent with ok, diagnostics, and optional xml, stats or options. Text content includes diagnostics and the XML when available. Tool failures set isError: true; invalid tool arguments are rejected by the MCP SDK. Cancelled calls follow MCP cancellation semantics.
Example style request after discovering the IDs:
{
"xml": "<mxfile>...</mxfile>",
"stylePack": "researchClean",
"presets": { "shadow": false }
}
Supported scope
This version handles uncompressed .drawio XML, with an MCP input limit of 2,097,152 characters per XML document. Prompts are limited to 262,144 characters. Compressed diagrams and legacy JSON drawing formats must be converted to uncompressed XML first.
The server returns diagram data in memory. The client decides whether and where to save .drawio files. It does not read the current browser canvas, select nodes, export PNG/PDF screenshots, manage realtime editor sessions or offer a remote HTTP MCP endpoint.
Import the returned XML into draw.io, or use the Smart Drawio Next website for visual editing. Generation calls the configured external provider; validation, repair and style transformations stay local.
Factory API
import { createSmartDrawioServer } from '@yunshenwuchuxun/smart-drawio-mcp';
import { serveStdio } from '@modelcontextprotocol/server/stdio';
serveStdio(() => createSmartDrawioServer());
createSmartDrawioServer({ env, core }) allows a supplied environment and core implementation for embedding or testing. The package also exports the shared diagram core under @yunshenwuchuxun/smart-drawio-mcp/core.
Facts
- Kind
- MCP server
- Group
- Uncategorized
- Stars
- 367
- License
- MIT
- Language
- JavaScript
- Last push
- 2026-10-14
- Forks
- 48
- MCP Registry
- io.github.yunshenwuchuxun/smart-drawio
- Homepage
- smart-drawio-next.vercel.app
- Topics
- agent-skills, diagrams, drawio, mcp, nextjs
Next on this shelf
- 577Bambu Printer MCPio.github.DMontgomery40/bambu-printer-mcpControl Bambu Lab printers, slice models, manage AMS filament, and connect Blender over your LAN.365
- 578HEARTHio.github.THORCollective/hearthSearch community threat hunting hypotheses by keyword, threat actor, or the log sources you have.364
- 579fojin — Buddhist Canon Toolsapp.fojin/fojin-mcpBuddhist canon tools: search, passages, cross-canon parallels, dictionaries — all URN-cited.362
- 580mcp-server-macos-usemediar-ai/mcp-server-macos-useAI agent that controls computer with OS-level tools, MCP compatible, works with any model359
- 581Mcp Omnisearchspences10/mcp-omnisearch🔍 A Model Context Protocol (MCP) server providing unified access to multiple search engines (Tavily, Brave, Kagi, Exa), AI tools (Kagi FastGPT, Exa, Linkup), and content extraction services (Firecrawl, Tavily, Kagi). Includes GitHub search. All through a single interface.358
- 582Notebook Intelligenceplmbr/notebook-intelligence356