How to Connect Multiple Gmail Accounts to Codex
Codex does have a first-party Gmail plugin, and it holds one account per provider, 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. The same Carly account holds your Outlook mailboxes and every calendar on both sides, so you set this up once for all of it.
The plugin is worth knowing about before you skip it. OpenAI ships Gmail and Google Drive plugins in the catalog that ChatGPT and Codex share, reachable from the ChatGPT desktop app and the Codex CLI, though not from the IDE extension. The limit is the count: an open OpenAI issue describes the connector model as oriented around one active connection per provider, and notes that Google sign-in uses domain matching to stop you attaching the wrong account. One inbox, chosen at setup.
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.
1. Add your Gmail accounts to Carly
- Sign in at carlyassistant.com.
- Open carlyassistant.com/integrations.
- Find Gmail, click Connect, and authorize the account.
- Click Connect again for the next one, and keep going for as many accounts as you want.
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.
Carly connects to thousands of apps, so while you are on that page you can add your calendars, files, CRM, and anything else you want Codex to reach through the same connector.
2. 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]
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
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.
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?
Yes, a first-party Gmail plugin in the catalog that ChatGPT and Codex share, available in the ChatGPT desktop app and the Codex CLI but not the IDE extension. It holds one account per provider, so a second inbox needs the Model Context Protocol route below, where the capability depends on which 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 · Every email account in Codex · 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."


