← All guides marginal.sh

Subject Line A/B Testing in Claude Code

Updated June 2026 · Hosted email MCP server

Wire marginal into Claude Code and let your agent generate, launch, and evaluate subject line A/B tests through plain conversation. This guide covers the MCP setup and a practical Claude Code agent workflow for finding subject lines that win.

Connect marginal to Claude Code

marginal is a hosted email MCP server, so there's nothing to deploy. Add the endpoint and your Bearer API key to Claude Code's MCP configuration, and the tools become available in your next session.

Grab a key (marg_live_...) from your marginal dashboard and drop it into the config below.

MCP config for Claude Code

Add marginal to your Claude Code MCP servers. Once it reloads, ask Claude Code to draft and test subject lines directly.

{
  "mcpServers": {
    "marginal": {
      "url": "https://marginal.sh/mcp",
      "headers": {
        "Authorization": "Bearer marg_live_your_key_here"
      }
    }
  }
}

A Claude Code agent workflow for A/B tests

The strength of running a subject line A/B test inside Claude Code is that the whole loop stays in one place. You describe the campaign, the agent calls the right tools in sequence, and you review results without switching to a separate dashboard.

A typical agent workflow looks like this:

Why pair AI agents with email A/B testing

AI agent email marketing works best when generation and measurement live in the same flow. Instead of copy-pasting subject lines into a marketing tool, Claude Code can propose variants, launch the test, and read the lift metrics back to you — closing the loop on what actually performs.

marginal's free tier includes 100 experiments per month, which is plenty for regular subject line A/B test cycles while you build out your agent workflow. See the docs at https://marginal.sh/docs/ for tool parameters and response formats.

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