← All guides marginal.sh

How to Automate Cart Recovery Emails with an Agent

Updated June 2026 · Hosted email MCP server

Abandoned carts are the highest-intent audience you have. This how-to guide shows you how to automate cart recovery emails with an agent using marginal's email MCP server — from generating subject line variants to launching a test and reading lift metrics.

Connect the marginal email MCP server

Before your agent can send anything, point your MCP client at marginal. It's hosted, so there's no infrastructure to run — you only need your Bearer API key. Add the server endpoint at https://marginal.sh/mcp and authenticate with a key in the marg_live_... format.

marginal works with Cursor, Claude Desktop, Claude Code, Codex, Windsurf, Cline, Continue, and Zed. Once connected, the agent gains four tools: generate_variants, launch_test, get_results, and recommend_next.

Generate cart recovery subject line variants

Cart recovery hinges on the subject line — it decides whether the reminder is opened at all. Have your agent call generate_variants with the context of an abandoned cart: the product left behind, an optional incentive, and the tone you want.

The goal is a handful of distinct angles so the subject line A/B test has real contrast. Ask the agent for variety rather than near-duplicates.

Launch the test and let the agent manage the send

Pass the chosen variants to launch_test to start a managed send across your recovery segment. marginal handles delivery and tracks opens and clicks, so the agent doesn't need to wire up its own sending stack.

This is where AI agent email marketing earns its keep: the agent splits traffic, records engagement, and computes within-test lift between subject lines automatically — no manual spreadsheet math.

Read results and pick the next move

After the send circulates, call get_results to pull open rates, click rates, and lift for each variant. Then use recommend_next so the agent suggests whether to promote a clear winner, keep testing, or refine the angle for the next cart recovery batch.

Loop this into your abandoned-cart trigger and the whole flow runs hands-off: each new wave of abandoners gets the current best subject line while the agent quietly tests the next contender. See the full tool reference in the marginal docs.

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