Randomized Email Variant Assignment for Subject Line Tests
Randomized email variant assignment is the difference between a test you can trust and a guess dressed up as data. Here's how marginal handles it inside an email MCP server so your AI agent can run clean experiments.
Why randomization matters in a subject line A/B test
When you split a list into variant A and variant B, the assignment has to be random — not the first half of your CSV, not the people who happened to open last week. Order-based splits leak existing engagement bias into the result, so a subject line A/B test ends up measuring who your better recipients are rather than which line performed.
Randomized email variant assignment shuffles recipients across variants so each group is statistically comparable. That keeps your within-test lift metrics honest: when one subject line wins, you can attribute the difference to the line itself.
- Random assignment balances engaged and dormant recipients across variants
- It prevents day-of-week and list-order artifacts from skewing results
- It makes lift numbers comparable instead of confounded
How marginal assigns variants
marginal is a hosted email MCP server, so the randomization happens server-side when you call launch_test. You pass your variants and recipients; marginal allocates each recipient to a variant, sends through its managed delivery, and tracks opens and clicks per group.
Because the logic lives in the tool layer, your AI agent doesn't have to implement bucketing, hashing, or seed handling. It calls generate_variants to draft candidates, launch_test to assign and send, and get_results to read back per-variant performance.
- generate_variants — draft subject line candidates
- launch_test — randomly assign recipients and send
- get_results — per-variant open/click and within-test lift
- recommend_next — guidance on what to test next
Running it from an AI agent
AI agent email marketing works best when the agent can reason about copy but defer the statistics to a dependable backend. With marginal connected over MCP, an agent in Cursor, Claude Code, Windsurf, or Continue can propose subject lines, launch a randomized test, wait for data, and recommend a winner — all without leaving the editor.
The endpoint is https://marginal.sh/mcp and auth is a Bearer API key (marg_live_...). The free tier covers 100 experiments per month, which is plenty for iterating on subject lines across a few campaigns.
- Connect once and let the agent drive the full test loop
- No self-hosting — marginal is hosted and ready at the endpoint
- Setup details live in the docs at https://marginal.sh/docs/
Reading results you can trust
Once a test concludes, get_results returns open and click rates per variant plus within-test lift, so you see how much one subject line outperformed another among comparable audiences. Because assignment was randomized, that lift reflects the line, not the luck of the draw.
Pair this with recommend_next to keep the experiment cadence going: ship the winner, test a fresh angle, and let the randomized assignment do the heavy statistical lifting each round.
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