Connect the marginal Email MCP Server to Windsurf
marginal is a hosted email marketing MCP server that gives Windsurf direct access to subject line A/B tests, managed sends, and within-test lift metrics. This guide walks through adding the email MCP integration to Windsurf so your AI agent can run real experiments.
Why use an email MCP server with Windsurf
Windsurf's agentic workflow is great at writing code and copy, but it can't measure what actually performs. Wiring an email MCP server for Windsurf closes that loop: the agent generates variants, launches a test, and reads back open and click data without you leaving the editor.
Because marginal is fully hosted, there's nothing to deploy. You point Windsurf at one endpoint with a Bearer API key and the four MCP tools become available to the agent.
- generate_variants — draft multiple subject lines for a subject line A/B test
- launch_test — send the managed test to your audience
- get_results — pull open/click tracking and within-test lift metrics
- recommend_next — let the agent suggest the next experiment
Configure the Windsurf MCP integration
Windsurf reads MCP servers from its configuration. Add marginal as a remote server using the endpoint below and your API key (it starts with marg_live_). Once saved, restart Windsurf so it picks up the new email MCP integration.
{
"mcpServers": {
"marginal": {
"serverUrl": "https://marginal.sh/mcp",
"headers": {
"Authorization": "Bearer marg_live_your_api_key"
}
}
}
}
Run your first subject line A/B test
With the Windsurf MCP connection live, prompt the agent in plain language. The agent maps your request to marginal's tools and handles the managed send for you.
- Ask Windsurf to draft three subject lines for an upcoming campaign
- Have it launch the variants as a subject line A/B test to your list
- Request results once data lands to see opens, clicks, and lift
- Let recommend_next propose a follow-up experiment based on the winner
Tips for AI agent email marketing in Windsurf
Keep prompts specific — name the audience, the goal, and how many variants you want — so the agent picks the right tool and parameters. The free tier covers 100 experiments per month, which is plenty for iterating on subject lines while you tune your AI agent email marketing workflow.
- Reference get_results before recommend_next so suggestions use real lift data
- Store your marg_live_ key securely; never commit it to a repo
- See the full tool reference at https://marginal.sh/docs/
- The same setup works across Cursor, Claude Code, Cline, and Zed if your team uses more than Windsurf
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