← All guides marginal.sh

Test Newsletter Subject Lines in Windsurf

Updated June 2026 · Hosted email MCP server

Connect marginal to Windsurf and let your AI agent draft, launch, and measure newsletter subject line tests without leaving your editor. This guide shows how to wire up the email MCP server and run a real subject line A/B test for your next send.

Why run subject line tests inside Windsurf

Windsurf already understands your project context, so it's a natural place to iterate on newsletter copy. With marginal connected as an MCP server, the same agent that helps you ship code can generate subject line variants, launch a test, and report back which one wins.

You skip the usual context switching between editor, ESP dashboard, and spreadsheets. The whole loop — write, send, measure — happens through the AI agent email marketing tools exposed by marginal.

Connecting marginal to Windsurf

Add marginal as an MCP server in Windsurf and authenticate with your Bearer API key (it starts with marg_live_). marginal is hosted, so there's nothing to self-host — Windsurf talks directly to the endpoint at https://marginal.sh/mcp.

Once connected, the four marginal tools become available to your agent: generate_variants, launch_test, get_results, and recommend_next. Full setup details live in the docs at https://marginal.sh/docs/.

Running a newsletter subject line A/B test

Start by asking Windsurf to call generate_variants with the angle of your newsletter — for example a product roundup or a weekly digest. The agent returns a set of candidate subject lines you can refine in chat.

When you're happy, have the agent call launch_test to ship the managed send. marginal handles delivery and open/click tracking. After it runs, get_results gives you within-test lift so you know which subject line moved opens, and recommend_next suggests where to take the following send.

Tips for better newsletter tests

Keep each subject line test focused on one variable — tone, length, or a specific hook — so the lift you measure in Windsurf is interpretable. Vague tests produce vague winners.

Treat results as a feed for your next issue rather than a one-off. Logging which angles consistently win helps your AI agent propose stronger newsletter subject lines over time.

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