Mermaid Validator
@rtuin
关于 Mermaid Validator
A Model Context Protocol server that validates and renders Mermaid diagrams.
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"mermaid-validator": {
"command": "npx",
"args": [
"-y",
"@rtuin/mcp-mermaid-validator"
]
}
}
}工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
What is Mermaid Validator?
Mermaid Validator is a Model Context Protocol server that validates and renders Mermaid diagrams. It enables LLMs to check diagram syntax and obtain a rendered PNG image, integrating with MCP-compatible clients.
How to use Mermaid Validator?
Configure your MCP client by adding the server to the mcp servers file with the command npx -y @rtuin/mcp-mermaid-validator@latest. The server exposes a validateMermaid tool that accepts a Mermaid diagram string and returns validation results plus a rendered PNG if valid.
Key features of Mermaid Validator
- Validates Mermaid diagram syntax and returns rendered PNG.
- Integrates with MCP-compatible clients via Model Context Protocol.
- Uses Mermaid CLI for validation and rendering.
- Returns base64-encoded PNG image on success.
- Provides detailed error messages on failure.
- Child process approach ensures isolation and error handling.
Use cases of Mermaid Validator
- Ensuring Mermaid diagrams generated by LLMs are syntactically correct.
- Rendering diagrams for preview in MCP clients.
- Automatically validating diagram syntax in AI-assisted workflows.
- Integrating diagram validation into MCP-based tools.
FAQ from Mermaid Validator
What does the validateMermaid tool do?
It accepts a Mermaid diagram string, validates it, and returns a confirmation text plus a base64-encoded PNG image if valid, or an error message if invalid.
What are the dependencies of Mermaid Validator?
The server depends on @modelcontextprotocol/sdk, @mermaid-js/mermaid-cli, and zod for schema validation.
How does Mermaid Validator handle errors?
It uses a nested try-catch structure to distinguish between validation errors (invalid diagram syntax) and system errors, providing detailed error information to help users fix their diagrams.
What output format does Mermaid Validator use?
It uses PNG as the default output format because it ensures better compatibility with most MCP clients, particularly Cursor, which does not support SVG.
How is Mermaid Validator invoked?
It communicates via standard input/output as an MCP server and can be run using npx with the package @rtuin/mcp-mermaid-validator@latest. For development, it can be launched via the MCP Inspector.
其他 分类下的更多 MCP 服务器
Nginx UI
0xJackyYet another WebUI for Nginx
Maestro
mobile-dev-incPainless E2E Automation for Mobile and Web
FastMCP v2 🚀
jlowin🚀 The fast, Pythonic way to build MCP servers and clients.
Inbox Zero AI MCP
elie222The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.
Production-ready MCP integrations for AI applications
Klavis-AIKlavis AI: MCP integration platforms that let AI agents use tools reliably at any scale
评论