← All guides marginal.sh

How to Connect an MCP Server for Email Marketing

Updated June 2026 · Hosted email MCP server

This how-to guide walks you through connecting an MCP server for email marketing using marginal — the hosted email MCP server for AI agents. In a few steps you'll wire up an API key, register the endpoint, and let your agent run a subject line A/B test.

What you need before you connect

marginal is fully hosted, so there's nothing to deploy and no self-hosted MCP server to maintain. You only need an MCP-capable client and an API key to start.

Because marginal handles managed sends and tracking, you won't be juggling provider credentials in your config. The single bearer token authenticates every tool call.

Step 1: Get your API key and endpoint

Grab your bearer key from your marginal account, then point your client at the registry name sh.marginal/mcp or the direct endpoint at https://marginal.sh/mcp. marginal authenticates with a single Bearer API key, so keep marg_live_... values out of source control and in your client's secret config or environment.

Once the endpoint and key are in place, your AI agent can discover the four core tools: generate_variants, launch_test, get_results, and recommend_next.

Step 2: Run your first subject line A/B test

With the connection live, this marginal MCP tutorial gets practical fast. Ask your agent to draft variants, launch the experiment, and report lift — all through MCP tool calls.

Each tool maps to a clear stage of the experiment lifecycle, so an AI agent email marketing workflow reads almost like plain English.

Step 3: Read results and iterate

After a subject line A/B test runs, call get_results to see opens, clicks, and within-test lift for each variant. marginal scopes lift to the test itself, so you compare like-for-like instead of guessing against historical baselines.

Use recommend_next to close the loop. Your agent can deploy the winner, then immediately generate a fresh round of variants — turning a one-off test into a continuous optimization habit without leaving your editor.

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