claude-mermaid

v1.8.0
claude-mermaid Checked 6 hours ago Published 9 days ago

MCP server for previewing Mermaid diagrams in Claude Code

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

mermaid_preview

Render a Mermaid diagram from its code and preview it. In 'live' mode the diagram opens in the browser with live reload and auto-refreshes when updated. In 'artifact' mode the tool writes a self-contained HTML page instead: publish the returned artifact page path with the Artifact tool, and republish the same path after every update. The default mode is 'live'. Use 'artifact' when the user asks for an artifact or a shareable page, and 'live' when they ask for a browser preview. Supports themes (default, forest, dark, neutral), custom backgrounds, dimensions, and quality scaling. Use mermaid_sa…

ParameterTypeDescription
diagram *stringThe Mermaid diagram code to render
preview_id *stringID for this preview session. Use different IDs for multiple diagrams (e.g., 'architecture', 'flow', 'sequence').
backgroundstringBackground color for pngs/svgs. Example: transparent, red, '#F0F0F0' (default: white)
formatstringOutput format (default: svg)
heightnumberDeprecated, use size. The larger of width and height is used as size.
modestringWhere to show the preview: 'live' opens the browser with live reload, 'artifact' writes a page to publish as a Claude artifact (default: live)
scalenumberScale factor for higher quality output (default: 2)
sizenumberMaximum diagram width or height in pixels (default: 800)
themestringTheme of the chart (default: default)
widthnumberDeprecated, use size. The larger of width and height is used as size.

mermaid_save

Save the current live Mermaid diagram to a file path. This copies the already-rendered diagram from the live preview to the specified location. Use this after tuning your diagram with mermaid_preview.

ParameterTypeDescription
preview_id *stringID of the preview to save. Must match the preview_id used in mermaid_preview.
save_path *stringPath to save the diagram file (e.g., './docs/diagram.svg')
formatstringOutput format (default: svg). Must match the format used in mermaid_preview.