Skip to main content
Glama
yulinlina
by yulinlina

mermaid-mender

A tiny CLI and MCP-like server that validates and self-heals broken Mermaid diagrams generated by AI agents.

License Language Status PyPI version Python 3.9+ MCP-like


🎯 Why?

AI coding agents increasingly emit Mermaid diagrams into docs, README files, and agent workflows, but they often produce invalid arrows, missing diagram types, or unbalanced labels. Existing Mermaid renderers fail late and give little actionable repair feedback, and newer layout tools like Line9 are not open-source agent utilities. A small local validator/repair layer fits directly into agent loops, CI, and MCP toolchains.

Target audience: Developers using AI coding agents, MCP clients, documentation pipelines, and CI checks that need reliable Mermaid diagrams without manually debugging syntax.

Related MCP server: Fast Mermaid Validator MCP

✨ Features

  • ✨ validate_mermaid: reports empty input, missing diagram type, nonstandard arrows, unbalanced quotes, and unbalanced brackets

  • ✨ repair_mermaid: normalizes arrows, closes odd quotes, and prepends flowchart TD when a flowchart is detected but missing

  • ✨ MCP-like stdio JSON-RPC server exposing validate and repair tools to agents

πŸš€ Quick Start

# Install
pip install mermaid-mender

# Run
mermaid-mender --help

πŸ“¦ Installation

From Source

git clone https://github.com/YOUR_USERNAME/mermaid-mender.git
cd mermaid-mender
# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest -v

🎬 Demo

The GIF above was recorded using Charm VHS:

vhs < demo.tape

πŸ“– Usage

# Show help
mermaid-mender --help

# Common usage examples
mermaid-mender --example

πŸ—οΈ Architecture

graph LR
    A[Input] --> B[Core Engine]
    B --> C[Output]
    B --> D[Plugins]
    D --> E[Extensions]

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repo

  2. Create a feature branch (git checkout -b feature/amazing-feature)

  3. Commit your changes (git commit -m 'Add amazing feature')

  4. Push to the branch (git push origin feature/amazing-feature)

  5. Open a Pull Request

πŸ“„ License

MIT Β© 2026 β€” See LICENSE for details.


If this project helped you, please ⭐ star it!

Made with ❀️ and AI

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
–Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Generate dynamic Mermaid diagrams and charts with AI assistance. Customize styles and export diagr…

  • Create, validate, edit, export (markdown/svg/png/mermaid), and search JSON Canvas files.

  • Let Claude, Cursor, or ChatGPT author Mermaid diagrams your team can read and share.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yulinlina/mermaid-mender'

If you have feedback or need assistance with the MCP directory API, please join our Discord server