An Email Marketing API for AI Agents
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.
- Tools are typed and self-describing, so agents call them without custom adapters
- Subject line A/B test logic and lift math are handled server-side
- No dashboard clicking required — the whole flow runs from the agent
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.
- generate_variants — draft candidate subject lines for a campaign
- launch_test — start a managed send with an A/B split
- get_results — pull open and click tracking plus within-test lift
- recommend_next — get a data-backed suggestion for the next move
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/.
- Registry id: sh.marginal/mcp
- Endpoint: https://marginal.sh/mcp
- Auth: Bearer API key (marg_live_...)
- Free tier: 100 experiments/month
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.
- 100 experiments/month on the free tier
- Four MCP tools: generate_variants, launch_test, get_results, recommend_next
- Listed in the MCP Registry as sh.marginal/mcp