list_diagramsFind diagrams in the Space.
When Call before create_diagram to avoid duplicating an existing named diagram, or after to land on the latest match.
{
"query": "DB schema",
"sortBy": "updatedAt",
"sortDir": "desc"
}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.
Three steps to get your AI talking to DiagramZu.
Create your space and invite teammates.
Open /app/settings/tokens and generate one. Copy it immediately — you won't see it again.
Drop the snippet below into your Claude / Cursor / ChatGPT config.
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.
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.
Sign in and your token drops straight into the snippets below.
Run this in your terminal. Replace dz_live_xxx with your API token.
claude mcp add --scope user --transport http diagramzu https://mcp.diagramzu.ai/mcp \
--header "Authorization: Bearer dz_live_xxx"Edit your Claude config (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json) and restart the app.
{
"mcpServers": {
"diagramzu": {
"type": "http",
"url": "https://mcp.diagramzu.ai/mcp",
"headers": {
"Authorization": "Bearer dz_live_xxx"
}
}
}
}Edit ~/.cursor/mcp.json and restart Cursor.
{
"mcpServers": {
"diagramzu": {
"type": "http",
"url": "https://mcp.diagramzu.ai/mcp",
"headers": {
"Authorization": "Bearer dz_live_xxx"
}
}
}
}list_diagramsFind diagrams in the Space.
When Call before create_diagram to avoid duplicating an existing named diagram, or after to land on the latest match.
{
"query": "DB schema",
"sortBy": "updatedAt",
"sortDir": "desc"
}list_foldersList 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.
{}get_diagramFetch one diagram by id, including the description.
When Read the description as the brief before deciding what to change.
{
"id": "dgm_abc123"
}list_versionsList a diagram's manual snapshots, newest first.
When Use before a risky overwrite to know what restore points exist.
{
"diagramId": "dgm_abc123"
}get_versionFetch 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.
{
"diagramId": "dgm_abc123",
"versionId": "ver_xyz789"
}create_diagramCreate 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.
{
"title": "User signup flow",
"description": "Auth path from /signup → verify → first login.",
"code": "graph TD; A-->B-->C",
"folderId": "fld_..."
}update_diagramUpdate 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.
{
"id": "dgm_abc123",
"code": "graph LR; A-->B-->C-->D",
"createVersion": true,
"versionLabel": "added retry path"
}analyze_diagramReturn 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.
{
"id": "dgm_abc123"
}list_decksList presentation decks in the Space, newest-edited first.
When Call before create_deck to extend an existing deck instead of duplicating it.
{}get_deckFetch one deck by id, with its ordered slides.
When Read the slide order and titles before reordering or adding slides with update_deck.
{
"id": "dck_abc123"
}create_deckAssemble 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.
{
"title": "System architecture walkthrough",
"description": "Read in order: context → data flow → deploy.",
"slides": ["dgm_context", "dgm_dataflow", "dgm_deploy"]
}update_deckChange 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.
{
"id": "dck_abc123",
"slides": ["dgm_context", "dgm_dataflow", "dgm_deploy", "dgm_appendix"]
}list_commentsList 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.
{
"diagramId": "dgm_abc123",
"includeResolved": false
}add_commentPost 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.
{
"diagramId": "dgm_abc123",
"nodeId": "PaymentService",
"body": "This should call the retry queue, not the DB directly."
}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).
# List diagrams in your Space
curl -H "Authorization: Bearer $DIAGRAMZU_TOKEN" \
https://diagramzu.ai/api/spaces/$SPACE_ID/diagrams# 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# 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>| Method | Path | Description |
|---|---|---|
GET | /api/spaces/[spaceId]/diagrams | List diagrams. Same filters as list_diagrams. |
POST | /api/spaces/[spaceId]/diagrams | Create 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]/thumbnail | Rendered thumbnail. |
GET | /api/spaces/[spaceId]/diagrams/[id]/analysis | Structural analysis (same as analyze_diagram). |
GET | /api/spaces/[spaceId]/diagrams/[id]/embed-stats | Embed load count for the active share (last 7 days). |
POST | /api/spaces/[spaceId]/diagrams/export/png | Render arbitrary Mermaid code to PNG. |
| Method | Path | Description |
|---|---|---|
GET | /api/spaces/[spaceId]/folders | List folders. |
POST | /api/spaces/[spaceId]/folders | Create a folder. |
PATCH | /api/spaces/[spaceId]/folders/[id] | Rename or reparent a folder. |
DELETE | /api/spaces/[spaceId]/folders/[id] | Delete a folder. |
| Method | Path | Description |
|---|---|---|
GET | /api/spaces/[spaceId]/diagrams/[id]/versions | List versions, newest first. |
POST | /api/spaces/[spaceId]/diagrams/[id]/versions | Snapshot the current state. |
GET | /api/spaces/[spaceId]/diagrams/[id]/versions/[vid] | Fetch one version. |
POST | /api/spaces/[spaceId]/diagrams/[id]/versions/[vid]/restore | Restore a version (auto-snapshots first). |
POST | /api/spaces/[spaceId]/diagrams/[id]/versions/[vid]/fork | Fork a version into a new diagram. |
| Method | Path | Description |
|---|---|---|
GET | /api/spaces/[spaceId]/decks | List decks. Same as list_decks. |
POST | /api/spaces/[spaceId]/decks | Create 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. |
| Method | Path | Description |
|---|---|---|
GET | /api/spaces/[spaceId]/diagrams/[id]/comments | List comments. Same as list_comments. |
POST | /api/spaces/[spaceId]/diagrams/[id]/comments | Post 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]/resolve | Resolve or reopen a comment thread. |
| Method | Path | Description |
|---|---|---|
GET | /api/spaces/[spaceId]/diagrams/[id]/shares | List active share links. |
POST | /api/spaces/[spaceId]/diagrams/[id]/shares | Mint 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). |
| Method | Path | Description |
|---|---|---|
GET | /api/spaces/[spaceId]/tokens | List API tokens (no secrets). |
POST | /api/spaces/[spaceId]/tokens | Create a token. Secret returned ONCE. |
DELETE | /api/spaces/[spaceId]/tokens/[id] | Revoke a token. |
Mint a share link, open the Embed tab, and copy the snippet — or build it yourself. Paste it into any page that allows iframes.