# Draw diagrams over MCP

## Agent prompt

```text
Help me use Slatebox as the MCP diagram server for my agent. Find out which MCP client I use and connect it to https://app.slatebox.com/mcp (or /mcp on my own Slatebox) with OAuth sign-in, or a personal token from my secret store if the client has no sign-in. Then list the diagram tools, draw one small flowchart with import_mermaid, read it back with export_mermaid, and give me the slate link. Never ask me to paste a token into chat.

Read https://docs.slatebox.com/Developers/SlateboxAPI/mcp-diagram-server.md first. Ask for the inputs you need. Tell me what you verified and which steps I still need to do.

If your client cannot fetch the documentation, read the same published file at https://raw.githubusercontent.com/Slatebox/slatebox-docs/retype/Developers/SlateboxAPI/mcp-diagram-server.md.
```

Slatebox is a free, open-source MCP server for diagrams. Connect any agent to `https://app.slatebox.com/mcp` and it draws flowcharts, mind maps, project plans and architecture diagrams as real notes and lines on a slate. People edit the same slate with the agent, live, and the agent reads it back as Mermaid.

## Connect

| Setting | Value |
| --- | --- |
| Server URL | `https://app.slatebox.com/mcp`, or `/mcp` on your own Slatebox |
| Transport | Streamable HTTP |
| Sign-in | OAuth 2.1 with dynamic client registration, or a personal token as a bearer token |

Most clients take this:

<!-- tabs -->

```json JSON
{
  "mcpServers": {
    "slatebox": {
      "url": "https://app.slatebox.com/mcp"
    }
  }
}
```

<!-- /tabs -->

A client without sign-in sends a personal token from **Profile → Developer access**:

<!-- tabs -->

```json JSON
{
  "mcpServers": {
    "slatebox": {
      "type": "http",
      "url": "https://app.slatebox.com/mcp",
      "headers": { "Authorization": "Bearer ${SLATEBOX_API_TOKEN}" }
    }
  }
}
```

<!-- /tabs -->

Steps for Claude, Claude Code, ChatGPT and Cursor: [Use Slatebox from your agent](../../Using-Slatebox/use-from-your-agent.md)

## The diagram tools

| Tool | Does |
| --- | --- |
| `import_mermaid` | Draw Mermaid (a flowchart, mind map or Gantt chart) as editable notes and lines, on a new slate or beside what a slate holds |
| `import_diagram` | Draw a draw.io, Visio, Lucidchart, Excalidraw, tldraw, Graphviz, PlantUML, XMind, FreeMind or OPML file as notes, lines and frames |
| `create_slate` | Make a flowchart from steps written as `A -> B`, or a decision map from a one-line question |
| `edit_slate` | Add, change, connect, lay out or remove notes and lines; `mode: "preview"` saves nothing |
| `get_slate` | Read a slate's notes, lines, boards, comments and revision |
| `export_mermaid` | Read a slate as Mermaid text, to commit or hand to another tool |
| `show_slate` | Show the slate inside the conversation, in clients that show apps |
| `draw_security_slate` | Draw a threat model with STRIDE prompts, or a component architecture from a repository's model |
| `create_presentation` | Plan a presentation of a slate. Uses Slatebox's agent |

`exec` and `describe` are always listed too: `exec` runs a short script against the typed client, so one call can read a slate, decide and save. Every tool: [What your assistant gets](mcp.md#what-your-assistant-gets)

## Draw, then read it back

Ask your agent “Draw our checkout flow as a flowchart.” It calls `import_mermaid`:

<!-- tabs -->

```json JSON
{
  "name": "import_mermaid",
  "arguments": {
    "name": "Checkout flow",
    "mermaid": "flowchart LR\n  Cart --> Pay\n  Pay -->|declined| Retry\n  Pay -->|approved| Receipt"
  }
}
```

<!-- /tabs -->

You get a new private slate with four notes and three lines, and its link. Open it and share it: teammates move and rename the notes while the agent works. Later, `export_mermaid` returns the slate as it is now, with their changes.

The same in one exec script, which draws and reads back in one call:

<!-- tabs -->

```js JavaScript
const drawn = await slatebox.slates.importMermaid({
  name: "Checkout flow",
  mermaid: "flowchart LR\n  Cart --> Pay\n  Pay -->|declined| Retry\n  Pay -->|approved| Receipt",
})
const back = await slatebox.slates.exportMermaid({ shareId: drawn.shareId })
return { url: drawn.url, mermaid: back.mermaid }
```

<!-- /tabs -->

## Run it on your machine

`slatebox-mcp` is the same server as an npm package, for stdio clients. Scripts then run in your own process with your rights. [Install the package and CLI](terminal-and-agents.md#install-the-package)

To run all of Slatebox yourself, with the server at `/mcp` on your own address, use `npx slatebox install`. [Run your own Slatebox](../../Installation/self-hosting.md)

## Questions

### Is there a free MCP server for diagrams?

Yes. Slatebox's MCP server is free on Slatebox Cloud and on a self-hosted Slatebox, and open source under the MIT license. Add `https://app.slatebox.com/mcp` to your client and sign in.

### Which diagrams can an agent draw?

Flowcharts, mind maps, Gantt project plans, architecture diagrams and threat models, plus boards such as a retro or a triage board. It can also import draw.io, Visio, Lucidchart, Excalidraw, tldraw, Graphviz, PlantUML, XMind, FreeMind and OPML files.

### Are the diagrams editable?

Yes. Every shape is a real note and every connector a real line on the canvas, not a picture. People and agents edit the same slate at the same time.

### Can several people and agents work on one diagram?

Yes. Each agent appears as a named pointer. When an agent changes a slate someone else has open, its changes arrive as suggestions anyone who can edit keeps or discards. [Keep or discard what agents suggest](../../Using-Slatebox/agent-suggestions.md)

### Which clients work?

Any MCP client that supports remote servers: Claude, Claude Code, ChatGPT, Cursor, VS Code and others. A stdio-only client runs `slatebox-mcp` from npm.
