← All guides marginal.sh

Bearer Auth and the marginal Email MCP

Updated June 2026 · Hosted email MCP server

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.

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.

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.

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.

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