Building an LLM Email Marketing Workflow
An LLM email marketing workflow is only as good as the tools your agent can call. marginal is a hosted email MCP server that gives AI agents the ability to draft subject lines, run real A/B tests, and read back results — all without leaving the chat.
What an LLM email marketing workflow looks like
Most email work breaks into the same loop: come up with copy ideas, test them on a slice of your list, measure what wins, and ship the winner. The hard part has always been wiring an LLM to the systems that actually send mail and track engagement.
marginal collapses that loop into four MCP tools your agent calls in sequence. The model handles the reasoning; marginal handles the sends, tracking, and statistics.
- generate_variants — produce candidate subject lines or body copy
- launch_test — start a managed subject line A/B test
- get_results — pull open/click and within-test lift metrics
- recommend_next — let the agent decide the follow-up step
Why use an email MCP server instead of glue code
You could script the same flow yourself, but you'd be maintaining send infrastructure, click tracking, and significance math. An email MCP server exposes those as typed tools so the LLM can orchestrate them directly.
Because marginal is hosted at https://marginal.sh/mcp, there is nothing to deploy. You connect a client, authenticate with a Bearer API key, and your agent gains email capabilities immediately.
- No self-hosting — marginal runs the send and tracking layer for you
- Within-test lift metrics so the agent compares variants apples-to-apples
- Works the same whether the agent runs once or on a schedule
Running a subject line A/B test from your agent
A typical pass starts with the agent calling generate_variants for a campaign, then launch_test to split traffic across those variants. Once enough engagement data accumulates, get_results returns opens, clicks, and the measured lift for each option.
From there, recommend_next lets the model close the loop — promote the winning subject line, propose a new round of variants, or stop testing. This is where AI agent email marketing moves from suggestion to action.
- Define the test goal in natural language
- Let the agent generate and launch variants in one conversation
- Read lift metrics back without exporting CSVs
Connecting your client
marginal speaks MCP, so it plugs into Cursor, Claude Desktop, Claude Code, OpenAI Codex, Windsurf, Cline, Continue, and Zed. Point your client at the endpoint, add your marg_live_ key, and the four tools appear in the agent's toolset.
The free tier covers 100 experiments per month, which is plenty to validate a subject line A/B test pipeline before scaling. Full setup details live in the docs at https://marginal.sh/docs/.
- Endpoint: https://marginal.sh/mcp
- Auth: Bearer API key (marg_live_...)
- Free tier: 100 experiments/month
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