← All guides marginal.sh

Using generate_variants in the marginal email MCP

Updated June 2026 · Hosted email MCP server

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.

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.

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.

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.

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