Mermaid Claude MCP App
The Mermaid Claude MCP App enables Claude to create, validate, and render Mermaid diagrams directly within the conversation. When you ask Claude to create a flowchart, sequence diagram, or any other Mermaid diagram, this app handles the entire process automatically - from syntax validation to rendering an interactive widget with the diagram, copy functionality, and repair links for invalid syntax.
Server URL: https://chatgpt.mermaid.ai/anthropic/mcp
Available Tools
validate_and_render_mermaid_diagram
Validates Mermaid diagram syntax and renders it to an interactive UI widget.
Input Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
diagramCode | string | Yes | The Mermaid diagram code to validate and render |
title | string | No | Optional title for the diagram |
Output:
The tool returns structured content containing:
title- The diagram titlediagramCode- The original Mermaid codevalid- Whether the diagram syntax is validrenderedSVG- SVG rendering of the diagram (if valid)renderedPNG- PNG rendering of the diagram (if valid)rawSVG- Raw SVG datadiagramType- The detected diagram type (flowchart, sequence, etc.)liveEditUrl- Link to edit the diagram in Mermaid Liveerror/validationError- Error details if validation fails
Tool Annotations:
readOnlyHint: true- Does not modify any dataopenWorldHint: false- Does not interact with external domainsdestructiveHint: false- Safe to run without side effects
UI Widget
The app includes an interactive UI widget that displays:
- Rendered Diagram - Visual representation of the Mermaid diagram
- Copy Code Button - One-click copy of the diagram code
- Repair Link - If the diagram is invalid, provides a link to fix it in Mermaid Live
Widget Permissions:
clipboardWrite- Allows copying diagram code to clipboard
How It Works
When you ask Claude to create a Mermaid diagram:
- Claude generates the Mermaid syntax based on your request
- The
validate_and_render_mermaid_diagramtool validates the syntax - If valid, the diagram is rendered as SVG/PNG
- The interactive widget displays the result with copy and edit options
- If invalid, you get a UI with a link to repair the diagram in Mermaid Live
Example Usage
Ask Claude to create any type of Mermaid diagram:
- “Create a flowchart showing the user login process”
- “Make a sequence diagram for an API request flow”
- “Generate a class diagram for a User model”
- “Draw a state diagram for an order lifecycle”
Claude will automatically use this tool to validate and render your diagram with the interactive widget.
Troubleshooting
If you encounter any issues:
- Invalid Syntax - Use the repair link provided in the widget to fix syntax errors in Mermaid Live
- Rendering Issues - Ensure your diagram code follows Mermaid syntax guidelines
- Copy Not Working - Check that clipboard permissions are enabled for the app
For additional help, report issues at Mermaid Chart Issue Tracker.
Ask Claude to create a Mermaid diagram and see it rendered instantly with the interactive widget!