Connect Codex to your email through Mailopoly
Codex and Mailopoly: two commands give Codex your email — every account you own, searched together, already sorted — under permissions you set.
7-day free trial, no credit card.
Run codex mcp add mailopoly --url https://fastapi.prod.aws.mailopoly.com/mcp-server/, then codex mcp login mailopoly, tick reading, making changes or sending, and Codex can search, draft and send across Gmail, Outlook, Yahoo, iCloud and any IMAP mailbox — and, with business channels added to your plan, your Slack, Teams and WhatsApp too. Works in Codex CLI, the ChatGPT desktop app and the IDE extension; custom MCP servers aren't available to Codex cloud tasks.
This page is about OpenAI's Codex — the CLI, the desktop app and the IDE extension, which people also write as codex cli or openai codex. It is not about the ChatGPT chat itself, which has its own guide at Connect your email to ChatGPT.
Does Codex support Gmail without Mailopoly?
In the desktop app, yes. Codex can use ChatGPT's Gmail and Outlook Email plugins — search, read threads, draft, organise and triage — when you run Codex inside the ChatGPT desktop app with a ChatGPT login. They are OpenAI-hosted, so they aren't available under API-key authentication, and the IDE extension doesn't support plugins at all. Each reaches one account of one provider at a time.
Mailopoly is the route that works in the CLI and the IDE extension as well as the app, covers Yahoo, iCloud and IMAP alongside Gmail and Outlook, puts every account in one question, and hands Codex mail that is already filtered and summarised with invoices, events and deliveries extracted. Reading, making changes and sending are separate grants you can revoke.
Before you start
- Codex, set up and signed in. This guide covers what happens once you have it.
- A Mailopoly account — start one here, 7-day free trial, no credit card.
- The mailboxes you want it to see, connected to Mailopoly. Gmail and Outlook connect with a Google or Microsoft sign-in; Yahoo, iCloud, AOL and IMAP mailboxes use an app password you enter on Mailopoly's own page — never in a chat or a config file. The connect guides have the exact steps for each provider.
Connect Codex to your email in three steps
1Connect your mailboxes to Mailopoly
- Start a Mailopoly account at mailopoly.com/sign-up — 7-day free trial, no credit card.
- Connect each mailbox you want Codex to reach: Gmail or Outlook with a Google or Microsoft sign-in, anything else with an app password from your provider's security settings. Each account gets one line in the same inbox — Gmail, Outlook, Yahoo, iCloud, any IMAP mailbox.
- If you want Codex to have an address of its own, pick one of the @mly.life addresses included in your plan and keep it for the agent's correspondence. It's still your address, on your account, so you see everything it sends and receives.
2Add Mailopoly to Codex
- Run
codex mcp add mailopoly --url https://fastapi.prod.aws.mailopoly.com/mcp-server/. (Or add[mcp_servers.mailopoly]withurl = "https://fastapi.prod.aws.mailopoly.com/mcp-server/"to~/.codex/config.toml.) - Run
codex mcp login mailopoly. Your browser opens; sign in with your Mailopoly account. Codex registers itself with Mailopoly automatically — no client ID needed. - Tick what Codex is allowed to do — reading for search and summaries; making changes for drafts, labels, tasks and reminders; sending only if you want it to send, from any connected address or your @mly.life address.
- The same configuration is shared by Codex CLI, the desktop app and the IDE extension on that machine. Ask.
Codex cloud tasks (the ones that run on OpenAI's servers) can't load a custom remote MCP server today; use the CLI, desktop app or IDE extension for anything that touches your mail.
Official docs: OpenAI: MCP servers in Codex ↗
3Give it a job
Whatever you've connected to Mailopoly is what Codex can reach. Some jobs people hand over on day one:
- Go through this week's mail across all my accounts and list every invoice with its amount and due date.
- Find the thread with the recruiter and draft a polite decline from my personal address; leave it in drafts.
- Check My Day and tell me what's overdue.
What Codex can do with your email through Mailopoly
- Search every account in one question — Gmail, Outlook, Yahoo, iCloud and IMAP together, or one account by name — by sender, date, topic or the half-remembered phrase somewhere in the body.
- Work from the Cleanbox — your personal, non-promotional mail already separated from newsletters, promotions and automated noise, so a summary is a summary of what matters.
- Read summaries, not raw messages — every email arrives already summarised, with invoices, events and deliveries extracted with their amounts, dates and status.
- Keep My Day — see tasks and commitments pulled from every inbox, add tasks and reminders, tick things off.
- Draft and send — save drafts to Mailopoly for you to review, or with the send permission send from whichever connected address fits the conversation, or from your @mly.life address.
- Know what things cost — look up an invoice, total the week's bills, see what your subscriptions add up to.
- Tidy up — label, file or clear mail in bulk, when you tell it to.
- Business channels too — add them to your plan and your Slack, Teams, WhatsApp, Instagram, Messenger and TikTok messages sit in the same connection, and replies go back out through the channel they arrived on.
Should you give an agent your email account at all?
The warnings you'll find are right about one thing: an agent that logs in to Gmail as you, with your password, on a machine you don't control, is a bad idea. Mailopoly doesn't work that way. Your Google and Microsoft accounts connect to Mailopoly through their own sign-in, and other providers through an app password you enter on Mailopoly's page — Codex never has a password in its hands and never logs in to your provider at all.
Codex connects to Mailopoly with a scoped OAuth sign-in. Reading, making changes and sending are separate grants, sending is flagged as a confirm-first action in the protocol itself, every tool call is audit-logged against your account, and you can revoke Codex from Settings → Security → Connected AI assistants in the Mailopoly app — access ends immediately. Mailopoly has a SOC 2 Type 1 report and is independently security-assessed to CASA Tier 2 by TAC Security. If you want a hard line, give Codex reading only, or give it one of your @mly.life addresses to send from so nothing leaves under your name unless you say so. More on whether it's safe to give AI access to your email and the security page.
What goes wrong with Codex, and the fix
- `codex mcp login` opens nothing. Codex needs a browser to finish the OAuth sign-in. On a headless machine, sign in once from a desktop and copy
~/.codex/config.toml— tokens stay with Codex, not in the file. - It worked in the app but not in a cloud task. Custom remote MCP servers are local-only in Codex; cloud tasks don't see them.
- It only reads mail when you prompt it. Codex acts within a turn. For Codex to be *messaged* by Mailopoly, and to message you when it's done, see the Codex agent guide — it covers the headless loop for unattended replies.
- It connected but the tools don't answer. Mailopoly's tools respond on an active subscription or trial. If the trial has lapsed, the connection stays but calls return nothing useful until the plan is active.
- It can read but won't draft or send. Those are separate permissions. Sign in again from Codex and tick making changes or sending — or check what it holds under Settings → Security → Connected AI assistants in Mailopoly.
Related: Codex on the Switchboard · Connect your email to ChatGPT · Email for AI agents · Is it safe to give AI access to your email?
Good to know.
Should I use the Gmail plugin or Mailopoly?
If you work in the ChatGPT desktop app with one Google account, the Gmail plugin is enough. Use Mailopoly when you work in Codex CLI or the IDE extension, authenticate with an API key, have more than one account or a non-Google provider, or want your mail pre-sorted with invoices, events and deliveries extracted.
Can Codex notify me when a long task finishes?
On its own, Codex can ring the terminal bell or show a desktop notification when a turn finishes and run a script through its notify hook. Through Mailopoly the message itself reaches you — in your inbox and on your phone — and Codex can ask you a question and hand work to Claude Code or another agent. The Codex agent guide covers that side.
Does Codex get my Gmail password?
No. Gmail and Outlook connect to Mailopoly through Google's and Microsoft's own sign-in, and other providers through an app password you enter on Mailopoly's page, never in a chat or a config file. Codex connects to Mailopoly with a scoped, revocable OAuth sign-in and only ever gets the permissions you ticked — reading, making changes and sending are separate.
Can Codex have its own email address?
It can work from one of your @mly.life addresses, which are included in every Mailopoly plan — one on Single, two on Duo and Pro, three on Unlimited. Mail it sends goes out from that address, and whatever comes back — replies, a sign-up confirmation, a verification code — lands in your Mailopoly inbox, where Codex reads it like any other mail and so can you. It's your address on your account, so no bot logs in anywhere as you and there is nothing you can't see.
Does this work with Outlook, Yahoo, iCloud or a work mailbox?
Yes. Through Mailopoly Codex reaches every account you've connected — Gmail, Outlook.com and Microsoft 365, Yahoo, iCloud, AOL and any IMAP mailbox — in one connection, and can search them together or one at a time.
Is there a free trial?
Yes. Mailopoly starts with a 7-day free trial and no credit card, and the MCP connection is included in every plan. The tools respond while a trial or subscription is active.