Documentation
Wire itinto your AI
Three sections. A minute or two of reading. You'll have Claude, ChatGPT, or Cursor reading and writing diagrams in your space.
Quickstart
- 1
- 2
Create an API token
Open /app/settings/tokens and generate one. Copy it immediately — you won't see it again.
- 3
Add to your AI tool
Drop the snippet below into your Claude / Cursor / ChatGPT config.
MCP setup
diagramzu speaks the Model Context Protocol. Any MCP client — Claude Code, Cursor, custom GPTs — can read and write your diagrams.
Find your Space ID — Open the API tokens page once you've signed in — your active space's ID appears next to the heading, ready to copy.
Claude Code
Run this in your terminal. Replace the dz_live_ and org_ values.
claude mcp add diagramzu \
--env DIAGRAMZU_BASE_URL=https://diagramzu.ai \
--env DIAGRAMZU_API_TOKEN=dz_live_xxx \
--env DIAGRAMZU_SPACE_ID=org_xxx \
-- node /absolute/path/to/packages/mcp-diagramzu/dist/index.jsClaude 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.
{
"mcpServers": {
"diagramzu": {
"command": "node",
"args": ["/absolute/path/to/packages/mcp-diagramzu/dist/index.js"],
"env": {
"DIAGRAMZU_BASE_URL": "https://diagramzu.ai",
"DIAGRAMZU_API_TOKEN": "dz_live_xxx",
"DIAGRAMZU_SPACE_ID": "org_xxx"
}
}
}
}Cursor
Edit ~/.cursor/mcp.json and restart Cursor.
{
"mcpServers": {
"diagramzu": {
"command": "node",
"args": ["/absolute/path/to/packages/mcp-diagramzu/dist/index.js"],
"env": {
"DIAGRAMZU_BASE_URL": "https://diagramzu.ai",
"DIAGRAMZU_API_TOKEN": "dz_live_xxx",
"DIAGRAMZU_SPACE_ID": "org_xxx"
}
}
}
}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).
# 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>Endpoints.
| Method | Path | Description |
|---|---|---|
| GET | /api/spaces/[spaceId]/diagrams | List diagrams in the space. |
| POST | /api/spaces/[spaceId]/diagrams | Create a diagram. |
| GET | /api/spaces/[spaceId]/diagrams/[id] | Fetch a single diagram. |
| PATCH | /api/spaces/[spaceId]/diagrams/[id] | Update title or code. |
| DELETE | /api/spaces/[spaceId]/diagrams/[id] | Delete a diagram. |
| GET | /api/spaces/[spaceId]/tokens | List API tokens (no secrets). |
| POST | /api/spaces/[spaceId]/tokens | Create token — secret returned ONCE. |
| DELETE | /api/spaces/[spaceId]/tokens/[id] | Revoke a token. |