Subject Line A/B Test API for AI Agents
A subject line A/B test API lets you spin up experiments, send variants, and read results programmatically — no dashboard clicking required. marginal exposes exactly that through an MCP server your AI agent can call directly.
What a subject line A/B test API actually does
Most subject line testing lives behind a UI. A subject line A/B test API moves that work into code so an agent can decide what to test, kick it off, and react to the winner without a human in the loop. marginal wraps this flow into four MCP tools that map cleanly to the lifecycle of an experiment.
Instead of stitching together a sender, a tracking layer, and a stats calculator yourself, you call one endpoint and get managed sends plus within-test lift metrics back.
- generate_variants — draft candidate subject lines for a campaign
- launch_test — send variants and split your audience
- get_results — pull open and click rates with lift metrics
- recommend_next — suggest the next variant or winner to roll out
Why marginal uses an email MCP server
marginal is a hosted email MCP server, so the subject line A/B test API isn't a REST surface you script against by hand — it's a set of tools any MCP-aware client can invoke. That means your AI agent for email marketing can reason about results and call the next action in the same conversation.
Connecting is straightforward: point your client at https://marginal.sh/mcp and authenticate with a Bearer API key (marg_live_...). There is nothing to self-host — sends, open/click tracking, and lift calculation all run on marginal's side.
- Endpoint: https://marginal.sh/mcp
- Auth: Bearer API key (marg_live_...)
- Registry id: sh.marginal/mcp
- Works with Cursor, Claude Desktop, Claude Code, Windsurf, Cline, Continue, Codex, and Zed
A typical agent-driven test loop
Because every step is a tool call, an agent can run a full subject line A/B test end to end. It starts by generating variants from a brief, launches the test against a sample of your list, waits for engagement data, then asks for a recommendation before committing the winning subject line to the rest of the send.
This loop is where AI agent email marketing gets practical: the model handles the busywork of copy iteration while marginal handles the delivery and measurement that keeps the test statistically meaningful.
- Generate 3–5 subject line variants for the campaign
- Launch the test on a slice of your audience
- Read open/click results and within-test lift
- Let the agent pick the winner and scale the send
Getting started and free usage
The free tier includes 100 experiments per month, which is enough to wire up the subject line A/B test API and validate the loop before scaling. Full tool schemas and example calls live in the docs.
If you're building an agent that owns campaign copy, this is the smallest possible surface to add real A/B testing to it.
- Free tier: 100 experiments/month
- Docs: https://marginal.sh/docs/
- No self-hosting — marginal is fully hosted
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