Email MCP server for Claude Code
Wire marginal's hosted email MCP server into Claude Code and let your coding agent design subject line A/B tests, launch managed sends, and report on lift — all without leaving the terminal.
Why run email marketing from Claude Code
Claude Code already lives where you build. Adding the marginal email MCP integration means the same agent that edits your templates and copy can also test and ship them. You describe the experiment in plain language and Claude Code calls the right tools.
marginal is hosted, so there's no MCP server to install or maintain. You point Claude Code at the endpoint, authenticate with a Bearer API key, and the tools appear in your session.
- No self-hosting — marginal runs the email MCP server for you
- Subject line A/B tests with open and click tracking built in
- Within-test lift metrics so the agent can pick a winner
- Free tier of 100 experiments per month to get started
Connect Claude Code to the marginal MCP
Claude Code reads MCP servers from its configuration. Add marginal as a remote MCP server pointing at https://marginal.sh/mcp and pass your key (marg_live_...) as a Bearer token in the Authorization header.
Once saved, restart Claude Code and confirm the marginal tools are listed. You're ready to drive AI agent email marketing from the prompt.
{
"mcpServers": {
"marginal": {
"url": "https://marginal.sh/mcp",
"headers": {
"Authorization": "Bearer marg_live_your_key_here"
}
}
}
}
The tools Claude Code can call
Once the email MCP server for Claude Code is connected, the agent has four tools that map cleanly to an experiment lifecycle. Ask it to draft variants, launch a test, then come back later for results and a recommendation.
- generate_variants — produce subject line candidates for an A/B test
- launch_test — start a managed send and split traffic across variants
- get_results — read open/click tracking and within-test lift
- recommend_next — let marginal suggest the next move based on results
A sample Claude Code workflow
A typical loop in Claude Code reads almost like a conversation. The Claude Code MCP session keeps state between tool calls so the agent can reason about what it just launched.
Check the docs at https://marginal.sh/docs/ for tool arguments and response shapes if you want Claude Code to handle more complex multi-variant tests.
- "Generate 4 subject lines for our re-engagement email" → generate_variants
- "Launch a subject line A/B test with those variants" → launch_test
- "How is the test doing?" → get_results with lift per variant
- "What should we send next?" → recommend_next
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