A local markdown server with Mermaid diagram validation.
demo.mp4
npm install -g mddaemon
mddaemon run -p 8080 -t midnight-blue
mddaemon validate ~/docs/readme.mdnpm install -g mddaemonmddaemon run -p 8080 -t midnight-blue # Dark blue theme
mddaemon run -p 8080 -t sunny # Bright yellow theme
mddaemon run -p 8080 -t ember -d /path/to/docs # Custom directoryAvailable themes:
- Dark: midnight-blue, ember
- Light: sunny, lavender, mint, sky, rose
mddaemon open ~/path/to/file.mdmddaemon validate ~/path/to/file.mdmddaemon --help
mddaemon --version
mddaemon run --help
mddaemon open --help
mddaemon validate --help| Variable | Description |
|---|---|
MDDAEMON_PORT |
Default port (used if --port not specified) |
MDDAEMON_THEME |
Default theme (e.g., midnight-blue, sunny) |
Add custom styles at ~/.config/mddaemon/style.css.
curl -I http://localhost:8080/Returns headers:
X-Mddaemon-Root: Server root directoryX-Mddaemon-Port: Server portX-Mddaemon-Version: Version
Mermaid diagrams in markdown are powerful but frustrating:
- No feedback loop - You write a diagram, commit it, and only discover syntax errors when viewing in GitHub/GitLab
- Cryptic errors - When errors do appear, they're rendered in the browser with no line numbers or block identification
This is especially painful when working with AI coding agents that generate Mermaid diagrams. The agent produces a diagram, you commit it, and later discover it doesn't render.
mddaemon provides a local daemon that validates diagrams before you commit, with precise error locations. Coding agents can run mddaemon validate to verify their diagrams are correct before finishing a task.
MIT