AI Integration
Mermaid Studio provides MCP (Model Context Protocol) tools that allow AI assistants to generate and validate Mermaid diagrams directly in your IDE.
What is MCP?
Section titled “What is MCP?”MCP is a protocol that lets AI assistants interact with IDE tools. When you use an MCP-compatible AI assistant (like JetBrains AI Assistant or Claude), it can access Mermaid Studio’s diagram capabilities.
Available Tools
Section titled “Available Tools”AI assistants can use these Mermaid Studio tools:
- Generate SVG - Render a diagram and get SVG output or save to a file
- Generate PNG - Export diagrams as PNG images with configurable resolution
- Validate Syntax - Check if diagram code is valid without rendering
- Analyze Diagram - Get detailed syntax errors, warnings, and suggestions
- Get Frontmatter Schema - Retrieve configuration options for a diagram type
Example Usage
Section titled “Example Usage”When chatting with an AI assistant in your IDE, you can ask it to:
- “Create a flowchart showing the user registration process”
- “Validate this Mermaid diagram for errors”
- “Generate a PNG of this sequence diagram at 2x resolution”
The AI can render diagrams directly and show you the results, or save them to files in your project.
Requirements
Section titled “Requirements”- JetBrains AI Assistant or another MCP-compatible AI tool
- Mermaid Studio plugin installed
- JCEF support (included in most JetBrains IDEs)