OpenAI Codex reaching several Gmail accounts through a single Carly MCP server

How to Connect Multiple Gmail Accounts to Codex

Codex has no native Gmail plugin, so multi-account access is a matter of which MCP server you point it at. Connect every inbox to Carly, register one MCP server, and the Codex CLI can search or act in whichever account you name.

This is a developer workflow, and it is worth saying plainly: Codex is a coding agent. If the goal is a worked inbox rather than mail reachable from a terminal, the setup below still applies, but the mailbox work belongs in a Carly workflow rather than in a coding session.

Why one MCP server beats one per account

The usual advice is to wire Gmail into Codex through a third-party MCP provider such as Composio, Nylas, or Smithery. That works for one inbox. For three it means three server entries, three OAuth apps to manage, and no shared vocabulary for saying which inbox you mean.

Carly inverts that. Each Google identity is authorized once inside Carly, and Codex sees a single server that can address any of them by email address. Adding a fourth account changes nothing in config.toml.

Since July 9, 2026 apps ship inside "plugins," listed in one directory spanning ChatGPT and Codex. Existing connections kept working and nothing needed resubmitting; what changed is the packaging and the storefront, not the protocol.

1. Give each Gmail account a role

For example, all fictional:

AddressRole
fictional.sam.okafor@gmail.comPersonal
fictional.sam.okafor@stripe.comMain Company
fictional.sam.okafor@shopify.comClient

Use the role in ordinary queries and the full address before anything that changes an inbox.

2. Connect every Gmail account to Carly

  1. Sign in at carlyassistant.com.
  2. Open carlyassistant.com/integrations.
  3. Find Gmail and click Connect.
  4. Choose the first Google account and approve access.
  5. Confirm the connected address in Carly.

Repeat for each additional Google identity, choosing Use another account if Google preselects the first login. Verify the full address after every authorization before adding the next.

If a Google Workspace account requires administrator review, ask that Workspace administrator to approve the connection, then finish authorization. Each Workspace approves independently.

3. Register Carly as an MCP server

The CLI route is the shortest:

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

Servers added this way land in ~/.codex/config.toml at user scope. You can also write the entry by hand:

[mcp_servers.carly]
type = "http"
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 your whole machine.

Then authenticate:

codex mcp login carly

That opens a browser for the OAuth flow. Sign in to the Carly workspace holding the Gmail accounts. Codex supports OAuth and bearer-token auth against remote HTTP MCP servers, so there is no API key to paste into a config file.

Confirm the server is live before moving on:

codex mcp list

4. Test every inbox read-only first

Start a new session so the tools load, then take one account per prompt:

In fictional.sam.okafor@stripe.com, list the sender and subject of the five newest unread messages. Do not change anything.

In fictional.sam.okafor@shopify.com, find the newest thread containing “webhook failure.” State the source account and do not draft.

Then a cross-account query:

Search the Stripe and Shopify example accounts for “incident” from the last 30 days. Include the full source address in every row.

If the tools are missing, start a fresh session — Codex loads a newly installed server’s tools at session start, not mid-session.

5. Reuse this routing prompt

Treat fictional.sam.okafor@gmail.com as Personal, fictional.sam.okafor@stripe.com as Main Company, and fictional.sam.okafor@shopify.com as Client. Always state the target address before changing data. Ask before sends, moves, deletes, or labels.

Then name the target in each action:

Draft the reply from fictional.sam.okafor@stripe.com. Do not send yet.

Add the Incidents label in fictional.sam.okafor@shopify.com only.

Send the approved reply from the account that received the original thread.

Keep approvals on while testing. A coding agent with send scopes and three inboxes is worth a confirmation step.

Third-party Gmail MCP versus Carly in Codex

NeedPer-account MCP serverCarly MCP server
Reach one inboxYesYes
Reach several inboxesOne server per accountOne server, all accounts
Address a specific account in a promptNo shared conventionYes, by email address
Manage your own OAuth app and scopesOften requiredNo
Add a fourth account laterNew server entryNo config change
Keep the work running outside CodexNoYes

Carly gives Codex one account-aware mail toolset instead of a stack of per-inbox servers. Carly offers free Zapier-style workflows; AI agents start at $35/month.

Quick fixes when an inbox does not appear

ProblemFix
Tools do not show upStart a new Codex session after adding the server
codex mcp login never completesFinish the browser OAuth flow, then rerun codex mcp list
Google connected the same Gmail twiceRemove the duplicate and reconnect with Use another account
A Workspace blocks authorizationAsk that Workspace administrator to approve Carly
Codex queries the wrong inboxUse the full address and require source attribution

Frequently asked questions

Does Codex have a native Gmail integration?

No. Codex reaches Gmail through the Model Context Protocol rather than a built-in connector, so the capability depends on which MCP server you register.

How many Gmail accounts can this reach?

As many as you authorize in Carly. Codex connects to one server, so the account count is a Carly setting rather than a Codex one.

Should I use Codex for inbox work?

Codex is a coding agent, and terminal-based mail is a fit for scripted or one-off tasks. Recurring triage, drafting, and follow-up belong in a Carly workflow that runs without a session open.


Related: Codex + Gmail · Multiple Outlook accounts in Codex · Multiple Gmail accounts in ChatGPT · What is MCP · 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