# Mailpiece with Codex

*Your newsletter, one prompt away in Codex.*

Write your newsletter from Codex: give it your notes and it writes the draft straight into Mailpiece.

## What you get

- Turn these notes into a draft post
- Send me a test of the draft
- Schedule it for Monday at 8
- Who subscribed since the last issue?
- Which addresses bounced?

## 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 Codex 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 `mailpiece skill` and pick Codex, then add the server. One setup serves the CLI, the IDE extension and the app.

```sh
mailpiece skill
codex mcp add mailpiece -- mailpiece mcp --writes

# or, in ~/.codex/config.toml
[mcp_servers.mailpiece]
command = "mailpiece"
args = ["mcp", "--writes"]
```

## Ask

"Turn these notes into a draft and send me a test."

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

## Set it up this afternoon

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