Mermaid Validator MCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Mermaid Validator MCP
A Model Context Protocol (MCP) server built with Bun and TypeScript that validates Mermaid diagram syntax.
Quick Start
This package is published on npm. You can run it directly with npx:
npx -y mermaid-validator-mcpRelated MCP server: Mermaid-Grammer-Inspector
MCP Client Configuration
Add the server to your MCP client (e.g. Claude Desktop) configuration:
Using npx (recommended)
{
"mcpServers": {
"mermaid-validator": {
"command": "npx",
"args": ["-y", "mermaid-validator-mcp"]
}
}
}Using local source
{
"mcpServers": {
"mermaid-validator": {
"command": "bun",
"args": [
"/path/to/mermaid-validator-mcp/index.ts"
]
}
}
}Or if you have it installed globally:
{
"mcpServers": {
"mermaid-validator": {
"command": "mermaid-validator-mcp"
}
}
}Features
Single tool –
validate_mermaid: Pass any Mermaid diagram text and receive either a success response with the detected diagram type, or a detailed parse-error message.Supports all major Mermaid diagram types: flowchart, sequence, class, pie, gantt, state, ER, gitGraph, mindmap, timeline, and more.
No dependency on
mermaid-clior any external rendering process.Uses JSDOM to provide the minimal DOM environment required by Mermaid.
Requirements
Bun ≥ 1.0
Getting Started
# Install dependencies
bun install
# Start the MCP server (stdio mode)
bun startTool: validate_mermaid
Input
Field | Type | Description |
| string | The Mermaid diagram text to validate |
Output (JSON text)
Valid diagram
{ "valid": true, "diagramType": "flowchart-v2" }Invalid diagram
{
"valid": false,
"error": "Parse error on line 2:\n...TD\n --> B\n-------^\nExpecting 'SEMI', ..."
}Development
# Run with auto-reload
bun dev
# Build
bun run buildThis server cannot be deployed
Maintenance
Related MCP Connectors
Render, verify, describe, and safely edit Mermaid diagrams through MCP.
Validate Mermaid syntax and get error details your coding agent can use to correct a diagram. Check the source again before adding it to your documentation. Validation works without saving a diagram. Render SVG, PNG, or PDF, save diagrams privately, and publish selected snapshots. Your existing agent writes and corrects the source; MermaidDesk checks and renders it. Validation checks syntax, not whether a diagram accurately describes a system. Connect through MCP with Streamable HTTP and a scoped bearer API key. Enable MERMAID_RENDER for validation and rendering. A REST API is also available. MCP setup: https://www.mermaiddesk.com/developers/mcp REST API guide: https://www.mermaiddesk.com/developers/api
Monitor MCP servers, API contracts and AI outputs for schema drift. Alerts on breaking changes.
Collaborative whiteboard MCP server — create objects, connectors, C4 diagrams, and manage boards
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that converts text inputs into visualized flowcharts, enabling AI clients to generate high-quality Mermaid diagrams directly from natural language descriptions or structured text.12MIT
- AlicenseAqualityFmaintenanceA Model Context Protocol (MCP) server for validating Mermaid diagram syntax and providing comprehensive grammar checking capabilities113 npm5MIT
- AlicenseNot gradedqualityCmaintenanceA lightweight MCP server that provides real-time Mermaid diagram syntax validation with support for all diagram types.73 npm3MIT
- AlicenseAqualityDmaintenanceAn MCP server that generates diagrams from Mermaid code in multiple formats (PNG, PDF, SVG).21MIT