How to connect nextMail MCP to Codex
Instructions and recommendations from the exon.io team.
Connecting nextMail MCP allows Codex to work with your email account. It can search and read messages, send emails, work with attachments, and create mailbox folders.
The connection uses secure OAuth authentication. You do not enter your password into Codex or into a conversation.
Connect using the Codex app
- Open Settings in Codex.
- Go to MCP servers.
- Select Add server.
-
Enter the following details:
- Name: nextMail
- Transport: Streamable HTTP
-
URL:
https://mcp.exon.email/mcp
- Save the server and restart Codex if prompted.
- Find nextMail in the server list and select Authenticate.
-
Sign in to your nextMail account at
mail.exon.emailin the browser window and approve access.
After authentication, nextMail should appear as a connected MCP server.
You can verify the connection by entering /mcp in Codex.
Connect using the command line
You can also configure the server using the Codex CLI:
codex mcp add nextmail --url https://mcp.exon.email/mcp
codex mcp login nextmail
codex mcp list
The codex mcp login nextmail command opens the nextMail
sign-in page in your browser.
Test the connection
Start a new conversation and ask Codex something like:
- “Show my email folders.”
- “Find unread emails from the last seven days.”
- “Find the latest message from example@example.com.”
- “Draft a reply to this email, but do not send it yet.”
Security recommendations
-
Enter your password only on the
https://mail.exon.emailsign-in page. - Never paste your password or access token into a conversation.
- Review requests carefully before sending or deleting messages.
- Codex can access only the mailbox belonging to the account you used to sign in.
Troubleshooting
-
Make sure the server URL is exactly
https://mcp.exon.email/mcp, including/mcp. - Check the connection using
codex mcp list. -
If authentication has expired, run
codex mcp login nextmailagain. - Restart Codex after changing the MCP server configuration.
Was this answer helpful?
Your response helps us improve our guides.