Nereid - Mermaid charts

by bnomei

Not rated
GitHub

About

Create and explore Mermaid diagrams in collaboration with AI agents

Details

Author
bnomei
Categories
Developer Tools, Other

Setup

Install Nereid - Mermaid charts in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/bnomei/nereid

Follow the installation instructions in the repository README, then restart your MCP client.

Create and explore Mermaid diagrams in collaboration with AI agents

Nereid is a terminal-first workspace for Mermaid-backed diagrams. It combines aratatuiTUI, a Model Context Protocol (MCP) server, folder-based session persistence, and deterministic text renders so humans and AI agents can inspect and update the same diagram session.

- browse and edit sequence, flowchart, class, entity-relationship (ER), and Gantt diagrams from a terminal,
- keep diagrams, walkthroughs, cross-references, selections, and active state in a local session folder,
- expose typed MCP tools for diagram navigation, structured mutation (including sequence blocks), xrefs, walkthroughs, and graph queries,
- replace Mermaid sources with identity-preserving reconcile when fingerprints still match,
- export Mermaid sources plus text previews for reviewable, file-based workflows.

Nereid is source-available for noncommercial use only. Commercial use, product use, paid service use, internal business use, redistribution, sublicensing, or modified distribution requires separate written permission. SeeLicense.

- 0.9:Added class, entity-relationship, and Gantt diagrams across parsing, text rendering, the TUI, persisted sessions, and typed MCP reads. The built-in demo now covers all five diagram families.
- 0.8:Added structured sequence block and section ops plusdiagram_replace_from_mermaid, which reconciles stable identities during bulk Mermaid rewrites and reports dangling xrefs.
- 0.7:Added the fuzzy:diagram switcher and persisted Frigg symbol anchors for sequence participants and flowchart nodes.

SeeCHANGELOG.mdfor the complete release history.

- Rust 1.85 or newer when installing with Cargo or building from source.
- A terminal that supports alternate-screen TUI applications.
- Optional:VISUALorEDITORfor the in-app Mermaid editor. Nereid falls back tovi.

Installing Nereid does not grant unrestricted rights. The same source-available noncommercial license applies to crates.io, Homebrew, GitHub Releases, npm, Docker, and source builds.

brew install bnomei/nereid/nereid nereid --version

Requires Node.js 18 or newer. The wrapper supports Linux and macOS on x64 or arm64, plus Windows on x64. Linux and macOS also needtarto extract the downloaded release archive.

The npm package is a thin wrapper. On first run it downloads the matching GitHub Release binary, verifies the published.sha256, caches it locally, and forwards argv to the binary.

docker run --rm ghcr.io/bnomei/nereid:0.9.0 --version

The image is built from published musl Linux release assets. Prefer binding a session directory for MCP or file-backed work:

docker run --rm -i -v "$PWD/my-session:/workspace/my-session" ghcr.io/bnomei/nereid:0.9.0 --mcp --session /workspace/my-session

The-iflag keeps stdin open for the stdio MCP transport. Add-tas well when you run the interactive TUI in Docker.

Download a release archive fromGitHub Releases, review the included license notice, extract the archive, and put thenereidbinary on yourPATH.

git clone https://github.com/bnomei/nereid.git cd nereid cargo build --release ./target/release/nereid --version

- The TUI opens with demo diagrams.
- Press?to open the in-app help.
- Pressqto quit.
- While the TUI runs, MCP is available over Streamable HTTP athttp://127.0.0.1:27435/mcp.

Create or open a persistent session folder:

If the folder has no session metadata, no existingdiagrams/.mmdfiles, and no existingwalkthroughs/.wt.jsonfiles, Nereid initializes a seedflowdiagram. If durable diagram or walkthrough files exist withoutnereid-session.meta.json, Nereid refuses to seed a new session so those files cannot be orphaned; restore the metadata index to repair the session. For an existing session, Nereid loads the metadata index and its referenced diagram and walkthrough files.

nereid [<session-dir>] [--durable-writes] [--mcp-http-port <port>] nereid [--session <dir>] [--durable-writes] [--mcp-http-port <port>] nereid --demo [--mcp-http-port <port>] nereid [<session-dir>] [--durable-writes] --mcp nereid [--session <dir>] [--durable-writes] --mcp nereid --demo --mcp nereid --dump-mcp-tool-schema

- Ifsession-dirand--sessionare omitted, Nereid uses the current working directory.
- --democannot be combined with a session directory.
- --mcp-http-portis only valid in TUI mode.
- --durable-writesopts into slower best-effort durable persistence with fsync or sync where supported.

A session folder is the source of truth for durable Nereid state. The TUI and persistent MCP server both read and write this folder.

Nereid may rewrite managed files while it runs. Use the TUIekey to edit the active diagram in$VISUALor$EDITOR, or stop Nereid before making manual changes. Text render exports are generated asynchronously and can briefly lag behind.mmdor.wt.jsonupdates during rapid edits.

Nereid parses a deliberate Mermaid subset and reports unsupported syntax as an actionable error.

- sequenceDiagramas the first non-empty line,
- comments beginning with%%,
- participant <name>and<role> <name>declarations,
- message lines such asalice->>bob: Hello,
- Mermaid message arrows normalized internally to sync, async, or return messages,
- alt,opt,loop, andparblocks,
- elseinsidealt,andinsidepar, andendblock closures.

- flowchartorgraphas the first non-empty line, with optionalTD,TB,LR,RL, orBTdirection,
- comments beginning with%%,
- node declarations:<id>,<id>[<label>],<id>(<label>), and<id>{<label>},
- edges with common Mermaid flowchart operators, normalized internally,
- edge labels inA -->|label| BandA -- label --> Bforms,
- chained edges such asA --> B --> C,
- linkStylestatements, which are preserved on export. Per-edge styles containing the literal worddashedproduce dashed text-render strokes; other CSS properties andlinkStyle defaultdo not affect text rendering.

- classDiagramas the first non-empty line,
- comments beginning with%%,
- bare class names containing ASCII letters, digits, underscores, or hyphens,
- members inClassName : memberform; members containing(are methods and the rest are attributes,
- inheritance, composition, aggregation, association, dependency, realization, and plain-link relations,
- optional relation labels after:,
- class notes stored in the diagram sidecar.

- erDiagramas the first non-empty line,
- comments beginning with%%,
- bare entity names containing ASCII letters, digits, underscores, or hyphens,
- identifying (--) and non-identifying (..) relationships,
- Mermaid cardinality tokens||,|o,o|,|{,}|,}o, ando{,
- optional relationship labels after:,
- entity notes stored in the diagram sidecar.

- ganttas the first non-empty line,
- comments beginning with%%,
- optionaltitleanddateFormatlines,
- namedsectiongroups,
- tasks with an optional tag, an absoluteYYYY-MM-DDstart orafter <tag>dependency, and a day duration such as14d,
- task and rendered time-lane notes stored in the diagram sidecar.

Parsed sequence participant and flowchart node names must be non-empty ASCII alphanumeric strings or underscores. They cannot contain whitespace or/. Class and ER names additionally allow hyphens. Gantt task labels are free-form text before the task metadata colon.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.