Skip to main content
Glama

design-viewer

A small Hono service that takes Mermaid designs pushed from an MCP tool and serves them as clean, shareable web pages.

Claude / agent ──serve_design──▶ design-viewer-mcp (stdio) ──POST /api/designs──▶ design-viewer :3100
                                                                                      │
                                                        ~/.design-viewer/designs.json │
  • GET / — every design, newest first, with title and timestamp

  • GET /designs/:id — title, description, and the Mermaid diagram rendered in the browser

  • GET /healthz, GET /api/designs, GET /api/designs/:id, POST /api/designs

Designs live in memory while the service runs and are flushed to ~/.design-viewer/designs.json on every write (temp file + rename, so a crash cannot leave a half-written file). An unparsable data file is moved aside with a .corrupt-<timestamp> suffix rather than blocking startup.

MCP tool: serve_design

input

type

notes

title

string

short name, shown in the index and the page heading

description

string

one or two sentences shown above the diagram (may be empty)

mermaid

string

Mermaid source, without the ```mermaid fence

Returns { id, url }url is the page to open, e.g. http://hp-z420-mint-steve:3100/designs/7. Links are built from DESIGN_VIEWER_PUBLIC_URL at request time, so changing that one setting rewrites every link the service emits.

The tool runs as a stdio MCP server and posts to the running service, so the service stays the single writer of the data file. If the service is down the tool returns an error telling you to start it.

Related MCP server: Mermaid MCP Server

Layout

src/config.ts   env parsing (PORT, DESIGN_VIEWER_HOST, *_DATA_DIR, *_PUBLIC_URL)
src/store.ts    in-memory store + atomic JSON flush
src/render.ts   HTML pages, HTML escaping, pinned Mermaid CDN import
src/app.ts      Hono routes (web pages + JSON API)
src/server.ts   entry point: loads the store, serves on PORT
src/mcp.ts      stdio MCP server exposing serve_design
scripts/smoke-test.mjs  end-to-end test (HTTP + MCP + restart)
systemd/design-viewer.service

Build

npm install
npm run build      # tsc, strict mode
npm run smoke      # boots the service on :3199 and exercises everything above

Run

npm start                                    # foreground, http://localhost:3100
node dist/mcp.js                             # the MCP stdio server

systemd (user unit)

mkdir -p ~/.config/systemd/user
cp systemd/design-viewer.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now design-viewer
journalctl --user -u design-viewer -f

The unit expects node at ~/.local/bin/node; adjust ExecStart if Node lives elsewhere. User services need lingering to start at boot (loginctl enable-linger $USER), which is already enabled on the Z420.

Overrides go in ~/.config/design-viewer/env (KEY=value lines); see .env.example.

Registering the MCP tool

Claude Code reads the tool over stdio. On the machine the service runs on:

claude mcp add design-viewer --scope user \
  --env DESIGN_VIEWER_URL=http://localhost:3100 \
  -- node /home/pastry/projects/design-viewer/dist/mcp.js

From another machine on the mesh, point the tool at the Z420 by its MagicDNS name — node runs locally, only the POST crosses the mesh:

claude mcp add design-viewer --env DESIGN_VIEWER_URL=http://hp-z420-mint-steve:3100 -- \
  node /path/to/design-viewer/dist/mcp.js

The MagicDNS name is also what the returned links use, so nothing needs a tunnel or an IP lookup: open the URL the tool returns in a browser on any tailnet device.

Registered on the G14 at user scope with:

claude mcp add design-viewer --scope user \
  -e DESIGN_VIEWER_URL=http://hp-z420-mint-steve:3100 -- \
  /home/pastrycak3s/.nvm/versions/node/v24.14.0/bin/node \
  /home/pastrycak3s/projects/design-viewer/dist/mcp.js

The command path is absolute on purpose — Claude Code spawns the server with its own environment, so a bare node only resolves if nvm's PATH was loaded when the CLI started. The tradeoff is that it pins Node v24.14.0: after removing that version, update the path (claude mcp get design-viewer to check, claude mcp remove design-viewer -s user to start over). Newly added servers need a CLI restart before their tools appear in a running session.

Environment

variable

default

meaning

PORT

3100

listen port; the default link follows it

DESIGN_VIEWER_HOST

0.0.0.0

bind address; use 127.0.0.1 for loopback only

DESIGN_VIEWER_DATA_DIR

~/.design-viewer

directory holding designs.json

DESIGN_VIEWER_DATA_FILE

$DESIGN_VIEWER_DATA_DIR/designs.json

exact data file

DESIGN_VIEWER_PUBLIC_URL

http://localhost:$PORT

base URL used in returned links; the Z420 runs with http://hp-z420-mint-steve:3100

DESIGN_VIEWER_URL

http://localhost:3100

where the MCP server posts

DESIGN_VIEWER_TIMEOUT_MS

15000

MCP POST timeout

Notes

  • Mermaid is loaded from jsDelivr, pinned to 11.17.2, with securityLevel: "strict". If the CDN is unreachable the page falls back to showing the stored Mermaid source.

  • Titles, descriptions and diagram source are HTML-escaped on output; the renderer never interpolates stored content raw.

  • Deleting a design is not exposed on purpose — the index is append-only history.

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Enables AI assistants to generate and render Mermaid diagrams (flowcharts, sequence diagrams, etc.) as PNG/SVG images with local file saving and HTTP access URLs. Supports batch processing and intelligent caching for efficient diagram creation.
    1
    12
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables agents to search official Mermaid diagram syntax documentation and validate Mermaid diagram code before presenting it to users, ensuring syntactically correct flowcharts, sequence diagrams, class diagrams, and other Mermaid visualizations.
    4,476
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables the dynamic generation of various software development diagrams, such as flowcharts, sequence diagrams, and architecture diagrams, using Mermaid syntax. It includes tools for diagram validation and provides instructions for exporting results to multiple formats including SVG and PNG.
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to create, modify, and share diagrams on a live Excalidraw canvas through MCP tools, supporting shapes, text, arrows, batch operations, and export to shareable links with images.
    3,073
    8
    MIT

View all related MCP servers

Related MCP Connectors

  • Generate dynamic Mermaid diagrams and charts with AI assistance. Customize styles and export diagr…

  • Publish web pages straight from your AI assistant and share them with a link.

  • Let Claude, Cursor, or ChatGPT author Mermaid diagrams your team can read and share.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/patrickmfurbert/design-viewer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server