Subject Line A/B Testing in Windsurf
Connect Windsurf to marginal's hosted email MCP server and run a full subject line A/B test from inside your agent workflow — generate variants, launch the send, and pull open and click lift without switching tools.
Why run subject line A/B tests from Windsurf
Windsurf's agentic workflow is well suited to iterative tasks, and a subject line A/B test is exactly that: draft candidates, ship them, measure, and decide what to send next. By wiring marginal in as an email MCP server, the whole loop happens through tool calls your Windsurf agent already understands.
marginal is hosted, so there's no infrastructure to stand up. You add the endpoint, supply a Bearer API key, and the agent gets four tools for the entire test lifecycle.
- Keep copywriting and test orchestration in one place
- No separate email dashboard to context-switch into
- Reproducible: the agent can repeat the same workflow across campaigns
- Free tier covers 100 experiments per month while you evaluate
Connect marginal to Windsurf
Add marginal as an MCP server in Windsurf using the hosted endpoint at https://marginal.sh/mcp and your API key (it starts with marg_live_). Once registered, Windsurf can call the marginal tools during any agent run.
The full tool reference and setup steps live in the docs at https://marginal.sh/docs/. The same configuration works across other clients too, so a flow you build in Windsurf transfers cleanly.
- Registry id: sh.marginal/mcp
- Endpoint: https://marginal.sh/mcp
- Auth: Bearer API key (marg_live_...)
- Available tools: generate_variants, launch_test, get_results, recommend_next
A subject line A/B test, end to end
Inside a Windsurf agent workflow, a subject line A/B test maps directly onto marginal's tools. Describe the campaign, let the agent draft candidates, launch the split send, and come back for results once data accumulates.
Because marginal tracks opens and clicks and computes within-test lift, the agent doesn't have to do the statistics by hand — it reads the metrics and acts on them.
- generate_variants — produce several subject line candidates from a brief
- launch_test — start the managed send that splits traffic across variants
- get_results — pull open/click rates and within-test lift
- recommend_next — let marginal suggest the winning direction for the next round
Tips for reliable AI agent email marketing
AI agent email marketing works best when the agent has clear constraints. Give Windsurf a tight brief for the subject line A/B test so generated variants stay on-brand and test a real hypothesis rather than random phrasings.
- Test one variable per round so lift is attributable to the subject line
- Wait for enough sends before reading get_results to avoid noisy lift
- Feed recommend_next output back into generate_variants for the next iteration
- Log the winning subject line in your repo so the workflow stays auditable
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