← All guides marginal.sh

Codex MCP Email Integration with marginal

Updated June 2026 · Hosted email MCP server

If you run OpenAI Codex and want it to handle real email experiments, marginal exposes a hosted email MCP server that Codex can call directly. This guide covers what the Codex MCP email integration does, the tools available, and how subject line testing fits into an agent workflow.

What the Codex MCP email integration gives you

marginal is a hosted MCP server for email marketing, which means Codex talks to it over the Model Context Protocol at https://marginal.sh/mcp using a Bearer API key. There's nothing to deploy — no self-hosted MCP server to maintain. Codex gets a set of tools it can invoke as part of a task, and marginal handles the sends, tracking, and lift math.

The MCP tools Codex can call

Once connected, Codex sees four tools. Together they cover a full subject line A/B test loop: draft candidates, run the test, read results, and decide what to do next.

A subject line A/B test, driven by an agent

The point of AI agent email marketing is that Codex can chain these tools without you copy-pasting between tools. You describe the campaign, Codex generates variants, launches the test, and comes back with the winner once enough opens and clicks land.

Because marginal reports within-test lift rather than just raw open rates, the recommend_next output is grounded in how variants performed against each other in the same send — useful when Codex is reasoning about which subject line to scale.

Beyond Codex

The same email MCP server works across other MCP clients, so a workflow you prototype in Codex can move to your wider toolchain without rewriting anything. The tool surface and endpoint stay identical.

Supported clients include Cursor, Claude Desktop, Claude Code, Windsurf, Cline, Continue, and Zed alongside OpenAI Codex. Full setup details live in the 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.

Documentation · Sign up · FAQ