Test Newsletter Subject Lines in Claude Code
Connect Claude Code to marginal and you can draft, launch, and measure newsletter subject line tests from a single conversation. The agent calls marginal's email MCP server directly, so you stay in your terminal while the experiment runs.
Why run subject line tests from Claude Code
Claude Code is already where you write, refactor, and ship. Wiring in an email MCP server means your newsletter workflow lives in the same place — no context switch to a separate dashboard to spin up a subject line A/B test.
marginal is a hosted MCP server, so there's nothing to deploy. Once Claude Code can reach the endpoint, you describe the newsletter you're sending and let the agent handle variant generation, the send, and the readout.
- Ask in plain language: "generate five subject lines for this week's digest"
- Launch a subject line test against your list without leaving the editor
- Pull open and click results back into the conversation
- Iterate on copy and re-test in the same session
The marginal tools behind a newsletter test
marginal exposes four MCP tools that map cleanly onto a newsletter subject line test. Claude Code chooses the right one based on what you ask for.
- generate_variants — produce candidate newsletter subject lines from your brief or draft
- launch_test — start a subject line A/B test as a managed send with tracking
- get_results — fetch open/click metrics and within-test lift while the test runs
- recommend_next — let the agent suggest a winner or a follow-up variant
A typical newsletter workflow
Say you publish a weekly digest. In Claude Code, paste the lead paragraph and ask for subject line options. The agent calls generate_variants, you pick a few, and it launches the subject line A/B test across a sample of your list.
Once opens come in, ask for results. Claude Code calls get_results and reports lift between variants, then uses recommend_next to advise which line to send to the remainder. This is AI agent email marketing with a tight feedback loop — every newsletter teaches the next one.
- Draft → generate_variants → choose finalists
- launch_test on a holdout sample of your newsletter audience
- get_results for opens, clicks, and within-test lift
- recommend_next, then send the winner to everyone
Getting connected
Point Claude Code at the marginal endpoint at https://marginal.sh/mcp and authenticate with your Bearer API key (the marg_live_ token from your account). The free tier covers 100 experiments per month, which is plenty for weekly newsletter testing.
Full setup steps and tool references live in the docs at https://marginal.sh/docs/. After that, testing newsletter subject lines in Claude Code is just another part of the conversation.
- Endpoint: https://marginal.sh/mcp
- Auth: Bearer API key (marg_live_...)
- Registry: sh.marginal/mcp
- Docs: 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