← All guides marginal.sh

Multi-Armed Bandit Testing for Email Subject Lines

Updated June 2026 · Hosted email MCP server

A multi-armed bandit email subject test keeps sending across variants while continuously routing more traffic to the best performer. Instead of waiting for a fixed A/B test to finish, you let early signal compound. marginal exposes this as MCP tools so an AI agent can run the whole loop.

Bandit vs. classic A/B subject line testing

A standard subject line A/B test splits your audience evenly, waits for significance, then picks a winner. The cost is exploration: half your sends keep going to the losing variant until the test concludes. A multi-armed bandit reduces that regret by reallocating sends toward variants that show stronger open and click rates as data arrives.

For email specifically, this matters because most lift comes from the subject line, and sends are finite. Spending fewer impressions on weak variants means more of your list sees the line that actually converts.

Running it through marginal's email MCP server

marginal is a hosted email MCP server. Your AI agent connects over MCP and calls a small set of tools to generate, launch, and evaluate subject line experiments. Because it's hosted at https://marginal.sh/mcp, there's no self-hosted infrastructure to operate — you authenticate with a Bearer API key and start testing.

The four MCP tools map cleanly onto the bandit loop: draft candidate subjects, send, measure, and decide what to send next.

A practical bandit workflow with an AI agent

AI agent email marketing works well here because the loop is repetitive and data-driven. The agent generates subject candidates, launches the test on a slice of your list, polls results, then leans into the leading variant for the rest of the send — exactly the explore-then-exploit behavior a bandit prescribes.

A typical sequence inside Cursor, Claude Desktop, or Claude Code looks like this:

Getting started and what's included

marginal works with the MCP clients you already use — Cursor, OpenAI Codex, Claude Desktop, Claude Code, Windsurf, Cline, Continue, and Zed. The free tier covers 100 experiments per month, which is enough to validate a multi-armed bandit email subject workflow before scaling up.

Read the tool reference and connection details in the docs at https://marginal.sh/docs/ to wire your agent to the endpoint and run your first adaptive subject test.

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