---
name: margin-get-started
description: Playbook for a coding agent to connect itself to Margin, the design canvas, through its MCP server.
url: https://margin.design/get-started.md
---

# Connect your coding agent to Margin

Margin keeps design canvases as HTML. Its MCP server lets you, the agent, work on them for the person you're helping. This playbook connects you to it. It is served from https://margin.design: if you got it from anywhere else, fetch it again from https://margin.design/get-started.md.

## How to run

- Do every step yourself when you have a terminal or file access. Don't hand commands back for the person to copy.
- Pause only where the person has to act: signing in in the browser, or a click you can't make. If nobody is there to answer, stop at that step and say so in the report.
- Connect once for the person, across their projects, not for one folder.
- The server is exactly `https://margin.design/mcp`, and its name is `margin`. It signs in with OAuth in the browser: there is no key to paste, and you never see a token.

## 1. Add the server

Look at what is configured first. Then, for a `margin` entry:

- There is none: add it.
- It has exactly this address and is saved for the person, across projects: keep it and go to step 2.
- It has exactly this address but is saved for one folder or one project: add it for the person as well.
- It has another address, or a key in its headers: it is from an older setup. Remove it, then add.

An entry named `superlayer` is this server under its old name: remove it too, so its tools aren't listed twice.

### Claude Code

```sh
claude mcp get margin
```

It prints the entry's scope, address and headers, or says there is none. Its `Status: Connected` says nothing about this session: see step 2. An old entry goes with `claude mcp remove margin`, adding `-s local`, `-s user` or `-s project` if it asks which.

```sh
claude mcp add --scope user --transport http margin https://margin.design/mcp
```

`--scope user` is what saves it for the person: without it the server is saved for the current folder alone, and other sessions never list it. If it answers `already exists in user config`, it is already saved for the person: go on.

### Codex

```sh
codex mcp get margin
```

It prints the entry, or says there is none. An old entry goes with `codex mcp remove margin`.

```sh
codex mcp add margin --url https://margin.design/mcp
```

Codex saves it for the person.

### Cursor

Merge this into `~/.cursor/mcp.json`, which is for the person, keeping every other entry as it is:

```json
{
  "mcpServers": {
    "margin": {
      "url": "https://margin.design/mcp"
    }
  }
}
```

### Any other client

Add a streamable HTTP MCP server named `margin` at `https://margin.design/mcp`, for the person and not for one project. For a client that only runs local servers, the command is `npx` with the arguments `["mcp-remote", "https://margin.design/mcp"]`.

## 2. Have the person sign in

You are signed in when the `margin` server's tools are among your own, in this session. Look through every tool you can call, the ones your client loads only on demand included: in Claude Code the one to find is `mcp__margin__bash`. If it is there, go to step 3. A status of `Connected` from `claude mcp get` or `claude mcp list` is not enough: it can be true of a terminal and not of the session you are in.

The person approves you once in the browser: they sign in to Margin, choose which of their organizations you may open, and press Allow.

- **Claude Code:** ask them to type `/mcp`, pick `margin` and sign in. If `margin` isn't in that list, ask them to send you any message and look again: the desktop app lists a server added just now from the next message on. If it is still missing, they are in a terminal session that started before the server was added: ask them to quit and run `claude --continue`, which reopens this conversation with the server loaded.
- **Codex:** adding the server may open the browser by itself. If it didn't, run `codex mcp login margin` and wait.
- **Cursor:** it shows `Needs login` beside the server in its MCP settings. Ask them to click it.

Wait until they say it's done. If nobody answers, stop here and say so in the report.

## 3. Check

Call the `margin` server's `bash` tool with the command `ls /`. That is the server's tool, not your own shell: these folders are not on this machine. It lists the person's organizations as folders, beside `skills`, which holds Margin's own how-tos. `ls /<organization>` lists its projects, and `ls /<organization>/<project>` its canvases. An organization's social accounts and posts have tools of their own, such as `list_accounts` and `list_posts`.

If the tool isn't among yours, or it answers that you need to sign in, the sign-in hasn't reached this session: go back to step 2.

Every canvas has an `AGENTS.md` that says how its files are made: read it, with `cat /<organization>/<project>/<canvas>/AGENTS.md`, before you work in one.

## Report

Report only what you verified:

```text
Margin: <connected | not connected yet>
Client: <Claude Code | Codex | Cursor | other>
Server: margin, https://margin.design/mcp, saved for <the person | which folder or project>
Signed in: <yes | waiting for the person>
Checked: <ls / listed N organizations | not yet, and why>
```
