Bearer Auth and the marginal Email MCP
If you're wiring an AI agent into email workflows, the first thing you hit is authentication. marginal uses Bearer auth for its email MCP server, so every request carries a single API key. Here's how that works and why it keeps agent integrations simple.
How Bearer auth works on the marginal MCP endpoint
marginal exposes a hosted email MCP server at https://marginal.sh/mcp. Authentication is handled with a standard Bearer token: you send your API key in the Authorization header, and the server scopes every tool call to your account.
Keys follow the marg_live_ prefix so they're easy to recognize in logs and config files. There's no OAuth dance and no separate token exchange step — one key authenticates generate_variants, launch_test, get_results, and recommend_next.
- Header format: Authorization: Bearer marg_live_...
- One key authenticates all four MCP tools
- No self-hosting — marginal is a hosted server
- Keys are scoped to your account and experiments
Why Bearer auth fits AI agent email marketing
Agents make many short-lived requests, often unattended. A Bearer token is a clean fit: the agent reads the key from its MCP client config and attaches it to each call, no interactive login required.
That matters when an autonomous loop is generating subject line variants, launching a send, and polling results. With Bearer auth MCP email flows stay deterministic — the same credential drives the whole experiment lifecycle.
- Stateless requests suit agent automation
- Store the key once in your MCP client
- Rotate the key without changing tool logic
- Works across Cursor, Claude Code, Windsurf, Cline, and more
From auth to a running subject line A/B test
Once your Bearer key is in place, the email MCP server does the actual marketing work. Ask your agent to generate_variants for a campaign, then launch_test to start a subject line A/B test against a managed send.
marginal tracks opens and clicks and reports within-test lift, so get_results gives the agent real signal rather than raw counts. recommend_next then suggests the variant to roll forward — all under the same authenticated session.
- generate_variants — draft subject line candidates
- launch_test — start an A/B test with managed sends
- get_results — open/click tracking and lift metrics
- recommend_next — pick the winning variant
Keeping your API key safe
Because the Bearer key is the only credential, treat it like a password. Keep it out of source control, inject it through environment variables or your MCP client's secret store, and rotate it if it leaks.
The free tier covers 100 experiments per month, which is plenty to validate an agent integration before scaling. See the marginal docs at https://marginal.sh/docs/ for the full auth and tool reference.
- Never commit marg_live_ keys to a repo
- Use env vars or your client's secret manager
- Rotate keys on any suspected exposure
- Free tier: 100 experiments/month to test the setup
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