# Paper

> Combine the Paper and MailBlastr MCP servers so your agent can turn a Paper design into a MailBlastr template or campaign.

[Paper](https://paper.design) is a design tool built for AI agents. Its MCP server lets an agent read your canvas — layout, styles, copy, and screenshots. Combined with the [MailBlastr MCP server](https://www.mailblastr.com/docs/ai/mcp-server), your agent can take a design straight from Paper and turn it into a ready-to-send [template](https://www.mailblastr.com/docs/templates/overview) or [campaign](https://www.mailblastr.com/docs/campaigns/managing) in your MailBlastr account.

The flow:

1. **Design** — You design an email in Paper.
2. **Read** — Your agent reads the design through the Paper MCP server.
3. **Convert** — Your agent converts the design into email-safe HTML using the MailBlastr MCP server and [agent skills](https://www.mailblastr.com/docs/ai/skill-mailblastr).
4. **Create** — Your agent creates a template or campaign in MailBlastr.

## Prerequisites

- The [Paper Desktop app](https://paper.design/downloads) installed with a file open (opening a file starts the Paper MCP server automatically).
- A MailBlastr [API key](https://www.mailblastr.com/docs/api-keys/overview) and a [verified domain](https://www.mailblastr.com/docs/add-a-domain).
- An MCP client like Claude Code, Cursor, or Claude Desktop.

## 1. Connect the Paper MCP server

Paper Desktop runs a local MCP server at `http://127.0.0.1:29979/mcp` whenever a file is open. Connect it in your client:

**Claude Code**

```bash
# Install the official Paper plugin (recommended):
/plugin marketplace add paper-design/agent-plugins
/plugin install paper-desktop@paper

# Or add the MCP server directly:
claude mcp add paper --transport http http://127.0.0.1:29979/mcp --scope user
```

**Codex**

```bash
# Install the official Paper plugin (recommended):
codex plugin marketplace add paper-design/agent-plugins
/plugins
# Then select the paper-design/agent-plugins marketplace and install paper-desktop.
```

**Cursor**

```bash
# Run in the agent panel, or search "Paper" in the Cursor Marketplace:
/add-plugin paper-desktop
```

**Claude Desktop**

```json
{
  "mcpServers": {
    "paper": {
      "command": "npx",
      "args": ["mcp-remote", "http://127.0.0.1:29979/mcp"]
    }
  }
}
```

See the [Paper MCP docs](https://paper.design/docs/mcp) for other clients.

## 2. Connect the MailBlastr MCP server

Add the MailBlastr MCP server with your API key:

**Claude Code**

```bash
claude mcp add mailblastr -e MAILBLASTR_API_KEY=mb_xxxxxxxxx -- npx -y mailblastr-mcp
```

**Codex**

```bash
codex mcp add mailblastr \
  --env MAILBLASTR_API_KEY=mb_xxxxxxxxx \
  -- npx -y mailblastr-mcp
```

**Cursor**

```json
{
  "mcpServers": {
    "mailblastr": {
      "command": "npx",
      "args": ["-y", "mailblastr-mcp"],
      "env": {
        "MAILBLASTR_API_KEY": "mb_xxxxxxxxx"
      }
    }
  }
}
```

**Claude Desktop**

```json
{
  "mcpServers": {
    "mailblastr": {
      "command": "npx",
      "args": ["-y", "mailblastr-mcp"],
      "env": {
        "MAILBLASTR_API_KEY": "mb_xxxxxxxxx"
      }
    }
  }
}
```

For more clients and options, see the [MCP server overview](https://www.mailblastr.com/docs/ai/mcp-server).

## 3. Design your email in Paper

Design your email as an artboard. A few tips for designs that translate well to email:

- Use a single-column layout around 600px wide.
- Use real copy instead of placeholder text.
- Use web-safe fonts like System Sans-Serif or System Serif.
- Use PNG or JPG images instead of SVGs (not supported in email).

> **Note:** For personalization, write the variable directly into the design copy, like `Hi {{{NAME|there}}}`. Your agent preserves it when creating the template or campaign.

## 4. Ask your agent to create an email

You can create either a template or a campaign. To create a **template**, select an artboard in Paper and, with both servers connected, prompt:

```text
Look at the selected artboard in Paper and recreate it as an email template in
MailBlastr. Convert the design to email-safe HTML (inline styles, table-based
layout) using the MailBlastr agent skills. Provide a name, subject, and preview
text that fits the content. Publish the template.
```

Behind the scenes the agent:

1. Calls Paper's `get_selection` and `get_screenshot` to see the design.
2. Calls Paper's `get_jsx` or `get_computed_styles` to read the exact layout, colors, and copy.
3. Converts the output into email-safe HTML.
4. Calls MailBlastr's `create-template` with the HTML, name, and subject.
5. Calls MailBlastr's `publish-template` to make it available for sending.

Templates support variables using triple-brace syntax like `{{{USERNAME}}}`. Once published, send the template via the [Emails API](https://www.mailblastr.com/docs/api/emails-send) or the dashboard.

To go from design straight to a send, ask for a **campaign** instead — the agent reads the design the same way, then calls `create-campaign` with the HTML, sender, subject, and segment. Create it as a draft and review it in the dashboard before sending.

> **Note:** Before sending a campaign you must define which [segment](https://www.mailblastr.com/docs/segments/overview) should receive it. If you don't have one yet, your agent can create one.

## Refine in the visual editor

Templates and campaigns created by your agent are editable in the MailBlastr dashboard. If you want the agent's content to be fully editable in the visual editor, ask it to use `compose-template` or `compose-campaign` instead of raw HTML — the agent appears as a named avatar in the editor while it works, and you can hand-tune the result afterwards.

Alternatively, edit the template or campaign directly in the dashboard: select the **Editor icon** in the top left and **Hold to confirm** to convert the HTML into a visual template or campaign.

## Example: end-to-end prompt

```text
1. Read the "Launch Announcement" artboard from Paper.
2. Convert it to an email-safe HTML email. Preserve the colors, spacing, and
   copy as closely as email clients allow. Use the MailBlastr agent skills.
3. Create it as a campaign in MailBlastr from announcements@yourdomain.com to
   the "Customers" segment, subject "We just launched".
4. Show me a summary and the dashboard link, but do not send it.
```

## Troubleshooting

- **Agent can't reach Paper** — make sure Paper Desktop is running with a file open, then restart your agent session.
- **Design looks different in the email** — email clients don't support modern CSS. Ensure the MailBlastr [agent skills](https://www.mailblastr.com/docs/ai/skill-mailblastr) are installed, then ask the agent to use table-based layout and inline styles and to flag anything (custom fonts, complex gradients) that won't survive the conversion.
- **`create-campaign` fails** — check that the `from` address uses a [verified domain](https://www.mailblastr.com/docs/add-a-domain) and that the segment exists.
