← All guides marginal.sh

Running a JSON Payload Email Campaign with marginal

Updated June 2026 · Hosted email MCP server

If your AI agent already speaks JSON, your email campaigns should too. marginal exposes subject line testing and managed sends as MCP tools, so an agent can describe a JSON payload email campaign and get back structured results it can act on.

Why JSON payloads fit email campaigns

A JSON payload email campaign means every part of the workflow — variants, recipients, test config, and metrics — moves as structured data rather than clicks in a dashboard. That's a natural fit for agents and scripts that compose requests programmatically and parse responses without scraping HTML.

marginal's MCP tools accept and return JSON, so the contract between your AI agent and the email layer stays predictable. The agent generates content, launches a test, and reads lift metrics, all through typed tool calls.

Anatomy of a campaign payload

Think of the payload as the description of what to send and how to measure it. You provide the subject line variants you want to compare, the audience the managed send targets, and the test parameters. marginal handles the delivery and tracking, then hands back the numbers.

Because everything is JSON, your AI agent email marketing flow can branch on the response — promote a winner, generate fresh variants, or schedule the next send without a human in the loop.

Running a subject line A/B test from an agent

A typical loop: the agent calls generate_variants for fresh subject lines, passes the best candidates into launch_test to start a subject line A/B test, polls get_results once data accumulates, then calls recommend_next to decide the follow-up. Each step is a JSON request and a JSON response.

marginal is a hosted email MCP server — there's nothing to self-host. You connect over the endpoint at https://marginal.sh/mcp with a Bearer API key, and the free tier covers 100 experiments per month while you iterate.

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