← All guides marginal.sh

How to Run a Subject Line A/B Test with marginal

Updated June 2026 · Hosted email MCP server

This how-to guide walks through running a subject line A/B test using marginal, the hosted email MCP server for AI agents. You'll go from idea to a clear winner using four tools — no dashboards, no glue code.

Before you start

marginal connects to AI agent clients over the Model Context Protocol, so the entire test runs inside the assistant you already use. Point your client at the endpoint and authenticate with a Bearer API key before you begin.

Step 1: Generate subject line variants

Start by asking your agent to draft candidates with the generate_variants tool. Give it the core message, your audience, and the tone you want — the tool returns distinct subject lines you can test against each other.

Aim for a small set of meaningfully different angles rather than near-duplicates. A curiosity-driven line versus a benefit-driven line gives you a cleaner read on what your audience responds to.

Step 2: Launch the test and track engagement

Once you've chosen your variants, call launch_test to start a managed send. marginal handles the delivery and splits your audience across the subject lines, then tracks opens and clicks automatically.

Because the send is managed by the hosted server, you don't wire up tracking pixels or webhooks yourself. The AI agent email marketing loop stays entirely conversational.

Step 3: Read results and decide what to send next

Call get_results to see within-test lift metrics comparing each subject line's open and click performance. This tells you which variant won and by how much, so the decision is grounded in data rather than a guess.

To close the loop, use recommend_next. Based on the test outcome, marginal suggests the strongest follow-up direction — turning a single subject line A/B test into an ongoing optimization habit. That's the full marginal MCP tutorial flow: generate, launch, measure, iterate.

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