How to Connect Codex to Gmail (and What It Can't Do)
You can connect OpenAI Codex to Gmail — but only the way a developer would: by wiring up an MCP server in a config file and running an OAuth flow in your terminal. There’s no official one-click Gmail plugin. You bolt Gmail on through a third-party MCP provider (Composio, Nylas, Smithery, and others), after which Codex can read your inbox, draft messages, and search mail from the command line. It works. It’s just plumbing built for engineers — and Codex is a coding agent, not an email assistant.
Here’s what a Codex Gmail integration actually involves, where it stops, and what to use if you want your inbox handled without touching a config file.
What a Codex Gmail integration does
Codex doesn’t ship a native Gmail connector the way it ships Slack or GitHub. Instead, you add Gmail through the Model Context Protocol using a third-party server. Once connected, Codex can:
- Read and search your inbox — pull messages and threads into a task.
- Draft — and send — replies — compose messages, and with send scopes granted during OAuth, send them too. Composio’s Gmail toolkit includes send-email and send-draft tools alongside draft creation; keep the scopes narrow if you want Codex draft-only.
- Combine with other MCP tools — e.g. Nylas exposes Gmail, Outlook, and calendar together, so Codex can “search your inbox, check your schedule, draft messages, and create events.”
It’s the same capability surface a developer would expect from an agent with an email tool attached — powerful in a script, reached from the terminal.
How to set it up
This is a developer workflow, not a settings toggle. Using a provider like Composio:
- Open (or create) your Codex config at
~/.codex/config.toml. - Add the Gmail MCP server entry (
[mcp_servers.gmail]with the provider’s URL). - Run the CLI login (
codex mcp login …) and complete the OAuth flow in your browser. - Manage scopes/credentials — several providers have you bring your own OAuth app to control what the agent can touch.
If config.toml, MCP servers, and OAuth scopes aren’t your world, this is where a Codex Gmail integration stops being practical.
The limits that actually matter
Even fully wired up, three things define what this is for:
- It’s assembled, not first-party. There’s no official Gmail plugin — you’re stitching Gmail on via a third-party MCP server and maintaining that connection yourself.
- It’s terminal-first and developer-shaped. The whole setup lives in config files and CLI commands. It’s not built for someone who just wants their email handled.
- Codex is a coding agent. Its native job is code, PRs, and environments. Email is a tool you attach for a script — not a purpose-built inbox experience with triage, sending, and follow-up as the point.
So a Codex Gmail integration is great for “let my coding agent read a support thread while it works” and not built for “run my inbox for me.”
If you want your inbox handled: Carly
The moment you want email handled — incoming mail triaged, replies drafted and sent, follow-ups and scheduling done automatically — without editing a config file, you’ve crossed past what Codex is for.
That’s where Carly fits. Carly is an AI executive assistant purpose-built for email, set up by conversation instead of code:
- No-code, no config files. Describe what you want in plain English; Carly interviews you and builds the workflow. No MCP servers, no
config.toml, no CLI. - It sends, not just drafts. Carly drafts and sends email across Gmail and Outlook, with attachments — and each agent gets its own email address so it can correspond like a colleague.
- Fires on triggers, 24/7 in the cloud — when mail lands, Carly triages, replies, files, and schedules; nothing to keep running on your machine.
- Connects email to the rest of your stack — calendar, CRM, tasks, and 200+ tools.
AI agents start at $35/month, and workflow steps that don’t use AI run free and unlimited. See integrations. By the way, Carly also integrates with Gmail.
Codex’s Gmail integration vs Carly
| Codex (Gmail via MCP) | Carly | |
|---|---|---|
| Official first-party connector | No (third-party MCP) | Purpose-built |
| Setup | Config file + CLI + OAuth | Describe it in plain English |
| Reads & searches inbox | Yes | Yes |
| Sends email | Yes, with send scopes (limit scopes for draft-only) | Drafts and sends |
| Attachments | Depends on provider | Yes |
| Gmail + Outlook | Via provider | Both, natively |
| Acts on triggers / events | No | Yes, 24/7 in cloud |
| Built for | Developers | Execs, EAs, operators |
| Pricing | Paid plan + provider | AI agents from $35/mo |
Codex-with-Gmail is a coding agent you gave an email tool. Carly is an email assistant that runs your inbox.
Frequently Asked Questions
Does OpenAI Codex integrate with Gmail?
Not with a first-party connector. You connect Gmail to Codex through a third-party MCP server (Composio, Nylas, Smithery, and others) by editing ~/.codex/config.toml and completing an OAuth flow in the terminal. After that, Codex can read, search, and draft email — and send it, if you grant send scopes. It’s a developer setup.
Can Codex send emails for me?
Through an MCP provider, Codex can draft messages and, depending on the provider’s scopes, send them — but it’s a command-line workflow, not a purpose-built inbox assistant. For an assistant that triages, drafts and sends, and follows up automatically across Gmail and Outlook, see Carly.
How do I connect Codex to Gmail?
Add a Gmail MCP server to your ~/.codex/config.toml, run the provider’s codex mcp login command, and complete the OAuth flow. Some providers have you bring your own OAuth credentials to control scopes. It assumes comfort with config files and the CLI.
Is Codex a good email assistant?
Codex is a coding agent, so email is a tool you attach rather than the product itself. If you want your inbox actually run — triage, sending, scheduling, follow-up, no config files — a no-code assistant like Carly is the better fit.
More: Codex + Outlook · Codex + Slack · Codex + Google Calendar · Can Claude send emails · Best AI email assistants · Codex + Outlook Calendar
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."


