Draft Canvas Open editor
Connect an AI agentAll docs

Connect an AI agent

Draft Canvas Desktop can let a coding agent on your computer — Claude Code, Cursor, or any other agent that speaks MCP (the Model Context Protocol) — draw diagrams for you. Ask your agent to "draw how orders flow through this service". It reads your code, then hands Draft Canvas a description: the parts, how they connect, the flows. Draft Canvas lays it out and draws it as an ordinary diagram you can edit, move, present and export like one you drew yourself.

The agent never places anything by coordinates, and never touches a file outside the folders you allow. Draft Canvas doesn't send your diagrams anywhere. Your agent does send what it reads and writes to its own AI provider, as it does with your code.

This needs the desktop app, on macOS or Windows. The web app opens the diagrams it makes, but agents can't reach it.

Turn it on#

  1. On Home, choose Connect an agent… under More ways in — or open Settings (⌘, / Ctrl+,, or from the tray menu) and choose AI agents. While access is on, the status bar says so and how many agents are connected; off, nothing about agents is on screen.
  2. Turn on Allow agent access.
  3. Tick each project folder an agent may use. A folder appears here once you have opened it in Draft Canvas. Agents can list, read, create and change diagrams only in the folders you tick — and in everything inside them, so a ticked folder already covers the folders listed under it.
  4. Under Connect an agent, pick your agent and follow its setup:
    • Claude Code: run the copied command, for example claude mcp add draft-canvas -- "/Applications/Draft Canvas.app/Contents/MacOS/draft-canvas-mcp".
    • Cursor: click Add to Cursor — it opens Cursor and adds Draft Canvas to its MCP configuration for you. If nothing opens (no cursor:// links registered, or you'd rather add it to a project's own configuration first), use Copy the config instead and paste it into ~/.cursor/mcp.json, or a project's .cursor/mcp.json.
    • Other MCP clients: add the copied mcpServers entry to the agent's MCP configuration.

Draft Canvas must be running while the agent works: the connector talks to the running app. It doesn't start the app for you, and it says so if the app isn't open.

What the agent can do#

An example#

You: Draw this architecture: a web storefront calls the Orders API, which writes to Postgres and publishes OrderPlaced to a topic feeding a billing queue and a notifications queue.

The agent creates one diagram and keeps its id.

You: Add a dead-letter queue for billing and explain the retry behaviour in a note.

Same diagram: the queue is placed beside billing, the note beside the queue.

You: Add a flow for the normal processing path.

Same diagram: a flow over the connectors already there.

You: Clean up the arrows and spacing.

Same diagram, re-arranged in place: the main path straight, the dead-letter path off to the side.

Watching it work#

A request that takes more than a moment shows a line above the status bar — "AI agent Drawing Checkout — Routing connections…" — with Cancel. Quick ones just appear finished.

Nothing you see while an agent works is saved or undoable until it is actually applied.

Reviewing a proposal#

When you ask an agent to review a change against a diagram rather than apply it directly, it submits a proposal instead — Draft Canvas never fetches or reads the pull request itself, only the structured description of the change the agent sends. A small N proposal(s) to review button appears over the diagram; click it to open the review panel.

The panel leads with the agent's summary, a status, and how many things it adds, changes and removes; its reasoning, assumptions and open questions sit underneath, collapsed until you want them. The proposed change also appears right on the canvas — additions and modifications as a dashed outline, removals crossed out where they stand — with a legend, a toggle to hide it without losing your place, and a Focus changes button that pans to it. The panel still lists every addition, modification and removal on its own, apart from each other, and for a modification the actual before and after values, not just a highlighted shape — a canvas outline alone can't show a renamed relationship or a changed label. Accept applies the whole thing as one ordinary undo step (⌘Z / Ctrl+Z reverts it exactly like any other edit); Reject and Dismiss leave the diagram untouched. There is no partial accept — if you want a smaller change, ask the agent to revise the proposal, which updates the same one in place rather than creating a second.

If the diagram changed elsewhere since the proposal was written, a note says so but doesn't block Accept; if something the proposal is specifically about changed — a renamed element, a moved connector — Accept is disabled until the agent revises it. A proposal survives a restart: if Draft Canvas quit mid-accept, the next time you look at it either picks up where it left off (offering Accept again) or, if it can tell the change already landed, offers Mark as applied instead — a record-keeping click, not a second attempt to apply it.

Saving#

An agent's change is saved for you only when the document had no unsaved changes of your own. If you were in the middle of something, the change is applied in the editor and left for you to save with yours; the recovery copy keeps it safe meanwhile. The agent is told which of the two happened.

If you edit while an agent is preparing a change, your edit wins: the agent is told the diagram changed, and has to read it again before retrying.

While the window is hidden#

On macOS 14 and later, agents can keep working while Draft Canvas sits in the menu bar with its window closed. If you turn access on while the app is running, restart it once for that to take effect; Settings says so.

On macOS 12 and 13, and on Windows, keep the Draft Canvas window open while an agent works. A hidden window may be paused by the system, and the agent is then told the app isn't responding. Nothing is changed in that case.

Stopping an agent#

When something goes wrong#

For agent authors#

The tool definitions an agent sees are generated from the app's own source, so they say exactly what the app accepts:

For how it works — the protocol, the guarantees about retries, what is and isn't supported — see Agent integration.

What was actually tested#

Claude Code on macOS is exercised end-to-end for the create/update/read tool path (the existing agent test suite, e2e/agent-conversations.ts/e2e/agent-scenarios.ts against a real sidecar and a real client). The proposal review panel's own round of fixes — the canvas ghost, the legend and visibility toggle, "Focus changes", the crash-recovery "Mark as applied" path, and the nested-view review fix — were verified as real browser exercises of the actual rendering, store and commit code (e2e/desktop/proposal-review.spec.ts), driven by fixture proposals injected directly into the review store rather than by a live submit_proposal MCP call from an agent. That is a deliberate substitute, not an oversight — it reaches the same panel, ghost-rendering and applyToFile code a real proposal would — but a genuine agent-driven submit_proposal → review → Accept round trip through a real sidecar has not been run in this environment; treat the review UI as verified in isolation, the MCP plumbing it's fed by as verified separately (Rust and TypeScript unit tests for validation, staleness, conflicts and the crash-recovery state machine), and the two joined together as the one remaining gap. Cursor's setup is verified for correctness — the deeplink's config payload and the pasted-config fallback are unit-tested to decode to the exact same server definition, and the cursor:// URL and ~/.cursor/mcp.json shape match Cursor's own published format — but connecting a real Cursor install to Draft Canvas has not been run in this environment; treat it as configuration-verified, not as a tested connection, until it's been tried against an actual Cursor. Windows and Linux are untested for every client in this round, same as before it.