Back to the knowledge base
Guide

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

  1. Open Settings in Codex.
  2. Go to MCP servers.
  3. Select Add server.
  4. Enter the following details:
    • Name: nextMail
    • Transport: Streamable HTTP
    • URL: https://mcp.exon.email/mcp
  5. Save the server and restart Codex if prompted.
  6. Find nextMail in the server list and select Authenticate.
  7. Sign in to your nextMail account at mail.exon.email in 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.email sign-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 nextmail again.
  • Restart Codex after changing the MCP server configuration.
Feedback

Was this answer helpful?

Your response helps us improve our guides.