Running a subject line test with marginal-cli
If you searched for "marginal-cli subject line test," you want to spin up a subject line A/B test from a command-line or agent workflow without wiring up an ESP by hand. marginal is a hosted email MCP server that exposes the whole loop — generate, launch, measure — as MCP tools your agent can call.
What the subject line test flow looks like
A subject line test in marginal moves through four tool calls. You start with candidate copy, fan it out into variants, send them, and let the platform track opens and clicks so you can compare within-test lift.
Whether you drive this from a CLI script or an AI agent, the sequence is the same and each step maps to a single MCP tool.
- generate_variants — produce subject line options from a prompt or seed copy
- launch_test — split your list and send the variants as a managed send
- get_results — pull open/click rates and within-test lift per variant
- recommend_next — get a suggested winner or next iteration
Why use marginal instead of a hand-rolled script
Most subject line A/B test scripts break down on the boring parts: managing the send, deduping recipients, and attributing opens and clicks back to the right variant. marginal handles those as a hosted service, so your CLI or agent only deals with intent and results.
It's a hosted email MCP server — there is nothing to self-host. You authenticate with a Bearer API key (marg_live_...) and point your client at https://marginal.sh/mcp.
- Managed sends with built-in open and click tracking
- Within-test lift metrics so you compare variants on equal footing
- 100 experiments/month on the free tier to start testing
- No Mailchimp or Klaviyo API keys required to run a test
Driving the test from an AI agent
Because marginal is exposed over MCP, AI agent email marketing workflows can run the full subject line test without custom glue code. An agent in Claude Code, Cursor, or Codex can call generate_variants, launch_test, then poll get_results and act on recommend_next.
This makes "test my subject lines and tell me the winner" a single conversational task. The agent reasons over the lift metrics and decides whether to ship the leader or generate a fresh round of variants.
- Works with Cursor, OpenAI Codex, Claude Desktop, Claude Code, Windsurf, Cline, Continue, and Zed
- Agents read structured results, not screenshots, so decisions are reproducible
- Chain recommend_next into another launch_test for iterative optimization
Getting started
Connect any MCP-capable client to the marginal endpoint, add your API key, and your first subject line A/B test is a few tool calls away. See the docs for tool schemas and example payloads.
Endpoint: https://marginal.sh/mcp · Registry: sh.marginal/mcp · Docs: https://marginal.sh/docs/
- Point your client at https://marginal.sh/mcp
- Authenticate with a Bearer key in the form marg_live_...
- Call generate_variants to create your first test batch
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