// agents · codex

Email for Codex, three ways.

Wire OpenAI Codex to Drin however it runs: the MCP server for tool calls, the CLI for scripted steps, or plain REST in generated code. Same capabilities, same key — send, receive and reply with it.

codex · mcp or rest
// MCP config — illustration; exact setup in the docs
{
  "mcpServers": {
    "drin": {
      "command": "npx",
      "args": ["@drin00/mcp"],
      "env": { "DRIN_API_KEY": "drin_live_…" }
    }
  }
}

# …or skip MCP and call the REST API from generated code:
curl https://api.drin.run/v1/emails \
  -H "Authorization: Bearer $DRIN_API_KEY" \
  -d '{ "from":"hello@drin.run","to":"u@acme.com","subject":"Hi","text":"It works." }'
// how to connect[01/03]

Pick the path that fits the run.

  1. 1

    Get a key

    Create a scoped API key in the dashboard. All three paths — MCP, CLI and REST — authenticate as that single DRIN_API_KEY.

  2. 2

    Add MCP, or skip it

    Register the MCP server for tool calls, or have Codex use the CLI and REST directly when you'd rather not add a tool server.

  3. 3

    Run it

    Ask Codex to send, triage the inbox, or wire a send into your app — in an interactive session or an unattended CI step.

Exact Codex setup in the docs →

at a glance
Three pathsMCP tools · Drin CLI · REST / SDK
Base URLhttps://api.drin.run/v1
AuthBearer API key via DRIN_API_KEY
Best forAutonomous runs, scripted sends, CI email steps
SetupSee the docs for the exact config
// what codex can do[02/03]

From an autonomous run to a sent email.

01

Send over MCP

Connect Codex to the MCP server and it sends, batches and schedules mail through the same 54 tools every client shares.

02

Script with the CLI

Codex can drive the full Drin CLI — sends, domain verification, inbox triage and replies — inside a shell step or CI job.

03

Generate REST calls

Prefer no extra runtime? Codex writes plain cURL or SDK calls against the documented REST API and your key.

04

Receive & reply

List threads, read a message, and reply in-thread from the agent's own address — so Codex handles responses, not just sends.

// pairs well with[03/03]
// connect codex

Hand Codex your email.

Grab a key, pick MCP, CLI or REST, and let Codex send, receive and reply. Test in the sandbox; production starts at $3 a month.