← All guides marginal.sh

CrewAI Email Campaign Agent: Run Subject Line Tests via MCP

Updated June 2026 · Hosted email MCP server

If you're orchestrating multi-agent workflows in CrewAI and want one of those agents to actually send and optimize email, marginal gives it the tools to do so. This guide shows how a CrewAI email campaign agent can generate variants, launch tests, and read lift metrics through a hosted email MCP server.

What the agent needs to handle a campaign

A useful AI agent email marketing role isn't just copywriting — it's the full loop: drafting subject lines, splitting an audience, sending, then deciding what to do next based on real engagement. CrewAI is good at coordinating that loop across roles, but it needs a backend that can run an actual subject line A/B test and report results.

marginal is a hosted email MCP server that exposes exactly those primitives as tools. Your CrewAI email campaign agent calls them like any other tool, so you don't write send logic or tracking pipelines yourself.

How a CrewAI crew maps to marginal's tools

A natural setup is a small crew where one agent owns ideation and another owns measurement. The writer agent calls generate_variants and launch_test; the analyst agent polls get_results and calls recommend_next once enough data lands. CrewAI's task delegation keeps the two from stepping on each other.

Because marginal manages the send and tracking, your agents stay focused on decisions rather than infrastructure. There's no self-hosted server to operate and no separate tracking service to wire up.

Connecting CrewAI to the endpoint

marginal lives at the MCP endpoint https://marginal.sh/mcp and authenticates with a Bearer API key in the marg_live_ format. Point your CrewAI tool layer at that endpoint, supply the key, and the four tools become available to any agent in the crew.

You don't connect provider credentials like Mailchimp or Klaviyo keys to get started — marginal handles the managed send side. Full tool schemas and request examples are at https://marginal.sh/docs/, and the same MCP integration works from clients like Cursor, Claude Code, Windsurf, Cline, Continue, and Zed if you want to drive it interactively too.

A practical first run

Start small: have the crew generate three or four subject lines for one campaign, launch a subject line A/B test on a representative slice of your list, and let it report lift after the test window. Once the loop is stable, let recommend_next drive whether to roll the winner out or iterate on new angles.

Keeping each step as a discrete tool call also makes the agent's reasoning auditable — you can log what was generated, what was launched, and which variant won, which is exactly what you want from an autonomous email workflow.

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