← All guides marginal.sh

How to Send a Split Test Email from an AI Agent

Updated June 2026 · Hosted email MCP server

This how-to guide walks through sending a split test email from an AI agent end to end — generating subject line variants, launching the test, and reading the lift. Everything runs through marginal, the hosted email MCP server, so your agent calls a few tools instead of wiring up send infrastructure.

Before you start

To send a split test email from an AI agent you need marginal connected as an MCP server in your client of choice — Cursor, Claude Desktop, Claude Code, Windsurf, Cline, Continue, Zed, or OpenAI Codex. marginal is hosted, so there's nothing to deploy; you just point your client at the endpoint and authenticate.

Step 1 — Generate subject line variants

Start by asking your agent to call generate_variants with the core message of your email. This produces candidate subject lines for the subject line A/B test. You can prompt for a specific angle — urgency, curiosity, plain-spoken — and the agent will return several options to choose between.

A typical instruction to the agent: "Generate three subject line variants for our spring restock announcement, keeping them under 50 characters." Review the output and trim it to the two or three you actually want to compete.

Step 2 — Launch the split test

Once you've picked your variants, have the agent call launch_test with the subject lines, the email body, and the recipient list. marginal handles the managed send and splits delivery across the variants automatically. This is the moment you actually send a split test email from an AI agent — no separate ESP credentials required, since the send is managed for you.

marginal tracks opens and clicks per variant from this point forward, which is what powers the within-test lift metrics in the next step.

Step 3 — Read results and decide what's next

After the test has run, ask the agent to call get_results to pull open rates, click rates, and within-test lift for each subject line. Then call recommend_next to get a suggested follow-up — for example, sending the winning subject to the remaining audience or designing the next subject line A/B test.

This closes the loop on AI agent email marketing: your agent generated the variants, launched the send, measured the lift, and proposed the next move, all inside one conversation. For deeper details on each tool, see the marginal MCP tutorial and reference at https://marginal.sh/docs/, or connect the server from https://marginal.sh/mcp.

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