Connect your AI to DiagramZu

Wire up Claude, Cursor, or any MCP client, then drive your diagrams straight from the agent — concepts, a three-step quickstart, and the full tool and REST reference.

New to DiagramZu? Start with the five concepts →

01

Quickstart

Three steps to get your AI talking to DiagramZu.

STEP 01

Sign up

Create your space and invite teammates.

STEP 02

Create an API token

Open /app/settings/tokens and generate one. Copy it immediately — you won't see it again.

STEP 03

Add to your AI tool

Drop the snippet below into your Claude / Cursor / ChatGPT config.

02

MCP setup

DiagramZu exposes 14 tools over HTTP transport — read, write, and analysis primitives across diagrams, folders, version history, decks, and comments. 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 drops straight into the snippets 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.

JSON
{
  "mcpServers": {
    "diagramzu": {
      "type": "http",
      "url": "https://mcp.diagramzu.ai/mcp",
      "headers": {
        "Authorization": "Bearer dz_live_xxx"
      }
    }
  }
}

Cursor

Edit ~/.cursor/mcp.json and restart Cursor.

JSON
{
  "mcpServers": {
    "diagramzu": {
      "type": "http",
      "url": "https://mcp.diagramzu.ai/mcp",
      "headers": {
        "Authorization": "Bearer dz_live_xxx"
      }
    }
  }
}

Tool reference

READ TOOLS
list_diagrams

Find diagrams in the Space.

When Call before create_diagram to avoid duplicating an existing named diagram, or after to land on the latest match.

Example
{
  "query": "DB schema",
  "sortBy": "updatedAt",
  "sortDir": "desc"
}
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.

Example
{
  "diagramId": "dgm_abc123",
  "versionId": "ver_xyz789"
}
WRITE TOOLS
create_diagram

Create a diagram in the Space.

When Always write a description first — it becomes the agent brief for future calls. Set folderId to file the diagram under a human-managed folder.

Example
{
  "title": "User signup flow",
  "description": "Auth path from /signup → verify → first login.",
  "code": "graph TD; A-->B-->C",
  "folderId": "fld_..."
}
update_diagram

Update an existing diagram's title, description, code, or styleOptions.

When Pass createVersion: true when the change is meaningful — your future self will want a restore point. versionLabel is shown in the history drawer.

Example
{
  "id": "dgm_abc123",
  "code": "graph LR; A-->B-->C-->D",
  "createVersion": true,
  "versionLabel": "added retry path"
}
ANALYSIS
analyze_diagram

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 presentation order. Returns the present URL to share.

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.

Example
{
  "id": "dck_abc123",
  "slides": ["dgm_context", "dgm_dataflow", "dgm_deploy", "dgm_appendix"]
}
COMMENTS
list_comments

List comments on a diagram, oldest first.

When Pass nodeId to read just one node's thread; resolved threads are included unless you set includeResolved: false.

Example
{
  "diagramId": "dgm_abc123",
  "includeResolved": false
}
add_comment

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."
}
03

REST API

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
curl · update
# Update a diagram
curl -X PATCH -H "Authorization: Bearer $DIAGRAMZU_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"code":"graph LR; A-->B-->C"}' \
  https://diagramzu.ai/api/spaces/$SPACE_ID/diagrams/<DIAGRAM_ID>
DIAGRAMS
MethodPathDescription
GET
/api/spaces/[spaceId]/diagramsList diagrams. Same filters as list_diagrams.
POST
/api/spaces/[spaceId]/diagramsCreate a diagram.
GET
/api/spaces/[spaceId]/diagrams/[id]Fetch one diagram.
PATCH
/api/spaces/[spaceId]/diagrams/[id]Update title, code, description, or styleOptions.
DELETE
/api/spaces/[spaceId]/diagrams/[id]Delete a diagram.
GET
/api/spaces/[spaceId]/diagrams/[id]/thumbnailRendered thumbnail.
GET
/api/spaces/[spaceId]/diagrams/[id]/analysisStructural analysis (same as analyze_diagram).
GET
/api/spaces/[spaceId]/diagrams/[id]/embed-statsEmbed load count for the active share (last 7 days).
POST
/api/spaces/[spaceId]/diagrams/export/pngRender arbitrary Mermaid code to PNG.
FOLDERS
MethodPathDescription
GET
/api/spaces/[spaceId]/foldersList folders.
POST
/api/spaces/[spaceId]/foldersCreate a folder.
PATCH
/api/spaces/[spaceId]/folders/[id]Rename or reparent a folder.
DELETE
/api/spaces/[spaceId]/folders/[id]Delete a folder.
VERSIONS
MethodPathDescription
GET
/api/spaces/[spaceId]/diagrams/[id]/versionsList versions, newest first.
POST
/api/spaces/[spaceId]/diagrams/[id]/versionsSnapshot the current state.
GET
/api/spaces/[spaceId]/diagrams/[id]/versions/[vid]Fetch one version.
POST
/api/spaces/[spaceId]/diagrams/[id]/versions/[vid]/restoreRestore a version (auto-snapshots first).
POST
/api/spaces/[spaceId]/diagrams/[id]/versions/[vid]/forkFork a version into a new diagram.
DECKS
MethodPathDescription
GET
/api/spaces/[spaceId]/decksList decks. Same as list_decks.
POST
/api/spaces/[spaceId]/decksCreate a deck from an ordered list of diagram ids.
GET
/api/spaces/[spaceId]/decks/[id]Fetch one deck with its ordered slides.
PATCH
/api/spaces/[spaceId]/decks/[id]Update title, description, or slide order.
DELETE
/api/spaces/[spaceId]/decks/[id]Delete a deck.
COMMENTS
MethodPathDescription
GET
/api/spaces/[spaceId]/diagrams/[id]/commentsList comments. Same as list_comments.
POST
/api/spaces/[spaceId]/diagrams/[id]/commentsPost a comment (optionally pinned to a node).
PATCH
/api/spaces/[spaceId]/diagrams/[id]/comments/[cid]Edit a comment body.
DELETE
/api/spaces/[spaceId]/diagrams/[id]/comments/[cid]Delete a comment.
POST
/api/spaces/[spaceId]/diagrams/[id]/comments/[cid]/resolveResolve or reopen a comment thread.
SHARES
MethodPathDescription
GET
/api/spaces/[spaceId]/diagrams/[id]/sharesList active share links.
POST
/api/spaces/[spaceId]/diagrams/[id]/sharesMint a new share link.
DELETE
/api/spaces/[spaceId]/diagrams/[id]/shares/[shareId]Revoke a share link.
GET
/api/public/share/[slug]Public read endpoint (no auth).
TOKENS
MethodPathDescription
GET
/api/spaces/[spaceId]/tokensList API tokens (no secrets).
POST
/api/spaces/[spaceId]/tokensCreate a token. Secret returned ONCE.
DELETE
/api/spaces/[spaceId]/tokens/[id]Revoke a token.
04

Embed a diagram

Mint a share link, open the Embed tab, and copy the snippet — or build it yourself. Paste it into any page that allows iframes.

Paste into any page
<iframe src="https://diagramzu.ai/embed/your-diagram" width="100%" height="480" style="border:0;border-radius:8px" loading="lazy" title="diagramzu diagram"></iframe>

URL options

ParameterValuesDefaultEffect
themelight dark autoautoColor theme of the rendered diagram. auto follows the viewer's operating system.
bgtransparent white paper ink-tint darktransparentBackground behind the diagram. transparent lets the host page's color show through.
fittrue falsetrueZoom the diagram to fit the frame on load. Set false to render at its natural size.
badgetrue falsetrueShow the small "diagramzu" link in the corner. Set false to hide it.