JSON Email Campaign API: Run Tests Through Structured Calls
If you're searching for a JSON email campaign API, you probably want to drive sends and subject line experiments programmatically — not through a UI. marginal exposes exactly that through an MCP server, so AI agents and scripts can request structured JSON in and get structured results back.
What a JSON email campaign API looks like here
marginal is a hosted email marketing MCP server. Instead of a sprawling REST surface, it exposes a focused set of tools that your agent calls with JSON arguments and reads back as JSON. Every step of a campaign maps to one tool, which keeps the interface predictable for code generation.
- generate_variants — produce candidate subject lines from a brief
- launch_test — start a subject line A/B test and managed send
- get_results — read open/click and within-test lift metrics
- recommend_next — get a data-backed suggestion for the next move
Why agents prefer structured tool calls over raw HTTP
An AI agent email marketing workflow benefits from typed tools far more than from hand-rolled HTTP requests. The MCP layer describes each tool's inputs and outputs, so the model knows what JSON to send and how to parse the response — without you writing glue code for every endpoint.
That means a subject line A/B test can be reasoned about end to end: the agent generates variants, launches the test, waits for data, and reads lift, all inside the same conversation or pipeline.
Connecting and authenticating
marginal is fully hosted — there's no self-hosted server to deploy or maintain. You point a compatible MCP client at the endpoint and authenticate with a Bearer API key.
Clients including Cursor, Claude Desktop, Claude Code, OpenAI Codex, Windsurf, Cline, Continue, and Zed can all reach the same JSON tools.
- Endpoint: https://marginal.sh/mcp
- Auth: Bearer API key in the form marg_live_...
- Registry id: sh.marginal/mcp
- Docs and tool schemas: https://marginal.sh/docs/
Get started without committing budget
The free tier covers 100 experiments per month, which is plenty for wiring up a JSON email campaign API into your stack and validating a subject line A/B test workflow end to end. Connect the marginal email MCP server, run a generate_variants call, and confirm get_results returns the metrics you expect before scaling up.
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