Working with marginal dashboard API keys
Your marginal dashboard API keys are what let an AI agent authenticate against the marginal email MCP server and start running subject line A/B tests. This guide covers where to find them, how the Bearer auth works, and how to wire a key into your client safely.
Where to find your API keys
API keys live in the marginal dashboard. Once you have an account, you can generate a key, copy it, and store it somewhere your AI agent can read it at runtime. Keys are scoped to your workspace and prefixed with marg_live_ so they are easy to spot in logs and config files.
- Open the dashboard and navigate to the API keys section
- Create a new key — it will look like marg_live_...
- Copy the key once; treat it like a password
- Keys authenticate every request to https://marginal.sh/mcp
How the key authenticates the email MCP server
marginal is a hosted email MCP server, so there is nothing to self-host. Your client connects to the endpoint at https://marginal.sh/mcp and passes your key as a Bearer token in the Authorization header. That single key unlocks all four MCP tools: generate_variants, launch_test, get_results, and recommend_next.
Because the server is hosted, the key is the only credential you manage. There is no separate sending infrastructure to configure — managed sends, open and click tracking, and within-test lift metrics all run behind the same authenticated endpoint.
Using a key for AI agent email marketing
Once your key is in place, your AI agent can drive a full subject line A/B test loop without leaving the editor. The agent asks marginal to draft variants, launches a managed test, polls results, and requests a recommendation for the next iteration.
Supported clients include Cursor, OpenAI Codex, Claude Desktop, Claude Code, Windsurf, Cline, Continue, and Zed. Each one reads the same marg_live_ key, so moving a workflow between tools is just a matter of copying the same config.
- generate_variants — produce candidate subject lines
- launch_test — start a managed subject line A/B test
- get_results — pull open/click and lift metrics
- recommend_next — get the data-backed next step
Keeping keys safe and within limits
Store keys in environment variables or your client's secret store rather than committing them to a repository. If a key is exposed, rotate it from the dashboard and update your config. The free tier includes 100 experiments per month, which is plenty to validate AI agent email marketing workflows before scaling up.
Full setup details and tool references are in the marginal docs at https://marginal.sh/docs/.
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