← All guides marginal.sh

Subject Line A/B Test API for AI Agents

Updated June 2026 · Hosted email MCP server

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.

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.

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.

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.

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