Validates and lints Mermaid diagram syntax across multiple types, including flowcharts, sequence diagrams, class diagrams, and state diagrams, to ensure they render correctly.
Enables automated Mermaid diagram validation within pre-commit hooks to maintain documentation quality and prevent syntax errors from being committed to a codebase.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Mermaid Lint MCPvalidate this mermaid flowchart: graph TD; A-->B"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Mermaid Lint MCP
中文版本 | English
A powerful tool for validating Mermaid diagrams with both CLI and MCP server capabilities. Perfect for developers, technical writers, and AI assistants who work with Mermaid diagrams.
🚀 Quick Start
Install and Use Immediately
No installation required! The tool will be downloaded automatically on first use.
🎯 Use Cases
For Developers
Pre-commit validation: Ensure all Mermaid diagrams in your codebase are valid
CI/CD integration: Add diagram validation to your build pipeline
Documentation quality: Catch syntax errors before publishing docs
For Technical Writers
Content validation: Verify diagrams render correctly before publication
Error debugging: Get clear error messages for syntax issues
For AI Assistants
Real-time validation: Validate generated diagrams instantly
MCP integration: Seamless integration with Claude Code, Cursor, Trae, and other AI tools
Automated workflows: Enable AI to self-validate diagram outputs
📋 Features
✅ Fast Validation: Optimized for speed with browser reuse and local libraries
✅ Multiple Formats: Support for all Mermaid diagram types
✅ Dual Interface: Both CLI tool and MCP server in one package
✅ Error Details: Clear error messages with line numbers and suggestions
✅ Timeout Control: Configurable validation timeouts
✅ Zero Config: Works out of the box
🛠️ Installation Options
Option 1: Use with npx (Recommended)
No installation needed - just use npx mermaid-lint-mcp directly.
Option 2: Global Installation
Option 3: Local Project Installation
📖 Usage Guide
CLI Commands
Validate Diagrams
Start MCP Server
Get Help
MCP Server Integration
For Claude Desktop
Add to your claude_desktop_config.json:
For Other MCP Clients, the setup is similar to above, please refer to the official documentation
📊 Supported Diagram Types
Type | Syntax | Example |
Flowchart |
| Decision trees, processes |
Sequence |
| API interactions, workflows |
Class |
| Object relationships |
State |
| State machines |
ER |
| Database schemas |
Gantt |
| Project timelines |
Pie |
| Data visualization |
Journey |
| User experiences |
Git Graph |
| Version control flows |
... |
| ... |
🔧 Configuration
Validation Options
Environment Variables
🔍 Example Outputs
Valid Diagram
Invalid Diagram
CLI Output
🚨 Common Issues & Solutions
Issue: "Command not found"
Solution: Use npx mermaid-lint-mcp instead of mermaid-lint-mcp
Issue: Validation timeout
Solution: Increase timeout with --timeout 10000
Issue: Permission denied
Solution: Run with appropriate permissions or use npx
📝 License
MIT License - see LICENSE file for details.
🙋♂️ Support
🔗 Related Tools
Mermaid - Create diagrams with text
Mermaid Live Editor - Online diagram editor
Model Context Protocol - AI integration standard