Using generate_variants in the marginal email MCP
The generate_variants email MCP tool is where most subject line experiments begin. It lets an AI agent draft a set of candidate subject lines that you can then put into a real A/B test through marginal's hosted email MCP server — no copy-paste, no separate UI.
What generate_variants does
generate_variants is one of four MCP tools exposed by marginal, alongside launch_test, get_results, and recommend_next. Given a prompt or seed subject line, it returns a list of distinct subject line variations ready to feed into a subject line A/B test.
Because it runs over the Model Context Protocol, any connected agent can call it as a function. The agent decides how many angles to explore — urgency, curiosity, plain-spoken — and gets structured variants back to test rather than to guess at.
- Produces multiple subject line candidates from a single brief
- Output flows directly into launch_test for a managed send
- Returns structured data the agent can reason over
- Pairs with get_results to close the loop on what actually wins
How it fits an A/B testing workflow
A typical loop looks like this: call generate_variants to draft subjects, call launch_test to run a subject line A/B test across your audience, then call get_results to read open and click metrics with within-test lift. Finally, recommend_next suggests the direction for your following experiment.
This makes generate_variants the front door of AI agent email marketing on marginal. Instead of brainstorming subject lines in a chat window and manually entering them, the agent generates, tests, and learns in one connected flow.
- generate_variants → draft subject lines
- launch_test → managed send with tracking
- get_results → open/click rates and within-test lift
- recommend_next → guidance for the next round
Calling it from your agent
marginal is a hosted email MCP server reachable at https://marginal.sh/mcp, authenticated with a Bearer API key (marg_live_...). There is nothing to self-host — once your client is connected, generate_variants appears as an available tool.
It works from any MCP-capable client, including Cursor, Claude Desktop, Claude Code, OpenAI Codex, Windsurf, Cline, Continue, and Zed. The free tier covers 100 experiments per month, which is plenty for iterating on variant generation and small subject line A/B tests.
- Endpoint: https://marginal.sh/mcp
- Auth: Bearer API key (marg_live_...)
- Free tier: 100 experiments/month
- Docs and tool schemas: https://marginal.sh/docs/
Tips for better variants
The quality of generate_variants output depends on the brief you give it. Tell the agent the audience, the offer, and the tone you want, and ask for variants that differ on one dimension at a time so the resulting A/B test isolates a clear signal.
- Specify audience and intent in the prompt
- Vary one lever per batch to keep tests readable
- Generate a handful, not dozens — keep tests statistically clean
- Use recommend_next to inform the next generate_variants prompt
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