← All guides marginal.sh

Email MCP Server for OpenAI Codex

Updated June 2026 · Hosted email MCP server

marginal is a hosted email marketing MCP server that plugs into OpenAI Codex. Once connected, your agent can draft subject line variants, launch A/B tests, and read back open and click results without leaving your workflow.

Why pair OpenAI Codex with marginal

OpenAI Codex is built to take action on your behalf, but it needs structured tools to do anything useful with email. marginal exposes a small, well-defined set of MCP tools so Codex can reason about campaigns and then execute them through a hosted endpoint.

Because marginal is fully hosted, there's no server to run or maintain. You point OpenAI Codex at the MCP endpoint, authenticate with a Bearer API key, and the tools become available to the agent immediately.

Configure the OpenAI Codex MCP connection

Add marginal as an MCP server in your OpenAI Codex configuration. Use the hosted endpoint and pass your API key as a Bearer token. Keys start with marg_live_ and are issued from your marginal account.

Save the config, restart Codex, and confirm the four marginal tools appear in the agent's available tool list.

{
  "mcpServers": {
    "marginal": {
      "url": "https://marginal.sh/mcp",
      "headers": {
        "Authorization": "Bearer marg_live_xxxxxxxxxxxx"
      }
    }
  }
}

Run a subject line A/B test from Codex

With the email MCP integration live, you can describe a campaign in plain language and let OpenAI Codex handle the mechanics. A typical loop has the agent generate variants, launch a test, then check results once enough opens and clicks have accumulated.

This makes AI agent email marketing concrete: Codex isn't just suggesting copy, it's running a real subject line A/B test and reporting which variant wins based on measured lift.

What to know before you start

The free tier covers 100 experiments per month, which is enough to validate the OpenAI Codex MCP workflow before scaling up. Tracking, sends, and lift metrics are all handled by the hosted marginal service.

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