Install the MCP server, mint a token (or use the Claude connector), then your agent writes Mermaid to a URL your team can open. Quickstart, tool reference, and REST.
Drop the snippet below into your Claude / Cursor / ChatGPT config.
02
MCP setup
DiagramZu exposes fourteen tools over HTTP transport — search, create, read, and update diagrams, browse folders, trace version history, build decks, leave comments, and analyze a diagram for issues. Install once, then your agent works them all directly.
One-click connect — Claude
In Claude, open Settings → Connectors → Add custom connector, paste https://mcp.diagramzu.ai/mcp, and authorize with your DiagramZu account. No API token to copy.
Using Cursor, ChatGPT, a script, or another MCP client? Use the API-token setup below — it works everywhere.
Install
Sign in and your token is filled into every snippet below.
Claude Code
Run this in your terminal. Replace dz_live_xxx with your API token.
Bash
claude mcp add --scope user --transport http diagramzu https://mcp.diagramzu.ai/mcp \
--header "Authorization: Bearer dz_live_xxx"
Claude Desktop
Edit your Claude config (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json) and restart the app.
When Call before create_diagram to avoid duplicating an existing named diagram — pass q to search title, description, or code. After creating, list again to land on the latest match.
Example
{
"q": "DB schema",
"sort": "relevance"
}
list_folders
List folders in the Space.
When Call when you might place a new diagram somewhere specific. If a folder named "Infra" or "Schema" exists, prefer it over the root.
Example
{}
get_diagram
Fetch one diagram by id, including the description.
When Read the description as the brief before deciding what to change.
Example
{
"id": "dgm_abc123"
}
list_versions
List a diagram's manual snapshots, newest first.
When Use before a risky overwrite to know what restore points exist.
Example
{
"diagramId": "dgm_abc123"
}
get_version
Fetch one historical version of a diagram.
When Read a past snapshot to understand how the diagram evolved or to recover content the live version no longer has.
Return a structural critique of a diagram — orphan nodes, high-degree hubs, cycles, disconnected components.
When Use before simplifying a complex diagram, or as a sanity check that your generated code produces a clean graph.
Example
{
"id": "dgm_abc123"
}
DECKS
list_decks
List presentation decks in the Space, newest-edited first.
When Call before create_deck to extend an existing deck instead of duplicating it.
Example
{}
get_deck
Fetch one deck by id, with its ordered slides.
When Read the slide order and titles before reordering or adding slides with update_deck.
Example
{
"id": "dck_abc123"
}
create_deck
Assemble existing diagrams into an ordered slideshow deck.
When Create the slide diagrams first, collect their ids, then pass them in slide order. The URL it returns opens the deck for space members only — to show it to anyone outside the Space, open the deck and create a public link from its Share button.
Example
{
"title": "System architecture walkthrough",
"description": "Read in order: context → data flow → deploy.",
"slides": ["dgm_context", "dgm_dataflow", "dgm_deploy"]
}
update_deck
Change a deck's title, description, or slide order.
When slides is declarative — send the complete desired list of diagram ids; any id you omit is removed, new ids are appended.
Post a comment on a diagram, optionally pinned to a node.
When Leave structured review findings a human will see on the diagram. Pin to a node with nodeId, or reply to a thread with parentId.
Example
{
"diagramId": "dgm_abc123",
"nodeId": "PaymentService",
"body": "This should call the retry queue, not the DB directly."
}
PAGES
list_pages
List the Space's Markdown pages, with id, title, revision and a snippet of each.
When Before writing a new page, to see whether one on the topic already exists. Filter with q — it searches title and body, CJK included.
Example
{
"q": "deployment",
"sort": "relevance"
}
get_page
Fetch one page: its Markdown body, its revision, and its language.
When Read a page before editing it — the revision it returns is what baseRevision needs. On a long document ask for the outline first, then one section, rather than pulling the whole text into context.
Example
{
"id": "pg_abc123",
"outline": true
}
create_page
Create a Markdown page. Its title comes from the body's front matter, or from the body's first heading.
When For the prose a diagram cannot carry — the decision, the trade-offs, the rollout. Embed a stored diagram by id in a diagramzu fenced block so the page always shows its current state. The URL it returns opens for Space members only — to show it to anyone outside the Space, open the page and create a public link from its Share button.
Example
{
"body": "# Deployment plan\n\nRender service first, then go-api.\n\n```diagramzu\ndgm_abc123\n```\n"
}
update_page
Edit a page with targeted edits, or replace the whole body with baseRevision plus body.
When Pass exactly one of the two modes. Prefer edits: each oldText must match exactly once, and the rest of the document is left untouched. If somebody edits the page before your write lands, your edits are re-applied on top of their text — and the call is refused outright if they changed the very span you were editing.
Every request authenticates with a Bearer token. The base URL is https://diagramzu.ai. Replace $SPACE_ID with your space's ID (visible in the URL when you're inside the app).
Endpoints
curl · list
# List diagrams in your Space
curl -H "Authorization: Bearer $DIAGRAMZU_TOKEN" \
https://diagramzu.ai/api/spaces/$SPACE_ID/diagrams
curl · create
# Create a new diagram
curl -X POST -H "Authorization: Bearer $DIAGRAMZU_TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"My diagram","code":"graph TD; A-->B"}' \
https://diagramzu.ai/api/spaces/$SPACE_ID/diagrams