Subject Line Generator API for AI Agents
If you're searching for a subject line generator API, marginal exposes generation and testing as MCP tools your AI agent can call directly — no glue code, no separate test harness.
What a subject line generator API should do
Most subject line tools stop at producing copy. A useful API closes the loop: it generates candidate lines, ships them to real recipients, and reports which one actually won. marginal handles all four steps through a single hosted MCP server.
Instead of stitching together a copy generator and a separate send platform, you call typed tools that return structured data your agent can reason over.
- generate_variants — produce subject line candidates for a brief
- launch_test — start a subject line A/B test on a managed send
- get_results — pull open/click rates and within-test lift
- recommend_next — get a data-backed suggestion for the next send
Why marginal works as the API layer
marginal is a hosted email MCP server, so there's nothing to deploy or maintain. You authenticate with a Bearer API key (marg_live_...) and point your client at https://marginal.sh/mcp.
Because it speaks the Model Context Protocol, any MCP-capable client treats subject line generation and testing as first-class agent capabilities rather than raw HTTP endpoints you have to wrap yourself.
- Endpoint: https://marginal.sh/mcp
- Registry: sh.marginal/mcp
- Auth: Bearer API key
- Free tier: 100 experiments per month
Running a subject line A/B test end to end
A typical flow for AI agent email marketing looks like this: describe the campaign, generate variants, launch the test, then read results once enough opens accumulate. marginal tracks opens and clicks and computes lift within each test so the winner is unambiguous.
Your agent can chain these calls automatically — generate, launch, wait, fetch results, and call recommend_next to inform the following campaign.
- Generate 3–5 candidate lines from a short brief
- Launch a split test across a managed send
- Measure open and click rates with within-test lift metrics
- Promote the winner and feed learnings into the next send
Works in the tools you already use
marginal connects to the major MCP clients, so the same subject line generator API is available whether you're prototyping in an editor or running an automated marketing agent.
Supported clients include Cursor, OpenAI Codex, Claude Desktop, Claude Code, Windsurf, Cline, Continue, and Zed. See the docs at https://marginal.sh/docs/ to wire one up.
- Editor-based agents: Cursor, Zed, Windsurf, Continue, Cline
- Assistant clients: Claude Desktop, Claude Code, OpenAI Codex
- Docs and setup guides: 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