# Mailpiece with VS Code

*Copilot drafts the issue, you read the test.*

Write your newsletter from VS Code: Copilot makes an issue out of your notes and drafts it in Mailpiece.

## What you get

- Turn these notes into a draft post
- Send me a test of the draft
- Schedule it for next Wednesday
- Who subscribed this month?

## Sign in

Build the CLI as the [agents guide](https://mailpiece.dev/docs/agents) shows and make a read and write token under Profile › Personal access tokens, so Copilot can draft, test and schedule. The account number is the one in the app's address.

```sh
mailpiece auth login TOKEN --account 834206594 --api-url https://app.example.com
mailpiece doctor
```

## Connect

Run `MCP: Open User Configuration` from the Command Palette, or use `.vscode/mcp.json` for one workspace. Trust the server when asked.

```sh
{
  "servers": {
    "mailpiece": {
      "type": "stdio",
      "command": "mailpiece",
      "args": ["mcp", "--writes"]
    }
  }
}
```

## Ask

In the Chat view: "Turn these notes into a draft post and send me a test."

Sending to the whole list can't be undone, so read what Copilot is about to do before you let it.

## Set it up this afternoon

Install Mailpiece on a server, connect VS Code (GitHub Copilot), and send your next issue. [Install Mailpiece](https://mailpiece.dev/docs/install)
