How to Connect the marginal MCP Server
If you want your AI coding assistant to run real email experiments, the first step is to connect the marginal MCP server. This guide walks through what the server does, how authentication works, and how an agent uses it to test subject lines and read results.
What you get when you connect marginal
marginal is a hosted email MCP server built for AI agents. Once you connect it, your agent can generate subject line variants, launch a managed send, and pull back open and click data without you wiring up a separate sending stack.
Because marginal is hosted at https://marginal.sh/mcp, there is nothing to deploy or self-host. You point your MCP client at the endpoint, add a Bearer key, and the tools become available inside your editor or agent.
- generate_variants — draft candidate subject lines for a campaign
- launch_test — start a subject line A/B test on a managed send
- get_results — read open/click tracking and within-test lift
- recommend_next — get the next action based on live results
Authentication and the endpoint
The server lives in the registry as sh.marginal/mcp and exposes a single endpoint: https://marginal.sh/mcp. Authentication uses a Bearer API key in the form marg_live_..., which you generate from your account.
You do not need to bring Mailchimp or Klaviyo credentials to get started — marginal handles the managed sends and tracking itself. That keeps the connection setup short: an endpoint and one key.
- Registry name: sh.marginal/mcp
- Endpoint: https://marginal.sh/mcp
- Auth: Bearer API key (marg_live_...)
- Free tier: 100 experiments per month
Running a subject line A/B test through your agent
Once connected, the flow is conversational. Ask your agent to draft variants for a campaign, then have it call launch_test to put those variants live across your list segment. The server splits traffic and tracks engagement automatically.
After the test runs, get_results returns within-test lift metrics so you can see which subject line is winning, and recommend_next suggests whether to call the test or keep gathering data. This is the core loop of AI agent email marketing: draft, send, measure, decide.
- Generate a set of candidate subject lines
- Launch the A/B test with a single tool call
- Track opens and clicks per variant
- Read lift and let the agent recommend the next move
Supported clients
The marginal email MCP server works with the MCP clients developers already use, so you can connect it from your existing workflow rather than switching tools.
Full configuration steps for each client live in the docs at https://marginal.sh/docs/.
- Cursor and OpenAI Codex
- Claude Desktop and Claude Code
- Windsurf and Zed
- Cline and Continue
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