cd /news/developer-tools/agentic-mermaid · home topics developer-tools article
[ARTICLE · art-83923] src=agentic-mermaid.dev ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Agentic Mermaid

Agentic Mermaid, a new open-source tool, combines a Mermaid parser, deterministic renderer, style system, and verification loop to let AI agents create, style, and export diagrams while keeping the Mermaid source reviewable. It offers built-in styles, palette themes, and multiple output formats (SVG, PNG, ASCII, Unicode, layout JSON), with a library, CLI, and MCP server for agent-native control. The tool includes verifyMermaid for structural and geometric warnings, and supports one-request, three-channel operation via library, CLI, or MCP.

read2 min views6 publishedAug 2, 2026
Agentic Mermaid
Image: Agentic-Mermaid (auto-discovered)

Agentic Mermaid combines a Mermaid parser, deterministic renderer, style system, and verification loop. Your agent can create a diagram, apply a style and brand palette, export the artifact you need, and keep the Mermaid source reviewable for the next edit.

Beautiful renders

Built-in styles cover docs, decks, reports, terminals, sketches, and blueprints.

Palette themes and custom JSON styles encode brand colors, typography, strokes, fills, and page backdrops.

SVG and PNG serve pages and decks; ASCII, Unicode, and layout JSON serve review tools and agents.

Agent-native control

Typed parse and mutate helpers make Mermaid source the durable interface.

verifyMermaid reports structural, geometric, and lint warnings with stable codes.

start.md, CLI, library, and MCP surfaces give agents one tested operating path.

The result is source you can review, renders you can ship, and an edit loop your agent can repeat.

One request, three channels

Ask the agent to make the diagram, set style and palette, verify the source, and return the render path through whichever channel it already has.

Library

import { parseRegisteredMermaid, asFlowchart, mutate, verifyMermaid, serializeMermaid }
  from 'agentic-mermaid/agent'

const flow = asFlowchart(parseRegisteredMermaid(source).value)
const r = mutate(flow, { kind: 'add_edge', from: 'API', to: 'Cache' })
if (!verifyMermaid(r.value).ok) throw new Error('edit left structural warnings')
const next = serializeMermaid(r.value)

CLI

$ am mutate diagram.mmd --op '{"kind":"add_edge","from":"API","to":"Cache"}'
$ am verify diagram.mmd --json            # tiered warnings, stable codes
$ am render diagram.mmd --format unicode  # same layout, in the terminal

MCP

// MCP Code Mode: the hosted MCP at https://agentic-mermaid.dev/mcp, or a self-hosted server.
// The whole loop runs in one execute(code) call; the SDK is bound as `mermaid`.
execute(`
  const source = 'flowchart LR\n  UI[Web app] --> API\n  API --> DB[(Postgres)]'
  const flow = mermaid.asFlowchart(mermaid.parseRegisteredMermaid(source).value)
  const r = mermaid.mutate(flow, { kind: 'add_edge', from: 'API', to: 'Cache' })
  const v = mermaid.verifyMermaid(r.value)
  return v.ok ? { source: mermaid.serializeMermaid(r.value) }
              : { error: 'verify failed', warnings: v.warnings }
`)

In the cloned repo, am is bun run bin/am.ts; MCP wiring is in Getting started.

Install locally in Getting started: clone, build, and wire the stdio MCP in two minutes.

Style × palette

One source, three styles

Render SVG for docs, PNG for decks, ASCII or Unicode for review, and layout JSON when tooling needs coordinates. To change visual treatment, pass a style stack in render options; examples include watercolor,paper and ops-schematic,nord-light. Seed changes only sketch noise; node positions and edge routes stay fixed.

Each card uses the same Mermaid source with different render options. Agents pass style, palette, and seed in the render call instead of rewriting labels or edges for visual changes.

Sketch note

For whiteboards, docs drafts, and agent working notes.

── more in #developer-tools 4 stories · sorted by recency
── more on @agentic mermaid 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/agentic-mermaid] indexed:0 read:2min 2026-08-02 ·