← All guides marginal.sh

Randomized Email Variant Assignment for Subject Line Tests

Updated June 2026 · Hosted email MCP server

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.

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.

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.

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.

Documentation · Sign up · FAQ