mcpField
D
diagramsmith

diagramsmith

Local
github.comMedia & Design8Updated 1d ago

About diagramsmith

diagramsmith is a local diagramming tool and MCP server for agents and developers. It renders Mermaid or Excalidraw-style diagrams and can package box-and-arrow diagrams with nested views in an interactive, self-contained HTML page.

Key features

  1. 01Mermaid and Excalidraw rendering
  2. 02Interactive HTML explorer
  3. 03Nested diagram drill-down
  4. 04Seven live style presets
  5. 05SVG, PNG, and editable export
  6. 06Local MCP server and CLI

Use cases

  1. 01Visualizing service architecture
  2. 02Explaining flows with branches or failures
  3. 03Embedding interactive diagrams in documentation
  4. 04Rendering diagrams from a chat client

MCP support

It runs as a stdio MCP server and exposes `render_mermaid`, `render_diagram`, `render_interactive`, and `list_styles` tools. With MCP Apps support, `render_interactive` can also provide an inline explorer resource.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"zune2004-diagramsmith": {
"command": "npx",
"args": [
"-y",
"diagramsmith"
],
"env": {
"DIAGRAMSMITH_OUT": "<DIAGRAMSMITH_OUT>",
"CHROME_PATH": "<CHROME_PATH>"
}
}
}
}
Run commandnpx -y diagramsmith
Environment variables to set
DIAGRAMSMITH_OUTFolder where diagrams are written (default: ~/diagrams)
CHROME_PATHPath to Chrome or Edge if it is not found automatically

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmdiagramsmith0.4.3

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

diagramsmith

tests

Draw Mermaid and Excalidraw-style diagrams locally, and explore them as a self-contained interactive page. Live demo.

diagramsmith demo: an interactive checkout diagram, hover, details panel, guided tour, nested payment diagram and two style switches

Real output, recorded 2026-12-01.

Ask an agent for a diagram

User: How does our checkout work? Draw it for me.

Agent: I read the services and drew the checkout platform: storefront, gateway, cart, checkout, payments, inventory, orders and fulfilment, with the payment service as a nested diagram. I'm rendering the interactive explorer to diagrams/checkout-platform.html. Open it to pan, zoom, click a node for details, press Tour for the guided walk, and use Style to change the look.

The explorer is one HTML file with no CDN and no server: pan and zoom, search, click a node for a details panel, nested drill-down, a guided tour, a presenter mode, a live 7-style switcher and export to SVG, PNG or an editable .excalidraw.

What it looks like

Checkout platform drawn in the sketch preset: hand-drawn boxes and soft pastelsThe same checkout platform in the blueprint preset: white linework on engineering blueThe same checkout platform in the clean preset: crisp lines and a modern palette
Sketch (default): hand-drawn whiteboard.Blueprint: white linework on engineering blue.Clean: crisp lines for docs and READMEs.
Mermaid sequence diagram of an OAuth sign-in with PKCE

Mermaid sequence: an OAuth sign-in with PKCE. Diagram styles change the colours and fonts only, not the Mermaid layout.

Interactive explorer with the payment service selected, its connection highlighted and its details panel open

The interactive page: select a node, see what it sends and receives, and open the diagram hidden inside it.

Install the skill

For any AI coding agent with skills:

npx skills add Zune2004/diagramsmith
gh skill install Zune2004/diagramsmith diagramsmith

On first use, if node <skill-dir>/tools/diagram.mjs doctor reports missing packages, run the first-run setup once:

node <skill-dir>/tools/setup.mjs
Claude Code plugin
/plugin marketplace add Zune2004/diagramsmith
/plugin install diagramsmith@diagramsmith
Gemini CLI extension
gemini extensions install https://github.com/Zune2004/diagramsmith
Manual copy paths

Copy the skills/diagramsmith folder to your agent's skills directory:

AgentUser-level pathProject-level path
Claude Code~/.claude/skills/diagramsmith.claude/skills/diagramsmith
OpenAI Codex CLI~/.agents/skills/diagramsmith.agents/skills/diagramsmith
Gemini CLI~/.agents/skills/diagramsmith.agents/skills/diagramsmith
GitHub Copilot CLI~/.agents/skills/diagramsmith.github/skills/diagramsmith
Cursor~/.agents/skills/diagramsmith.agents/skills/diagramsmith
opencode~/.agents/skills/diagramsmith.opencode/skills/diagramsmith
Kilo Code~/.agents/skills/diagramsmith.kilo/skills/diagramsmith
Cline~/.agents/skills/diagramsmith.agents/skills/diagramsmith
Amp~/.agents/skills/diagramsmith.agents/skills/diagramsmith
Goose~/.agents/skills/diagramsmith.agents/skills/diagramsmith
Aider (no skills)

In .aider.conf.yml:

read: [skills/diagramsmith/SKILL.md]

Chat apps (MCP)

Run diagramsmith as a stdio MCP server with "command": "npx" and "args": ["-y", "diagramsmith", "mcp"]. Rendered files are written to DIAGRAMSMITH_OUT if set, or ~/diagrams by default (<home>/diagrams). The four tools are render_mermaid, render_diagram, render_interactive and list_styles.

In hosts that support MCP Apps (io.modelcontextprotocol/ui, such as Claude Desktop, ChatGPT, and Goose), render_interactive also links to the ui://diagramsmith/explorer resource so the diagram renders inline while still saving the standalone HTML file. Inside the conversation, you see the full interactive explorer—pan and zoom, search, node details, nested diagrams, guided tour, host theme matching, live style switching, and optional fullscreen mode—without leaving the chat.

If you want to pre-install packages or check your browser beforehand, run npx -y diagramsmith doctor (or node <package-dir>/skills/diagramsmith/tools/setup.mjs).

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "diagramsmith": {
      "command": "npx",
      "args": ["-y", "diagramsmith", "mcp"]
    }
  }
}

Cursor (~/.cursor/mcp.json or .cursor/mcp.json):

{
  "mcpServers": {
    "diagramsmith": {
      "command": "npx",
      "args": ["-y", "diagramsmith", "mcp"]
    }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "diagramsmith": {
      "command": "npx",
      "args": ["-y", "diagramsmith", "mcp"]
    }
  }
}

Windsurf (~/.codeium/windsurf/mcp_config.json):

{
  "mcpServers": {
    "diagramsmith": {
      "command": "npx",
      "args": ["-y", "diagramsmith", "mcp"]
    }
  }
}

No agent

Terminal or npx:

npx diagramsmith mermaid     flow.mmd         -o flow.svg
npx diagramsmith excalidraw  spec.json        -o diagram.png
npx diagramsmith interactive spec.json        -o explorer.html --styles all
npx diagramsmith presets     -o style-gallery.html
npx diagramsmith style       list
npx diagramsmith style       set blueprint
npx diagramsmith check
npx diagramsmith doctor

If you cloned the repository directly, run the first-run setup once and invoke the CLI directly:

node skills/diagramsmith/tools/setup.mjs
node skills/diagramsmith/tools/diagram.mjs mermaid     skills/diagramsmith/tools/examples/auth-flow.mmd         -o auth-flow.svg
node skills/diagramsmith/tools/diagram.mjs excalidraw  skills/diagramsmith/tools/examples/payments-detail.json  -o payments.png
node skills/diagramsmith/tools/diagram.mjs interactive skills/diagramsmith/tools/examples/interactive-demo.json -o demo.html --styles all

What it is good for

  • A system overview with zones and one nested zoom: the checkout platform above is ten services, two zones and a payment diagram inside a node.
  • A flow with branches, retries or a failure path, where a picture beats a paragraph.
  • A request lifecycle or auth sequence, as a Mermaid block next to the code it describes.
  • Explaining a design to a person: an interactive page they can pan, search, click and present.
  • Diagrams in a README, issue or PR, where plain Mermaid renders without any tool.

Embed it on your site

Build a compact page with diagramsmith interactive map.json --embed -o static/map.html, copy the loader with diagramsmith embed-script -o static, then add one <script> tag and one <diagramsmith-explorer src="static/map.html"> element, or a plain <iframe>. The embed keeps one style, a minimal toolbar (fit, zoom, fullscreen, optional full view link), starts nothing on its own, and reads ?toolbar=, ?theme= and ?tour=1 at view time. It is a static file, so any static host can serve it; EMBED.md has recipes for GitHub Pages, Docusaurus, MkDocs and VitePress (not all tested in those tools). Recipes and limits are in docs/EMBED.md; the live demo is https://zune2004.github.io/diagramsmith/.

Built on

diagramsmith does not draw anything itself. It gives agents a spec and a workflow, then hands the drawing to proven open-source parts. Credit where it is due:

  • Mermaid and mermaid-cli render the Mermaid diagrams.
  • Excalidraw (@excalidraw/utils) draws the hand-drawn look and the editable .excalidraw files.
  • dagre lays out the boxes and arrows.
  • Puppeteer drives your own Chrome or Edge to render.

What diagramsmith adds: the JSON spec the agent writes, the 7 style presets, the interactive explorer page (nested diagrams, tour, presenter mode, style switch), and the skill, plugin and MCP packaging. Licences are in THIRD_PARTY.md.

How it compares

There are many good diagram tools for agents, and several are more popular than this one. The comparison below is honest as of December 2026. If one of these fits you better, use it.

If you wantUseWhy
Diagrams inside a chat, made without askingClaude, ChatGPT or Gemini directlyThey now draw inline visuals on their own.
Polished HTML explainers, many diagram types, code analysis, video toursArchifyLarger and far more popular; no npm install.
Formal architecture models with C4 levelsLikeC4A real modelling language, with drill-down and walkthroughs.
Precise, editable diagramsdraw.io MCPFull editor, also inline in chat.
Drawing together on a live canvasExcalidraw or tldrawReal canvases you edit by hand.
Static Mermaid images without a browserbeautiful-mermaidNo Chrome needed.
A Mermaid block in a READMENothingGitHub renders Mermaid natively.

Where diagramsmith is different:

  • one offline HTML file that holds the overview and the nested diagrams inside it;
  • a hand-drawn look you can switch between 7 styles live;
  • export to an editable .excalidraw;
  • no account, no API key, no network calls.

Where it is weaker:

  • it needs Chrome or Edge and a few hundred MB of packages;
  • the explorer works for box-and-arrow diagrams, while sequence, ER and state diagrams stay plain Mermaid;
  • it does not read your code by itself;
  • layout is dagre only.

These are the next things to fix. Issues are welcome.

Commands and exit codes

CommandWhat it doesExit codes
diagramsmith --versionPrint the version.0
diagramsmith mermaid <file.mmd> [-o out.svg|out.png]Render Mermaid (needs the optional mermaid-cli and Chrome/Edge).0 ok, 1 error, 2 no browser (prints a Mermaid block to paste instead)
diagramsmith excalidraw <spec.json|file.excalidraw> [-o out.svg|out.png]Auto-layout a spec and render it, plus an editable .excalidraw.0 ok, 1 error (invalid spec, duplicate id, PNG too large)
diagramsmith interactive <spec.json|file.mmd> [-o out.html]Build the self-contained HTML explorer and self-test it in headless Chrome.0 ok, 1 error; --strict also exits 1 when the self-test finds a problem
diagramsmith presets [-o style-gallery.html]Render the same sample in all 7 presets.0 ok, 1 error
diagramsmith style <list|options|show|set|reset>List presets and options, or save a default style.0 ok, 1 error
diagramsmith check [--strict]Self-test every renderer.0 all good, 1 something failed
diagramsmith doctorCheck Node, dependencies and Chrome/Edge.0 all good, 1 something needs fixing
diagramsmith mcpRun the stdio MCP server.Runs until stdin closes; JSON-RPC errors are reported in-band

Limits to know

  • Rendering is local: no account, no API key, no telemetry. Diagrams are not sent anywhere; the renderer starts a local 127.0.0.1 server only.
  • It needs Node.js 20 or newer and Google Chrome or Microsoft Edge (override with CHROME_PATH or PUPPETEER_EXECUTABLE_PATH). On first install, the npm packages are a few hundred MB; the browser is reused, not downloaded.
  • A PNG export of a very large diagram (for example 300 nodes) can be too large. Use SVG, a lower --scale, or split the diagram.
  • For Mermaid, a style preset changes colours and fonts only. The hand-drawn look comes from the Excalidraw-style renderer.
  • The interactive page needs a current browser (Chrome, Edge, Firefox 113+ or Safari 16.4+); it unpacks its payload in the browser.
  • interactive pre-renders every combination of up to 3 collapsible zones, so more zones or many --styles make a bigger HTML file.

The 7 style presets

PresetLook
sketch (default)Hand-drawn whiteboard with soft pastels
cleanCrisp straight lines and a modern UI palette
blueprintWhite technical linework on engineering blue, monospace labels, sharp corners
midnightDark canvas with bright neon accents
monoBlack-and-white with hatching for print
corporateMuted tones, thin sharp lines, roomy spacing
playfulChunky sketchy lines and bright colours on a warm page

Customize any part with npx diagramsmith style options and npx diagramsmith style set <preset> [key=value ...] [--project], or pass --preset <name> on a single render.

Privacy

Rendering is local: no account, no API key, no telemetry; your diagrams are not sent anywhere (the renderer starts a local 127.0.0.1 server only).

Licence

MIT. See LICENSE and THIRD_PARTY.md.

Development

Install the renderer dependencies once:

npm ci --prefix skills/diagramsmith/tools

Run the tests and the renderer self-test:

node --test --test-concurrency=4 tests/*.test.mjs
node skills/diagramsmith/tools/diagram.mjs check

Regenerate every picture above, including the GIF (needs Chrome or Edge and ffmpeg on PATH):

node docs/demo/make_media.mjs

The example spec is docs/demo/checkout-platform.json; the Mermaid sequence is docs/demo/oauth-sequence.mmd.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.