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:
| Address | Role |
|---|---|
fictional.sam.okafor@gmail.com | Personal |
fictional.sam.okafor@stripe.com | Main Company |
fictional.sam.okafor@shopify.com | Client |
Use the role in ordinary queries and the full address before anything that changes an inbox.
2. Connect every Gmail account to Carly
- Sign in at carlyassistant.com.
- Open carlyassistant.com/integrations.
- Find Gmail and click Connect.
- Choose the first Google account and approve access.
- 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.comas Personal,fictional.sam.okafor@stripe.comas Main Company, andfictional.sam.okafor@shopify.comas 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.comonly.
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
| Need | Per-account MCP server | Carly MCP server |
|---|---|---|
| Reach one inbox | Yes | Yes |
| Reach several inboxes | One server per account | One server, all accounts |
| Address a specific account in a prompt | No shared convention | Yes, by email address |
| Manage your own OAuth app and scopes | Often required | No |
| Add a fourth account later | New server entry | No config change |
| Keep the work running outside Codex | No | Yes |
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
| Problem | Fix |
|---|---|
| Tools do not show up | Start a new Codex session after adding the server |
codex mcp login never completes | Finish the browser OAuth flow, then rerun codex mcp list |
| Google connected the same Gmail twice | Remove the duplicate and reconnect with Use another account |
| A Workspace blocks authorization | Ask that Workspace administrator to approve Carly |
| Codex queries the wrong inbox | Use 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."


