OpenAI Codex: read test emails with an MCP server
Codex can run your tests and your app, but an email verification step will stop it. With an email MCP server in its config, Codex can read those emails itself.
Step 1: add the server to config.toml
Open ~/.codex/config.toml (create it if it doesn't exist) and add:
[mcp_servers.quickinbox]
url = "https://quickinbox.net/mcp"
http_headers = { "Authorization" = "Bearer qk_live_your_key_here" }The Codex app and IDE extension read the same file, so this works there too.
Better: keep the key out of the file
Instead of the http_headers line, tell Codex to read the key from an environment variable:
[mcp_servers.quickinbox]
url = "https://quickinbox.net/mcp"
bearer_token_env_var = "QUICKINBOX_API_KEY"export QUICKINBOX_API_KEY=qk_live_your_key_hereNow the config file is safe to share or commit, and each developer uses their own key.
Step 2: check it
Restart Codex and run codex mcp list. quickinbox should be listed. Then ask: "Which QuickInbox account are you connected to?"
Step 3: give it a task
Run the app, sign up with a fresh QuickInbox address, read the confirmation
link from the email and open it. Report whether the account is confirmed.Codex uses quickinbox_generate_test_address for the address and quickinbox_get_verification to pull the link or code out of the newest email. If several emails arrive, it can call quickinbox_get_emails to look at all of them.
Good uses for Codex
- Checking a signup or reset flow after a refactor of your auth code.
- Reviewing an email template change: "show me the links in the new welcome email".
- Writing the matching automated test once the manual run works.
Related guides
- VS Code Copilot agent mode: add an email MCP server
- Test magic link login with an AI agent
- Playwright MCP plus an email inbox: a full signup test run by an agent
- MCP server for OTP and 2FA testing
- MCP server overview
Try it: the QuickInbox MCP server is included on every plan, including the free plan with 5,000 emails a month. Create a free account, make an API key and connect your agent in two minutes.