validate_and_render_mermaidLABSCO SUMMARY
Validation before rendering is the useful half.
Models write Mermaid that almost parses, and a diagram that fails silently in a README is worse than no diagram. Getting the syntax checked and the image back in the same call closes that loop. Decide up front whether you want the image inline or on disk — the mounted output directory is what makes the file path route work, and it is easy to forget in the client config.
What it is
A Mermaid diagram server that both validates and renders. It ships two front ends over the same engine: a web interface for interactive work, and an MCP server so an assistant can produce the diagram, check the syntax, and hand back the picture without you opening anything.
What you get
validate_and_render_mermaid— check the code and render it as PNG, withreturn_image=truefor an inline image orreturn_base64_text=truefor something you can saveget_diagramto fetch a rendered diagram later by file ID, andrequest_mermaid_generationto have the diagram code written from a description- Learning by example —
get_mermaid_examplesby category or complexity,get_diagram_templatefor a starting point,get_syntax_helpfor one diagram type - Improving what exists —
analyze_diagram_codefor suggestions,suggest_diagram_improvementsfor targeted ones health_checkandserver_statusfor when rendering stops working- Every Mermaid type: flowchart, sequence, gantt, class, state, ER, pie, mindmap, journey and timeline
- Themes
default,dark,forestandneutral; aclassicorhandDrawnlook;transparentorwhitebackground - 11 prompts, each a wizard for a specific job —
flowchart_wizard,sequence_diagram_wizard,er_diagram_wizard,architecture_diagram,project_timeline,mindmap_wizard,user_journey_wizardand others
Requirements
No account and no key for diagram rendering; the web interface's AI generation needs an OpenAI or Anthropic key set in backend/.env. For MCP, clone the repository and docker build -f Dockerfile.mcp-stdio -t sailor-mcp ., then run the image from your client config with a volume mount for the output directory — that mount is where rendered files land. Docker Desktop is the only prerequisite; nothing else is installed on the host. The web interface is a separate path: docker-compose up -d and open http://localhost:5000. Package sailor at 2.0.0.
Setup effort
Run a container — build the image from the repository, then point your client at it
USE CASES
Getting a diagram into a document
Describe the flow, have the code generated, and render it straight to the folder you mounted.
Checking whether Mermaid you already wrote is valid
Validate and render it before pasting it anywhere, rather than finding out in the pull request.
Drawing a type you have not used before
Pull an example and the syntax reference for that diagram type and start from something that works.
Making a cluttered diagram readable
Ask for targeted improvements on the existing code instead of redrawing it.
Matching a diagram to your docs theme
Pick the theme, the hand-drawn or classic look, and a transparent background so it sits on any page.
10 tools
Listed in project docs. Your client may show a different list.
get_diagramrequest_mermaid_generationget_mermaid_examplesget_diagram_templateget_syntax_helpanalyze_diagram_codesuggest_diagram_improvementshealth_checkserver_statusBEFORE YOU INSTALL
What to know first
Tools you get
10 tools named in the project's documentation.
Requires
docker on PATH
INSTALLATION
Connect your client
Build the image from the repository, then point your client at it.
Server setup
git clone https://github.com/aj-geddes/sailor.git
cd sailor
docker build -f Dockerfile.mcp-stdio -t sailor-mcp .Add the Claude Desktop — Docker block on this page to claude_desktop_config.json (%APPDATA%\Claude\ on Windows, ~/Library/Application Support/Claude/ on macOS, ~/.config/Claude/ on Linux), pointing the -v mount at your output directory
Completely close and reopen Claude Desktop to load the new configuration
Alternative (no local install): deploy your own remote instance (docs/RAILWAY_DEPLOYMENT.md) and add its /mcp URL to Claude as a custom connector — see the Claude Desktop — remote tab
MCP Clients
Claude Desktop — Docker
{
"mcpServers": {
"sailor-mermaid": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"C:\\Users\\<YOUR_USERNAME>\\Pictures:/output",
"sailor-mcp"
]
}
}
}Claude Desktop — remote
Deploy your own Sailor instance, following docs/RAILWAY_DEPLOYMENT.md in the repository
In Claude, navigate to Customize > Connectors
Click "+" then "Add custom connector"
Add your instance's remote MCP server URL, for example https://<YOUR_SAILOR_INSTANCE>.up.railway.app/mcp
Finish configuring your connector by clicking "Add"