← All guides marginal.sh

An Email Marketing API for AI Agents

Updated June 2026 · Hosted email MCP server

If you're building autonomous workflows that write and send campaigns, you need an email marketing API for agents that speaks the protocol they already understand. marginal exposes subject line testing, managed sends, and result metrics as MCP tools your agent can call directly.

Why agents need a purpose-built API

Most email platforms assume a human is clicking through a dashboard. AI agent email marketing breaks that assumption — your agent needs to propose variants, launch a test, wait for data, and decide what to do next, all programmatically. A traditional REST surface forces you to glue together auth, scheduling, and analytics by hand.

marginal is built around the Model Context Protocol, so a connected agent discovers the available tools automatically and calls them with structured arguments. That makes it a natural fit for closed-loop campaign optimization rather than one-off sends.

The four tools your agent calls

marginal's email MCP server keeps the surface small and composable. Each tool maps to one step of an experiment, which keeps agent reasoning predictable and easy to debug.

Connecting and authenticating

marginal is fully hosted, so there's nothing to deploy or self-manage. You point your MCP client at the endpoint at https://marginal.sh/mcp and authenticate with a Bearer API key that looks like marg_live_.... Works with Cursor, Claude Desktop, Claude Code, OpenAI Codex, Windsurf, Cline, Continue, and Zed.

The free tier covers 100 experiments per month, which is plenty for prototyping an agent loop before scaling up. Full setup details live in the docs at https://marginal.sh/docs/.

A typical optimization loop

Once connected, an agent can run a complete subject line A/B test without human intervention. It generates several candidate subjects, launches a managed send split across them, then reads back open and click metrics with within-test lift so it knows which variant actually won.

From there, recommend_next closes the loop — the agent uses the recommendation to plan its next campaign or refine its copy strategy, turning marginal into the email layer of a self-improving marketing agent.

Get started with marginal

marginal is a hosted email marketing MCP server at marginal.sh. Sign up free, create an API key, and connect https://marginal.sh/mcp from Cursor, Codex, or Claude Desktop.

Documentation · Sign up · FAQ