home / mcp / mermaid validator mcp server
fast-mermaid-validator-mcp
Configuration
View docs{
"mcpServers": {
"ai-of-mine-fast-mermaid-validator-mcp": {
"url": "http://localhost:8080/mcp",
"headers": {
"HOST": "0.0.0.0",
"PORT": "8080",
"MCP_HTTP_HOST": "localhost",
"MCP_HTTP_PORT": "8080"
}
}
}
}You can run a fast Mermaid diagram validator as an MCP server and connect your applications or Claude-based tooling to validate diagrams in real time. It exposes both a REST-style API and an MCP server that supports multiple transports, authentication, and enterprise-ready features to scale with your workflows.
You can connect to the MCP server from your client in two ways: through the REST API for web or app integrations, and through the MCP transport for direct model-context interactions with your ML tooling or Claude integrations. The REST API provides endpoints to validate diagrams sent as JSON or uploaded as files. The MCP server allows you to run a local transport (stdio) or an HTTP transport so your tools can submit diagrams and receive structured validation results.
- Start the MCP HTTP transport to enable programmatic diagram validation over HTTP. You can then point your MCP client at the provided URL and perform validation requests. A typical pattern is to send a diagram or a set of diagrams and receive detailed results including per-diagram errors, types, and metadata.
Prerequisites: you need Node.js installed on your machine. A modern Node.js LTS version is recommended.
Install the validator package from npm and run the REST API or MCP transports as needed.
# Install from npm (recommended)
npm install @ai-of-mine/fast-mermaid-validator-mcp
# Start REST API server (default port 8000)
npx @ai-of-mine/fast-mermaid-validator-mcp
# Start MCP HTTP server (default port 8080)
npx @ai-of-mine/fast-mermaid-validator-mcp --mcp-http
# Start MCP stdio server (local/CLI transport)
npx @ai-of-mine/fast-mermaid-validator-mcp --mcp-stdio
# Start MCP secure server (production-ready)
npx @ai-of-mine/fast-mermaid-validator-mcp --mcp-secure
# Show help
npx @ai-of-mine/fast-mermaid-validator-mcp --helpMCP server configurations support both HTTP-based and local stdio transports. The HTTP transport exposes endpoints for validating diagrams, while the stdio transport enables direct CLI or IDE integrations.
# Example: start MCP HTTP transport (URL will be http://localhost:8080/mcp by default in examples)
npx @ai-of-mine/fast-mermaid-validator-mcp --mcp-httpThis server includes authentication options, rate limiting, input validation, and container-ready deployments. It supports API keys and Bearer tokens for access control, configurable request throttling, and security headers to help protect your applications.
# Direct diagram validation via REST API (example flow)
curl -X POST http://localhost:8000/api/v1/validate \
-H "Content-Type: application/json" \
-d '{"diagram": "flowchart TD\n A[Start] --> B[Process]\n B --> C[End]"}'If you encounter connection or validation failures, check server logs for security or timeout messages, ensure the port is reachable, and verify that your client uses the correct endpoint (REST API or MCP URL). Ensure your request payload adheres to the supported diagram types and proper syntax.
The server is designed to handle large batches and multiple diagram types. Use environment variables to tune performance, timeouts, and limits as your deployment grows.
Direct diagram validation with comprehensive error reporting for single Mermaid diagrams.
Validate content from files (diff formats) with base64-encoded results and per-file diagnostics.
Fetch sample diagrams for all supported diagram types to aid learning and testing.