A newsletter you run on your own server

AI agents welcome.

Your agent can do anything in Mailpiece you can do on screen: draft a post, send you a test, schedule it, publish it and look after your subscribers.

It works with Claude Code, Codex, OpenCode, Cursor, Gemini CLI, Claude Desktop, GitHub Copilot, Cline and Zed.

Running a coding agent

The mailpiece CLI reaches your whole newsletter from the terminal, so any agent that runs shell commands can work with it. mailpiece mcp serves it as MCP tools, and only reads until you pass --writes. mailpiece skill install gives your agent the skill for setting Mailpiece up and using it.

Each agent has its setup: Claude Code, Codex, OpenCode, Cursor, Gemini CLI, Claude Desktop, GitHub Copilot CLI, VS Code, Cline and Zed. The rest is in Agents and the CLI.

git clone https://github.com/mailpiece/mailpiece-cli.git
cd mailpiece-cli && make build

mailpiece auth login TOKEN --account 834206594 --api-url https://app.example.com
mailpiece skill install
claude mcp add mailpiece -- mailpiece mcp --writes

Building your own

The app's screens also answer JSON: add .json to the address. Sign in with a personal access token made under your profile: a read token only looks, and a read and write token can also create, change and delete.

Read the JSON API guide

Careful with sending

Your agent can draft freely and send you a test whenever it is ready, since a test mails one address, yours unless you name another. Mailing the whole list can't be undone, so the skill tells your agent never to run post deliver unless you asked for exactly that, and your readers hear from you when you say so.