marginal.sh MCP setup: connect your AI agent to email testing
This guide walks through the marginal.sh MCP setup process — from getting an API key to running your first subject line A/B test. marginal is a hosted email MCP server, so there's nothing to deploy and no self-hosted infrastructure to babysit.
What you need before setup
The marginal.sh MCP setup is intentionally lightweight. Because marginal is hosted, you connect to a single endpoint and authenticate with a Bearer API key — no provider keys, no server to run.
- An MCP-capable client: Cursor, Claude Desktop, Claude Code, Codex, Windsurf, Cline, Continue, or Zed
- A marginal API key in the form marg_live_... from your account
- The endpoint: https://marginal.sh/mcp
- The free tier covers 100 experiments/month to test the workflow
Configuring the email MCP server
Add marginal as a remote MCP server in your client's config, pointing it at https://marginal.sh/mcp and passing your key as a Bearer token. Most clients support remote servers natively; consult the marginal docs for the exact config shape for your editor.
Once connected, the email MCP server exposes its tools to your agent. From there, the agent can generate, launch, and read results without leaving your editor.
- generate_variants — draft subject line candidates
- launch_test — start a managed subject line A/B test
- get_results — pull open/click tracking and within-test lift
- recommend_next — get a data-backed suggestion for the next send
Running your first subject line A/B test
With the connection live, AI agent email marketing becomes a conversation. Ask your agent to generate variants for a campaign, launch the test, and report back the winner once enough data has accrued.
marginal handles the managed send and tracking, so the agent's job is to interpret lift metrics and decide what to ship next. A typical loop: generate_variants → launch_test → get_results → recommend_next.
- Describe the email and audience in natural language
- Let the agent call launch_test to start the experiment
- Review within-test lift via get_results before declaring a winner
Verifying and troubleshooting
After completing the marginal.sh MCP setup, confirm the tools appear in your client's tool list. If they don't, double-check the endpoint URL and that your Authorization header carries the full marg_live_ key.
For client-specific config snippets and the latest tool schemas, see the documentation at https://marginal.sh/docs/.
- No tools showing? Re-check the https://marginal.sh/mcp endpoint
- Auth errors? Confirm the Bearer key is complete and active
- Hitting limits? The free tier allows 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