How to Generate Subject Line Variants with MCP
This how-to guide walks through generating subject line variants with MCP using marginal — the hosted email MCP server. In a few prompts your AI agent can draft alternatives, launch an A/B test, and read back lift metrics.
What you need before you start
marginal is a hosted email marketing MCP server, so there's nothing to install or self-host. You connect your MCP client to the endpoint and authenticate with a Bearer API key. The free tier covers 100 experiments per month, which is plenty for testing subject line ideas.
- An MCP-capable client: Cursor, Claude Desktop, Claude Code, Codex, Windsurf, Cline, Continue, or Zed
- The marginal endpoint: https://marginal.sh/mcp
- An API key in the form marg_live_... set as a Bearer token
- A draft email or a clear description of the campaign you're sending
Step 1: Generate subject line variants
Once your agent is connected, call the generate_variants tool. Describe the email's audience, offer, and tone, and ask for a handful of distinct angles. The tool returns alternative subject lines you can review before testing anything.
A good prompt is specific. Instead of "write some subject lines," tell the agent who the recipient is and what action you want. That context produces variants worth running through a subject line A/B test.
- Prompt example: "Generate 5 subject line variants for a re-engagement email to lapsed trial users, friendly tone."
- Ask for a mix of angles: curiosity, benefit-led, urgency, and plain-spoken
- Trim to 3–4 strong candidates before moving on
Step 2: Launch the A/B test and read results
After you've picked your variants, have the agent call launch_test to run a managed send that splits recipients across the subject lines. marginal handles delivery plus open and click tracking, so you don't wire up sending infrastructure yourself.
When the test has gathered data, call get_results to see within-test lift metrics for each variant. This closes the loop on the whole point of learning how to generate subject line variants with MCP: you don't just brainstorm options, you find out which one performs.
- launch_test — start a subject line A/B test from your chosen variants
- get_results — open rate, click rate, and lift per variant
- recommend_next — let the agent suggest a follow-up experiment
Make it a repeatable workflow
Because every step runs through MCP tools, AI agent email marketing becomes a repeatable loop rather than a one-off task. Generate, test, measure, and iterate — all from the same conversation. As you collect results, recommend_next helps you decide what to try in the following round.
For full tool schemas and connection details, see the marginal MCP tutorial and reference docs at https://marginal.sh/docs/, or connect directly at 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.
- 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