Smart Drawio

Design and media

Generate, validate, repair and style editable draw.io XML diagrams.

Your AI app calls the Smart Drawio MCP server, which does the design and media work and sends the result back to the chat.

About Smart Drawio

Smart Drawio is a community MCP server from yunshenwuchuxun, filed in our directory under design and media. Generate, validate, repair and style editable draw.io XML diagrams.

Smart Drawio runs on your own machine: your AI app starts it with the command npx -y @yunshenwuchuxun/smart-drawio-mcp@0.1.0 and talks to it over standard input and output.

Smart Drawio is listed in the official MCP registry as io.github.yunshenwuchuxun/smart-drawio, version 0.1.0.

At a glance

Publisher
yunshenwuchuxun (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @yunshenwuchuxun/smart-drawio-mcp
Written in
JavaScript
License
MIT
GitHub stars
367
Official MCP registry
io.github.yunshenwuchuxun/smart-drawio

How to set up Smart Drawio

  1. Install Node.js on the machine that runs your AI app, because Smart Drawio starts with npx and downloads its package on first run.
  2. Check the Smart Drawio README for keys or settings; the registry lists none that Smart Drawio requires.
  3. Add Smart Drawio to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Smart Drawio tools to confirm the connection.
  5. Run one read-only task with Smart Drawio first, and keep your app asking before each tool call until the results look right.

Smart Drawio compared with similar servers

  • Photoshop Python API by loonghao has fewer GitHub stars than Smart Drawio (363 against 367); both are community servers, and both run locally.
  • Everything Search by mamertofabian has more GitHub stars than Smart Drawio (372 against 367); both are community servers, and both run locally.
  • Kiln by instruktlabs has fewer GitHub stars than Smart Drawio (359 against 367); both are community servers, and Kiln runs as a remote server and Smart Drawio runs on your own machine.

Before you connect Smart Drawio

  • Give Smart Drawio its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Smart Drawio tool call until you trust what it does with them.
  • Treat text that Smart Drawio fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Smart Drawio on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Smart Drawio

How marketing and sales teams put Smart Drawio to work, by company size. Pick the size closest to yours and start Smart Drawio on one use case.

Small business

  • A small business can use Smart Drawio to resize and adapt one design for every channel instead of hiring for each version.
  • Owners can ask Smart Drawio to pull brand assets and make quick ad and social variations that still look on brand.
  • Smart Drawio runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Creative teams can connect Smart Drawio so agents produce variants for testing while designers keep control of the master files.
  • Marketing teams can use Smart Drawio to hand off designs to web and ads with specs attached, cutting review rounds.
  • Start Smart Drawio on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises can use Smart Drawio with brand rules and approved assets only, so generated work stays inside the brand system.
  • Large creative ops teams can use Smart Drawio to localize and version assets for many markets with review built in.
  • Smart Drawio is a community server, so have security review the code and pin a version before Smart Drawio touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Smart Drawio README

From yunshenwuchuxun/smart-drawio-next on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

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.

Questions about Smart Drawio

What is the Smart Drawio MCP server?

Generate, validate, repair and style editable draw.io XML diagrams. Smart Drawio is maintained by yunshenwuchuxun on GitHub at yunshenwuchuxun/smart-drawio-next, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Smart Drawio MCP server?

Add Smart Drawio to your AI app's MCP config with the command npx -y @yunshenwuchuxun/smart-drawio-mcp@0.1.0. In Claude Code, run claude mcp add --transport stdio yunshenwuchuxun -- npx -y @yunshenwuchuxun/smart-drawio-mcp@0.1.0. To run Smart Drawio this way you need Node.js installed.

Does Smart Drawio need an API key?

The registry lists no required keys for Smart Drawio. Check the Smart Drawio README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Smart Drawio an official MCP server?

No. Smart Drawio is a community server maintained by yunshenwuchuxun. Community servers can be excellent; read the code and the open issues before you give Smart Drawio access to company data.

What license is Smart Drawio under?

Smart Drawio is released under the MIT license, according to its GitHub repository. The license covers the code of Smart Drawio; the service it connects to has its own terms.