Skip to main content

Mermaid Plus Diagrams & AI Agent for Confluence — User Guide

Related blog post: Create Mermaid diagrams in Confluence: a step-by-step guide · Mermaid 12 in Confluence & Jira: UML use case diagrams

Overview​

Mermaid Plus Diagrams & AI Agent for Confluence lets you create beautiful diagrams directly in Confluence pages using Mermaid syntax. Choose from 35 Mermaid v12 diagram types, customize colors and fonts, and preview your diagram live before saving. A Rovo AI agent can also create, read, update, and convert diagrams from chat — see Rovo AI Agent — and the same tools are available as an MCP server for Rovo Studio agents and third-party AI clients like Claude and Cursor.

Getting Started​

Inserting a Diagram​

  1. Edit a Confluence page
  2. Type /mermaid in the editor and select Mermaid Plus Diagrams & AI Agent for Confluence
  3. The configuration panel opens with a three-column layout:
    • Left: Live Preview
    • Middle: Quick Templates
    • Right: Settings + Code Editor
  4. Write or paste your Mermaid code in the editor
  5. Click Save to insert the diagram

Re-editing a Diagram​

Click on an existing diagram macro and select Edit to reopen the configuration panel. All your settings and code are preserved.


Configuration Panel​

Live Preview​

The left column renders your diagram in real-time as you type. Any changes to code or settings are reflected immediately.

Quick Templates​

The middle column provides one-click templates for all 35 supported diagram types. Click any template to load its code into the editor.

Syntax Guide​

Click the Help button in the header to open the full syntax reference. Browse 35 diagram types with descriptions and code examples. Hover over any code block and click the insert button to load it into the editor.


Settings​

Font​

  • Family — Choose from Inter, Arial, Helvetica, Georgia, or Courier
  • Size — 12px, 14px (default), 16px, 18px, 20px

Colors​

Five customizable colors with visual color pickers:

ColorAffects
NodeBackground color of diagram nodes/boxes
TextText color inside nodes
BorderBorder color of nodes
LineEdge/arrow line color
BgDiagram background color

Theme​

Mermaid built-in themes:

ThemeDescription
DefaultClean light theme with customizable colors
DarkDark background with high-contrast text
ForestGreen-tinted natural color palette
NeutralGrayscale minimal theme

Note: The Default theme uses your custom color settings. Other themes apply their own color palette.

Output Size​

Controls the displayed size of the diagram in the Confluence page:

SizeScale
Small0.5x
Medium1x (default)
Large1.5x
X-Large2x

Dark Mode Support​

The macro automatically adapts to Confluence's dark/light mode:

  • When you save a diagram, the current Confluence theme is recorded
  • When the page loads, if the theme has changed, text and background colors are adjusted for readability
  • The config preview also adapts to dark mode

Supported Diagram Types​

Flowchart​

Directed graph diagrams with nodes, arrows, and subgraphs.

graph TD
A[Start] -->|Yes| B[Process]
B --> C{Decision}
C -->|Option 1| D[Result 1]
C -->|Option 2| E[Result 2]

Directions: TD (top-down), BT (bottom-up), LR (left-right), RL (right-left)

Node shapes: [Square], (Rounded), {Diamond}, ((Circle))

Swimlane​

Cross-functional process diagrams (swimlanes) showing hand-offs between teams or actors. Each top-level subgraph becomes a lane; nodes and edges use standard flowchart syntax. Optionally set a direction (TB, LR, BT, RL) after the keyword.

swimlane-beta LR
subgraph Customer
order[Place order]
receive[Receive delivery]
end
subgraph Sales
review[Review order]
confirm[Confirm and invoice]
end
order --> review
review --> confirm
confirm --> receive

Sequence Diagram​

Interaction diagrams showing messages between participants.

sequenceDiagram
participant Alice
participant Bob
Alice->>Bob: Hello Bob
Bob-->>Alice: Hi Alice

Arrow types: ->> (solid), -->> (dashed), --) (async)

Class Diagram​

Object-oriented class relationships with inheritance, composition, and visibility.

classDiagram
Animal <|-- Duck
Animal : +int age
class Duck {
+String beakColor
+swim()
}

State Diagram​

Finite state machines with transitions between states.

stateDiagram-v2
[*] --> Idle
Idle --> Processing
Processing --> Done
Done --> [*]

Entity Relationship Diagram​

Database schema diagrams with entity relationships.

erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : contains

User Journey​

Task satisfaction maps with sentiment scores (1–5).

journey
title My working day
section Morning
Make tea: 5: Me
Do work: 3: Me
section Evening
Go home: 5: Me

Gantt Chart​

Project schedule charts with tasks, dependencies, and milestones.

gantt
title Project Plan
dateFormat YYYY-MM-DD
section Phase 1
Research :a1, 2024-01-01, 30d
Design :after a1, 20d

Pie Chart​

Proportional data visualization.

pie title Time Allocation
"Development" : 45
"Testing" : 30
"Meetings" : 25

Git Graph​

Git branch and commit history visualization.

gitGraph
commit
branch develop
checkout develop
commit
checkout main
merge develop
commit

Mindmap​

Hierarchical tree diagrams for brainstorming.

mindmap
root((Central Topic))
Branch A
Sub-topic 1
Sub-topic 2
Branch B
Sub-topic 3

Timeline​

Chronological event sequences.

timeline
title History
section 2020
Event A : Description
section 2021
Event B : Description

Requirement Diagram​

Requirements traceability diagrams linking requirements to elements.

requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req

C4 Diagram​

Software architecture diagrams following the C4 model.

C4Context
title System Context
Person(user, "User")
System(app, "Application")
Rel(user, app, "Uses")

Quadrant Chart​

Two-axis categorization charts.

quadrantChart
title Analysis
x-axis Low --> High
y-axis Low --> High
quadrant-1 Expand
quadrant-2 Promote
quadrant-3 Re-evaluate
quadrant-4 Improve
Item A: [0.3, 0.6]
Item B: [0.7, 0.4]

Cynefin​

Dave Snowden's sense-making framework that categorizes problems into five domains: clear, complicated, complex, chaotic, and confusion (center). Each domain holds quoted-string items; optional top-level transitions show how situations move between domains.

cynefin-beta
title Where does this problem sit?
complex
"Probe - run safe-to-fail experiments"
complicated
"Analyze - apply expert knowledge"
clear
"Respond - apply best practice"
chaotic
"Act - stabilize first"
confusion
"Break the problem down"
clear --> chaotic : "Complacency"
chaotic --> complex : "Stabilized"

Sankey Diagram​

Flow diagrams showing quantities through a system.

sankey-beta
Source,Target,100
Source,Other,50
Other,Target,30

XY Chart​

Bar and line charts.

xychart-beta
title "Revenue"
x-axis [Q1, Q2, Q3, Q4]
y-axis "USD" 0 --> 100
bar [30, 45, 60, 80]
line [32, 48, 62, 78]

Block Diagram​

Block diagrams with columns layout.

block-beta
columns 1
db(("DB"))
block:ID
A["Block A"]
B["Block B"]
end
ID --> db

Packet Diagram​

Network packet structure diagrams.

packet-beta
0-15: "Source Port"
16-31: "Destination Port"
32-63: "Sequence Number"

Kanban Board​

Board-style task organization.

kanban
To Do
Task 1
Task 2
In Progress
Task 3
Done
Task 4

Architecture Diagram​

Infrastructure and service architecture.

architecture-beta
group api(cloud)[API]
service db(database)[Database] in api
service server(server)[Server] in api
db:L -- R:server

Radar Chart​

Multi-axis comparison charts.

radar-beta
axis Math, Science, English
curve Alice{85, 90, 80}
curve Bob{70, 75, 85}
max 100

TreeView​

File/folder tree visualization.

treeView-beta
"root"
"src"
"index.ts"
"test"
"index.test.ts"

Treemap​

Hierarchical data as nested rectangles.

treemap
"Category A"
"Item 1" : 10
"Item 2" : 20
"Category B"
"Item 3" : 15

Ishikawa (Fishbone)​

Cause-and-effect diagrams.

ishikawa
Problem Statement
Category A
Cause 1
Cause 2
Category B
Cause 3

Venn Diagram​

Set relationship diagrams.

venn-beta
title "Team Skills"
set Frontend
set Backend
union Frontend,Backend["Fullstack"]

ZenUML​

Sequence diagrams using ZenUML syntax with participant types.

zenuml
title Service Flow
Actor User
Database API
User->API: Request
API->User: Response

Participant types: Actor, Database, Participant

Railroad​

Syntax/grammar (railroad) diagrams for technical writers and language designers. Ships the EBNF variant — terminals in quotes, | choice, ? optional, * zero-or-more, + one-or-more, ( ) grouping. One rule per statement, each ending with ;.

railroad-ebnf-beta
title "Arithmetic Expression Grammar"

expression = term ( ( "+" | "-" ) term )* ;
term = factor ( ( "*" | "/" ) factor )* ;
factor = number | "(" expression ")" ;
number = digit+ ;
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;

Use Case​

UML use case diagrams with actors, system boundaries, include/extend relationships, generalization, and notes.

usecase-beta
direction LR

actor Customer
actor Admin

systemBoundary Store("Online Store")
UC1("Browse Products")
UC2("Checkout")
end

Customer --> UC1
Customer --> UC2
Admin --> UC2
UC2 ..> : include UC1
Admin --|> Customer

note for UC1 "Available 24/7"

BPMN​

BPMN process notation on a flowchart. Edges use standard flowchart syntax — the full shape catalog is in the example:

flowchart TB
start@{ shape: bpmn-start, label: "Start" }
task@{ shape: bpmn-activity, label: "Do work" }
bound@{ shape: bpmn-boundary, label: "Timeout" }
mid@{ shape: bpmn-intermediate, label: "Message in" }
gw@{ shape: bpmn-gateway, label: "OK?" }
data@{ shape: bpmn-data, label: "Doc" }
store@{ shape: bpmn-data-store, label: "DB" }
ann@{ shape: bpmn-annotation, label: "SLA 24h" }
endN@{ shape: bpmn-end, label: "End" }
start --> task
task -.-> bound
bound -.-> task
task --> mid
mid --> gw
gw -->|yes| endN
gw -->|no| task
task --> data
data --> store
ann -.-> task

Wardley Map​

Wardley strategy maps positioning components on a visibility × evolution grid. The first coordinate is visibility (Y axis, 0 = infrastructure, 1 = user-facing), the second is evolution (X axis, 0 = genesis, 1 = commodity).

wardley-beta
%% coordinates are [visibility, evolution]
title Tea Shop Value Chain

anchor Business [0.95, 0.63]
component Cup of Tea [0.79, 0.61]
component Tea [0.63, 0.81] (build)
component Hot Water [0.52, 0.80]
component Kettle [0.43, 0.35] (buy)
component Power [0.10, 0.70]

%% dependencies point from consumer to dependency
Business -> Cup of Tea
Cup of Tea -> Tea
Cup of Tea -> Hot Water
Hot Water -> Kettle
Kettle -> Power

%% evolution arrows: where a component is heading
evolve Kettle 0.62
evolve Power 0.89

note "Standardising power allows Kettles to evolve faster" [0.30, 0.49]

Other strategy decorators: (outsource), (market), (inertia) — same placement as (build)/(buy).

Event Modeling​

Event modeling flows on an inferred swimlane timeline (UI/Automation, Command/Read Model, Events). Time frames are numbered and fully connected by default inference.

eventmodeling

tf 01 ui CartUI
tf 02 cmd AddItem
tf 03 evt ItemAdded
tf 04 rmo CartItems
%% pcr = processor, lands in the Command/Read Model lane
tf 05 pcr NotifyWarehouse
%% rf = reset frame, breaks automatic inference between frames
rf 06 ui ReturnUI

Animated Flow​

A flowchart whose edges play in order with a traveling dot (new in Mermaid 12.3). Edges highlight and animate sequentially in the preview and on the page. Readers with reduced-motion preferences see a static diagram automatically.

---
config:
flowchart:
stepDuration: 1000 # optional: pace, ms per step
---
flowchart LR
%% name each edge with an id: nodeId@-->
Requester e1@--> Approval
Approval e2@--> Finance
Finance e3@-->|approved| Payment
Payment e4@--> Requester
%% set the play order of each edge
e1@{ step: 1 }
e2@{ step: 2 }
e3@{ step: 3 }
e4@{ step: 4 }

Agent Flow​

Agentic workflow diagrams (agentflow-beta). Good for documenting AI agents, RAG pipelines and automation hand-offs.

agentflow-beta TB
%% one flow block per agent; type steps as input / task / tool
flow reviewer["Review Agent"]
changes["Gather changes"]@{ shape: input }
analyse["Analyse"]@{ shape: task }
lint["run_linter"]@{ shape: tool }
changes --> analyse --> lint
end
%% external systems the agent calls; edges and labels are plain flowchart
connector ext["External system"]
reviewer -->|approved| ext

Rovo AI Agent​

The app ships a Rovo agent that works with diagrams on Confluence pages and blog posts. Open the agent chat and ask in plain language:

CapabilityExample promptWhat happens
Create"Make a flowchart of our deployment process"A rendered diagram is added in place
Read"What does this diagram show?"The diagram source and version come back in chat
Update"Make this better"The diagram is revised in place — macro settings are preserved
Convert"Turn this into a diagram"Code blocks already on the page become rendered diagrams

The agent edits the same macros you would edit by hand, so anything it changes stays a normal, re-editable diagram.


Use with Any AI Client (MCP)​

The app exposes its four diagram tools as an MCP (Model Context Protocol) server, so they work in two more places beyond the built-in Rovo agent:

  1. Rovo Studio agents you build yourself — in Rovo Studio, create an agent, choose Add tools → Connected apps, and add the four Mermaid Plus tools. Combine them with other apps' tools in one agent.

  2. Third-party MCP clients — Claude Code, Cursor, and any MCP-compatible client can connect directly to the app's MCP endpoint:

    https://mcp.atlassian.com/forge/0ddaf927-b00c-4186-8b1a-490be0cb7b69

    This requires the admin setup below (once per site), then each user connects their own client — see the Claude Code walkthrough.

Admin setup: expose the tools (required for third-party clients)​

External MCP access is disabled by default — until a site or org admin turns it on, clients can authenticate but will not see the diagram tools. It is a one-time step per site:

  1. Sign in to admin.atlassian.com as a site or organization admin and open your organization.
  2. Go to Apps → Sites and select your site (e.g. your-site.atlassian.net).
  3. Open Connected apps and select Mermaid Plus Diagrams & AI Agent for Confluence.
  4. In the app details, find Tools and switch on the four diagram tools, then save.

Good to know:

  • The toggle is per site — enabling it on one site does not expose the tools on any other site.
  • The built-in Rovo agent in Confluence chat does not need this toggle; it works with no admin setup at all.
  • Each user still connects and approves their own client through OAuth — the admin toggle only makes the tools visible to connect, it does not grant anyone access by itself.

Example: connect Claude Code​

Once the admin setup above is done, in a terminal:

# 1. Register the MCP server. --scope user makes it available in every
# project; without it, Claude Code registers it for the current project only.
claude mcp add --scope user --transport http mermaid-plus \
https://mcp.atlassian.com/forge/0ddaf927-b00c-4186-8b1a-490be0cb7b69

# 2. Confirm it is registered
claude mcp list
# mermaid-plus: https://mcp.atlassian.com/forge/0ddaf927-… - ! Needs authentication
  1. Start claude and run /mcp, select mermaid-plus, choose Authenticate. A browser opens the Atlassian OAuth 2.1 consent screen — sign in, select your site, and approve.
  2. claude mcp list should now show ✔ Connected. Try a real prompt:

Read the Mermaid diagram on https://your-site.atlassian.net/wiki/spaces/TEAM/pages/123456789/Architecture and suggest a clearer layout

Notes learned the hard way:

  • Until the OAuth step is done, the server shows ! Needs authentication and non-interactive Claude runs skip it silently — always check claude mcp list first.
  • There is no open-page context over MCP, so point the client at the page URL (or its numeric ID) in your prompt.
  • Cursor and other MCP clients: add the same URL as a remote (HTTP) MCP server; the OAuth flow works the same way.

The four MCP tools​

ToolWhat it doesKey inputs via MCP
create-diagramRenders a Mermaid diagram onto a page/blogpost, or creates a new page with itdiagramCode; to append to an existing page pass contentId; for a new page pass spaceKey and pageTitle
get-diagramReads the diagram source and version from a pagecontentId; add diagramIndex when the page has several diagrams
update-diagramReplaces the diagram source on a page (version-checked write)diagramCode, contentId; add diagramIndex when the page has several diagrams
convert-diagramTurns Mermaid code blocks on a page into rendered diagrams, in placecontentId

A page can hold multiple Mermaid+ diagrams (hand-inserted macros, converted blocks). When get-diagram finds several and no diagramIndex is given, it returns their numbered list (index, type, one-line preview) instead of code — pick one, then pass its diagramIndex (1-based) to read or update it. update-diagram refuses to guess: with several diagrams present and no index, it returns an error asking for one.

In Rovo chat the page/space context is picked up automatically. Via MCP there is no page context — pass the numeric ID from the Confluence page URL (e.g. …/pages/123456789/Title → contentId: "123456789") or the space key explicitly.

All tools run with your own Confluence permissions and respect version locking, so agent edits through MCP are as safe as edits through the Rovo agent or the editor.


Tips​

  • Use the Syntax Guide (Help button) to quickly find the right syntax for any diagram type
  • Start with a Quick Template and modify it to fit your needs
  • Use Dark or Forest themes for diagrams in dark-themed Confluence spaces
  • Adjust Output Size to control how large the diagram appears on the page
  • All settings are preserved when you re-edit an existing diagram

Performance​

Diagrams render instantly on page load using cached SVG. The Mermaid.js library is only loaded during configuration — not when viewing pages. This keeps your Confluence pages fast.


Migrating from Other Mermaid Apps​

Already have diagrams created with Stratus, Mermaid Chart, the Atlassian Labs viewer, weweave or Tech Labs apps? The built-in Migration page (Confluence → Apps → Mermaid+ Migration, administrators) scans a space and converts those diagrams into rendered Mermaid+ diagrams in place — see Migrating from Other Mermaid Apps.

Support​

For issues or feature requests, please visit the app's listing on the Atlassian Marketplace.

Was this helpful?