Mermaid ValidatorSAFE
A Model Context Protocol server that validates and renders Mermaid diagrams.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
A Model Context Protocol server that validates and renders Mermaid diagrams. This server enables LLMs to validate and render Mermaid diagrams.
Usage
Quick Start
You can configure your MCP client to use the Mermaid Validator by adding it to your mcp servers file:
{
"mcpServers": {
"mermaid-validator": {
"command": "npx",
"args": [
"-y",
"@rtuin/mcp-mermaid-validator@latest"
]
}
}
}Architecture
High-Level Architecture
This project is structured as a simple TypeScript Node.js application that:
- Main Application: A Node.js service that validates Mermaid diagrams and returns rendered PNG output
- MCP Integration: Uses the Model Context Protocol SDK to expose functionality to MCP-compatible clients
- Mermaid CLI Integration: Leverages the Mermaid CLI tool to perform diagram validation and rendering
Code Structure
mcp-mermaid-validator/ ├── dist/ # Compiled JavaScript output │ └── main.js # Compiled main application ├── src/ # TypeScript source code │ └── main.ts # Main application entry point ├── node_modules/ # Dependencies ├── package.json # Project dependencies and scripts ├── package-lock.json # Dependency lock file ├── tsconfig.json # TypeScript configuration ├── eslint.config.js # ESLint configuration ├── .prettierrc # Prettier configuration └── README.md # Project documentation
Component Functionality
MCP Server (Main Component)
The core functionality is implemented in src/main.ts. This component:
- Creates an MCP server instance
- Registers a
validateMermaidtool that accepts Mermaid diagram syntax - Uses the Mermaid CLI to validate and render diagrams
- Returns validation results and rendered PNG (if valid)
- Handles error cases with appropria
fb805d7ba735OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add mcp-mermaid-validator -- npx -y @rtuin/[email protected]
{
"mcpServers": {
"mcp-mermaid-validator": {
"command": "npx",
"args": [
"-y",
"@rtuin/[email protected]"
]
}
}
}Exposed tools (1)
1 read · 0 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
validateMermaid | read | Validates a Mermaid diagram and returns the rendered image (PNG or SVG) if valid |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (1)
@mermaid-js/mermaid-cli, @modelcontextprotocol/sdk, zod, @eslint/js, @types/node, eslint, eslint-config-prettier, globals
Gates applied: no_behavioural_pass.
fb805d7ba735full audit observations/trust-audit/mcp-server/rtuin__mermaid-validator.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | fb805d7ba735 | SAFE | B | 89 | first audit |
Questions
What is the Mermaid Validator MCP server?
A Model Context Protocol server that validates and renders Mermaid diagrams.
What tools does Mermaid Validator expose?
1 in total: 1 read-only, 0 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is Mermaid Validator safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does Mermaid Validator need?
No credential environment variables were found in its source, so it appears to need none.
How does Mermaid Validator run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as @rtuin/mcp-mermaid-validator at 0.7.0.
How current is this page?
The grade is for one exact copy of the source (fb805d7ba735), read on 2026-10-08. The repository is watched and re-audited when it changes.