MCP.so
ログイン

Mermaid Validator

@rtuin

Mermaid Validator について

A Model Context Protocol server that validates and renders Mermaid diagrams.

基本情報

カテゴリ

その他

ライセンス

MIT

ランタイム

node

トランスポート

stdio

公開者

rtuin

投稿者

Richard Tuin

設定

以下の設定を使って、このサーバーを 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.

コメント

「その他」の他のコンテンツ