A minimalist illustration of an AI badge over an email inbox panel, linked to a gear and paper plane representing an assistant wired into Gmail
Last updated on

How to Connect Codex to Gmail (Plugin and MCP)

Yes, you can connect Codex to Gmail, and with Carly you can reach every Gmail and Outlook mailbox from the same session. Connect each account to Carly once, run one codex mcp add line, and a single Codex session searches, drafts, and sends in whichever inbox you name.

The first-party route gets you one inbox. Codex has a Gmail plugin, and it authorizes a single Google identity; the Outlook plugins beside it hold a single Microsoft account the same way. No plugin browser exists in the IDE extension, and nothing runs until you type. Carly is the way past all of it, because it registers as one MCP server that already holds every mailbox you connect to it.

What the Gmail plugin covers

OpenAI’s plugin documentation puts it in one line: “Install the Gmail plugin to work with Gmail.” The documented way to use it is to describe the outcome, with “Summarize unread Gmail threads from today” as OpenAI’s own example.

Read that page carefully before you conclude anything is missing. It names Gmail, Google Drive, Slack, and Codex Security prefixed by “for example,” so the list is illustrative rather than complete. The curated marketplace behind it carries 180 plugins, and browsing it with codex plugin marketplace list turns up first-party outlook-email, outlook-calendar, teams, and sharepoint entries that the prose never mentions. Each ships a manifest naming OpenAI as author and github.com/openai/plugins as the repository.

OpenAI's app directory became a plugin directory on July 9, 2026, shared between ChatGPT and Codex. Plugins are packages that can carry apps, skills, or app templates — a repackaging of how things are listed and discovered, not a change to the MCP plumbing underneath.

That merge is why a Codex user has a Gmail plugin at all. Codex and ChatGPT browse one catalog, so the mail access Codex gets is the mail access ChatGPT gets.

Installing it

In the Codex CLI, enter /plugins to open the plugin browser, install Gmail from the OpenAI tab, and connect the Google account when prompted. The ChatGPT desktop app carries the same directory under its Plugins tab.

Then start a new session. OpenAI’s docs are explicit that bundled skills and tools become available when you start a new chat or CLI session after installation, so the session you installed from will not see them.

One surface never gets it. “Plugins aren’t available in the IDE extension,” per the same page, so a plugin browser is not something to go looking for in VS Code.

Where the plugins stop

Four walls, in the order people hit them. The middle two are written into the plugins’ own skill files and appear in no OpenAI documentation.

One account per provider.

Connector authorization is per identity, not per person. ChatGPT, Claude, and Gemini each hold one Google account at a time, so the second inbox is reachable only by replacing the first. Both OpenAI and Anthropic have open feature requests asking for several named accounts on one connector, which is a fair signal that it is not possible today.

Codex draws its first-party mail access from that shared directory, which means it inherits the shared limit. OpenAI’s own tracker says as much: the open request support multiple named accounts per app/connector notes that “the app/connector model appears oriented around one active connection per provider,” and a second open issue, Gmail connector should support multiple named accounts, reports that “the assistant appears to access only one active Gmail account.”

The Outlook plugin is built the same way. Its own description is “Work with Outlook Email using the configured Microsoft Outlook app connector,” singular, so a second Microsoft 365 mailbox takes the slot rather than sitting beside the first.

Outlook mail goes out as plain text. outlook-email is a write-capable plugin with real actions behind it, including send_email, schedule_email, create_reply_draft, move_email, and send_email_on_behalf. What it will not do is format. The plugin instructs the model to refuse HTML, styled sections, and any markup whose meaning depends on layout, so every send, scheduled send, and reply draft leaves as unformatted text.

Shared and delegated mailboxes are a stricter, separate path. They run through their own actions, list_shared_messages and list_shared_mail_folders, and each call needs the exact mailbox_user_principal_name. The plugin is instructed not to guess that identity from a display name and not to mix a shared message ID into an action meant for the signed-in user, so a delegated inbox is reachable only when you already know the precise address.

Nothing begins on its own. Codex acts when you type. Overnight triage, a reply that has to go out the moment a message lands, a follow-up three days later: none of that starts by itself.

Reach every mailbox: register Carly as an MCP server

Carly holds Gmail and Outlook accounts on its side and exposes all of them to Codex through one MCP server. One config entry, any number of mailboxes, both providers.

  1. Sign in at carlyassistant.com.
  2. Open carlyassistant.com/integrations, find Gmail or Outlook, and click Connect.
  3. Authorize the first account and confirm the address Carly shows.
  4. Return to the integrations page and connect the next identity. Choose Use another account if the provider preselects your previous login.

Mix providers freely. A second Gmail sits beside the first, and an Outlook mailbox sits beside both. If a Google Workspace or Microsoft 365 account needs administrator review, ask that administrator to approve; each tenant decides independently.

Then register the server. The CLI route is one line:

codex mcp add carly --url https://carlyassistant.com/mcp/

Servers added this way land in ~/.codex/config.toml at user scope. The hand-written equivalent:

[mcp_servers.carly]
url = "https://carlyassistant.com/mcp/"

A trusted project can carry its own .codex/config.toml if you would rather scope the server to one repository than to the whole machine. Then authenticate:

codex mcp login carly

That opens the browser OAuth flow. Sign in to the Carly workspace holding your mailboxes, then run codex mcp list to confirm the server is live. Codex supports OAuth against remote HTTP MCP servers, including Client ID Metadata Documents and Dynamic Client Registration, so no secret has to sit in a config file.

Start a fresh session before you go looking for the tools. Codex spawns its MCP servers once at session start and never revisits them while the session runs.

MCP configuration is shared across the ChatGPT desktop app, the Codex CLI, and the IDE extension, which is the surface the plugin route never reaches at all.

Naming the mailbox in a prompt

Roles read better than raw addresses in conversation, but the full address is what makes an action land in the right place. Declare both once:

Treat marcus@gmail.com as Personal, marcus@twilio.com as Main Company, and marcus@instacart.com as Client. Always state the target address before changing anything.

Then name the target on each action:

In marcus@twilio.com, list the sender and subject of the five newest unread messages. Do not change anything.

Draft the reply from marcus@instacart.com. Do not send yet.

Keep approvals on while you are testing. A coding agent holding send rights across two employers’ mailboxes deserves a confirmation step.

Codex plugins and Carly, side by side

Codex pluginsCarly
Gmail accounts at onceOneEvery one you connect
Outlook accounts at onceOneEvery one you connect
Gmail and Outlook togetherOne account of eachAny number of each
Works in the IDE extensionNoYes, over MCP
Says which account it usedNot consistentlyOn every action
Starts when mail arrivesNoYes
Works with no session openNoYes
Adding a fourth mailboxNot possibleNo config change

The half that never starts with a prompt

Wiring Carly into Codex closes the account problem. It does not, by itself, close the bigger one.

There is no such thing as an MCP trigger. The protocol's own working group states plainly that clients find out about server-side changes by polling for them, and a real event mechanism remains unshipped.

The unattended-work gap closed when ChatGPT and Claude Cowork added scheduled runs. Their standard schedulers still start from the clock, not arbitrary events in connected apps; API-triggered ChatGPT Workspace Agents require an external event detector and caller.

Carly’s own side is where that gap closes. Its workflows fire on events and schedules rather than on you typing, so a message arriving is enough to start triage, a draft, a reply, a calendar hold, or a CRM update. Each agent carries its own name, email address, and memory, so a client can write to one directly and the work begins on arrival rather than the next time you open a terminal.

Around the mail sit 260+ native integrations plus your own API key for anything else with a public API. Carly offers free Zapier-style workflows; AI agents start at $35/month.

Connect every inbox at carlyassistant.com.

Quick fixes when Gmail does not respond

ProblemFix
The plugin browser is missingYou are in the IDE extension; use the Codex CLI or the ChatGPT desktop app
No tools in the sessionStart a new session after installing a plugin or adding a server
codex mcp login never completesFinish the browser OAuth flow, then rerun codex mcp list
The provider reused your signed-in accountChoose Use another account rather than the suggested profile
A work account stalls at consentAsk that Google Workspace or Microsoft 365 administrator to approve
Codex answered from the wrong inboxName the full address; roles are for reading, addresses are for acting

Frequently Asked Questions

Does OpenAI Codex integrate with Gmail?

Yes. A first-party Gmail plugin lives in the catalog that ChatGPT and Codex share, installable from the Codex CLI plugin browser or the ChatGPT desktop app. It holds one Google account, and the IDE extension does not support plugins at all.

Can Codex reach two Gmail accounts?

Not through the plugin, which authorizes one Google identity at a time. Connect both accounts to Carly and register one MCP server, and a single Codex session can search or act in whichever inbox you name.

Can Codex connect to Outlook?

Yes. First-party outlook-email and outlook-calendar plugins sit in the marketplace even though the documentation prose never lists them, and they work against a configured Microsoft Outlook connector. That connector holds one account, outbound mail is plain text only, and a shared mailbox needs its exact principal name. Connecting every Microsoft and Google mailbox to Carly and pointing Codex at https://carlyassistant.com/mcp/ puts them all in the same session.

Can Codex send emails for me?

It can act in whatever account is connected, and the exact actions depend on which route you use. For an assistant that triages, drafts and sends, and follows up on its own across Gmail and Outlook, see Carly.

Should I run inbox work inside Codex?

Codex is a coding agent, so terminal mail suits scripted or one-off tasks: read the support thread, check the alert, quote it into a fix. Recurring triage and follow-up belong in a Carly workflow that runs with nothing open.


More: Connect multiple email accounts to Codex · Codex MCP servers · Codex + Outlook · Codex + Slack · Codex + Google Calendar · Best AI email assistants · Carly’s Gmail integration

Ready to automate your busywork?

Carly schedules, researches, and briefs you—so you can focus on what matters.

See what people say

"Before Carly, I relied on a Calendly link, but the whole process felt impersonal and not very professional. Carly changed that by handling all the back-and-forth, so I'm no longer stuck in endless email threads trying to line up schedules.

Now Carly reaches out to candidates, shares my real-time availability, lets them pick a slot, then sends a Zoom link and drops it straight into my calendar. She sends reminders to both of us before each call, which has significantly reduced no-shows and last-minute confusion.

On top of scheduling, Carly acts like a full executive assistant, sending me my schedule the night before so I can prepare for each call. It reminds me of the old x.ai assistant, but Carly is noticeably smarter, faster, and better suited to my healthcare recruitment business."

Gus Ibrahim, Founder & Director, IHR