claude-mermaid
v1.8.0MCP 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…
| Parameter | Type | Description |
|---|---|---|
diagram * | string | The Mermaid diagram code to render |
preview_id * | string | ID for this preview session. Use different IDs for multiple diagrams (e.g., 'architecture', 'flow', 'sequence'). |
background | string | Background color for pngs/svgs. Example: transparent, red, '#F0F0F0' (default: white) |
format | string | Output format (default: svg) |
height | number | Deprecated, use size. The larger of width and height is used as size. |
mode | string | Where to show the preview: 'live' opens the browser with live reload, 'artifact' writes a page to publish as a Claude artifact (default: live) |
scale | number | Scale factor for higher quality output (default: 2) |
size | number | Maximum diagram width or height in pixels (default: 800) |
theme | string | Theme of the chart (default: default) |
width | number | Deprecated, 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.
| Parameter | Type | Description |
|---|---|---|
preview_id * | string | ID of the preview to save. Must match the preview_id used in mermaid_preview. |
save_path * | string | Path to save the diagram file (e.g., './docs/diagram.svg') |
format | string | Output format (default: svg). Must match the format used in mermaid_preview. |