Home / MCP / Mermaid Validator MCP Server
Provides Mermaid diagram validation and PNG rendering via MCP for AI tools.
Configuration
View docs{
"mcpServers": {
"mermaid_validator": {
"command": "npx",
"args": [
"-y",
"@rtuin/mcp-mermaid-validator@latest"
]
}
}
}The Mermaid Validator MCP Server lets you validate and render Mermaid diagrams through the Model Context Protocol, so AI tools can confirm syntax correctness and obtain a rendered PNG image for diagrams you supply.
You connect your MCP client to the Mermaid Validator to check Mermaid syntax and receive a rendered PNG when the diagram is valid. Use it to quickly verify diagrams before embedding them in your workflows, documentation, or AI-assisted renderings.
Prerequisites: Node.js installed on your development machine. You also need npm to install and run the server.
Install dependencies and build the project.
npm install
npm run buildRun the local MCP server inspector for development.
npx @modelcontextprotocol/inspector node dist/main.jsOptional tooling commands for maintenance.
npm run format
npm run lint
npm run watchThe server is configured to run as a local MCP server using a straightforward command. You expose a single MCP server entry that points to the Mermaid Validator tool.
{
"mcpServers": {
"mermaid-validator": {
"command": "npx",
"args": [
"-y",
"@rtuin/mcp-mermaid-validator@latest"
]
}
}
}This server uses the Mermaid CLI to validate diagram syntax and render PNG output. It returns a textual confirmation along with a base64-encoded PNG when the diagram is valid, or an error message with details when it is not.
Keep the validator up to date by upgrading to the latest package version in the command configuration and periodically rebuilding. Treat the rendered PNG output as an opaque artifact from your diagram processing workflow.
Validates a Mermaid diagram syntax and returns a rendered PNG if valid, including a base64-encoded image and a text status.