Building an Email Marketing Agent Workflow
An email marketing agent workflow lets an AI assistant draft, test, and optimize campaigns without you hopping between tools. With marginal's hosted email MCP server, your agent can generate subject line variants, launch an A/B test, and pull real results — all from inside the editor or chat you already use.
What the workflow looks like end to end
A good agent workflow is a loop, not a one-off prompt. The agent proposes copy, ships a test, waits for signal, and then decides what to do next. marginal exposes four MCP tools that map cleanly onto that loop, so the agent reasons about strategy while the server handles sends and measurement.
- generate_variants — produce candidate subject lines for a campaign
- launch_test — start a subject line A/B test with a managed send
- get_results — read open/click tracking and within-test lift
- recommend_next — get a data-backed suggestion for the next step
Why run it through an email MCP server
When subject line testing lives behind an MCP server, the agent doesn't need bespoke glue code or a brittle chain of API calls. It calls a tool, gets structured output, and keeps going. marginal is hosted, so there is no infrastructure to stand up — you authenticate with a Bearer API key (marg_live_...) and point your client at https://marginal.sh/mcp.
This keeps the AI agent email marketing flow auditable. Every variant, send, and metric passes through one endpoint, so you can trace exactly what the agent did and why it recommended the variant it chose.
A practical subject line A/B test loop
Here's a typical sequence an agent runs inside this workflow. The phrasing of your prompt can stay high-level — the tools carry the operational weight.
- Ask the agent to generate_variants for a launch announcement
- Have it launch_test with two or three of the strongest subject lines
- Let the managed send and open/click tracking accumulate signal
- Call get_results to compare within-test lift between variants
- Use recommend_next to decide whether to scale the winner or iterate
Getting started across your tools
marginal works with the MCP clients developers and growth engineers already use, including Cursor, Claude Desktop, Claude Code, Windsurf, Cline, Continue, Zed, and OpenAI Codex. Configure the endpoint once and the same email marketing agent workflow is available wherever you work.
The free tier covers 100 experiments per month, which is plenty to validate the loop on real campaigns before scaling. Full tool references and setup steps live in the docs at https://marginal.sh/docs/.
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