Mails.ai
for Codex
Codex saw the mails tools, wrote our webhook handler and reply loop, and tested both.
Step by step
Add mails to Codex
Two commands in the Codex CLI. The IDE extension and the ChatGPT desktop app share the same MCP configuration, so they see the server too.
Add the server
Run
codex mcp add mails --url https://api..mails. ai/mcp Sign in
Run
codex mcp login mails, sign in to mails.ai, pick the workspace and press Allow.Check it
codex mcp listshows the server, and so does/mcpinside Codex.Use it wherever Codex runs
The CLI, the IDE extension and the desktop app share MCP configuration for the same Codex host.
codex mcp add mails --url https://api.mails.ai/mcp
codex mcp login mails
codex mcp listIn action
See it work
in Codex
Press play to run the session. Each call is a real mails tool, and each result has the shape the API returns.
By hand
Prefer config.toml?
Add the server to ~/.codex/config.toml, or to .codex/config.toml in a trusted project. Leave out the key line to sign in with OAuth, or name an environment variable that holds an API key. The MCP server page has the rest.
[mcp_servers.mails]
url = "https://api.mails.ai/mcp"Or skip the file. IDE extension: gear menu → MCP servers → Add server; desktop app: Settings → MCP servers → Add server. Enter mails, choose Streamable HTTP, paste the URL and save, then restart and Authenticate.
Know-how
Teach Codex about email
Three open-source skills teach Codex to send, receive and safely act on email. The command asks which to add.
npx skills add mailsai/skills -a codex“Replies come back as events with an injection score already on them. We deleted a whole layer of parsing code the week we switched, and we gate on the quarantine flag, so our agent never sees the ones that look like attacks.”
“Moving our agent onto our own domain was a few DNS records at the registrar. No nameserver move, and our existing mail kept working. Replies to the agent still come back to its inbox, threaded with the message they answer.”
“The 422 on cold outreach is the feature I didn’t know I wanted. An agent can’t talk itself into emailing strangers.”
“Our tests send to the test address and wait for the real reply, so the whole loop is covered before a customer ever writes in. It answers in about a second, which keeps the suite fast.”
“Adding the MCP server was one JSON block. Claude Code could send and read its own inbox a minute later.”
“A reputation score per agent tells us exactly which one needs attention, instead of one number for the whole account. It comes from each agent’s own replies, bounces and complaints, and we read it from the API.”
“Sends and replies have separate allowances, so a busy inbox never eats our sending quota. Pricing was the easy part.”
“Half our agents are LangGraph in Python and half are Node. Both SDKs make the same calls, so the team doesn’t have to think about it.”
“Signed webhooks, retries with backoff and an event id to dedupe on. The boring plumbing, done properly.”
“We signed up, made a key and sent our first message without talking to anyone, and the free tier never asked for a card. That’s how infrastructure should feel.”
Give your first agent an inbox
Free covers 3,000 emails and 3,000 inbound replies a month, with no card. Upgrade when your agents get busy.
Get your API key