The hard problem in agent-edited diagrams is churn: rewrite the Mermaid and every reference breaks. Nereid keeps stable ids across a bulk replace when the fingerprints still match, and tells you which cross-references were dropped. The shared attention state is the other half - it is what makes the agent's edits land where you are actually looking.
A diagram workspace with two front ends onto one session folder. A terminal UI for a person, and typed MCP tools for an agent; both read and write the same Mermaid sources, cross-references and walkthroughs on disk.
- Five diagram families - sequence, flowchart, class, entity-relationship and Gantt - parsed, rendered as text, and persisted
- Diagram lifecycle and reads: list, open, delete, read, stat, abstract syntax tree, slice, text render and diff
- Structured mutation for sequence and flowchart diagrams, plus a bulk Mermaid replace that keeps stable identities when fingerprints still match and reports which references went dangling
- Walkthroughs with their own list, read, node and diff tools, and structured edits
- Cross-references between diagrams, with neighbours, adding, removing and object reads
- Graph queries: reachability, paths, cycles, unreachable nodes, dead ends, degrees, and message search or trace on a sequence
- Shared attention state, so the agent can see what the human is looking at and say what it is looking at
Rust 1.85 or newer for a Cargo install; Homebrew, GitHub releases, Docker and an npm wrapper needing Node.js 18 are also available. A session folder is the unit of work and the source of truth - Mermaid sources, metadata index, walkthroughs and text renders all live there. In TUI mode the MCP server is served over streamable HTTP on port 27435; with the mcp flag and a session path it runs over stdio instead. The licence is source-available and noncommercial: commercial, product or internal business use needs written permission.
One command — cargo install nereid
