How it works
Adding mcp-mailtrap to your Codex config gives the agent access to Mailtrap’s Email API to send transactional emails, route messages to sandbox inboxes for testing, manage templates, check delivery logs, review sending stats, and configure sending domains. Describe what you need in plain language; Codex resolves the right Mailtrap tool, shows you the parameters, and executes the call after you confirm.

Configuration
Step 1: Install Node.js 16+ (mcp-mailtrap runs as a Node.js CLI utility).
Step 2: Add the Mailtrap MCP server with a single command:
codex mcp add mailtrap -- npx -y mcp-mailtrap
Step 3: Open ~/.codex/config.toml and add your credentials under the Mailtrap server entry:
[mcp_servers.mailtrap]
command = "npx"
args = ["-y", "mcp-mailtrap"]
[mcp_servers.mailtrap.env]
MAILTRAP_API_TOKEN = "your_mailtrap_api_token"
DEFAULT_FROM_EMAIL = "your_sender@example.com"
MAILTRAP_ACCOUNT_ID = "your_account_id"
MAILTRAP_TEST_INBOX_ID = "your_test_inbox_id"
Step 4: Launch codex – the Mailtrap MCP server starts automatically and its tools become available to the agent.
For detailed guidance, consult the knowledge base article.
Use cases
- Check delivery logs mid-debugging.
- Generate and send email content in one step.
- Manage templates without leaving the CLI.
- Send transactional emails while building features.
Supported functionality
- Send emails via Email API
- Manage email templates
- View email delivery logs with filtering and pagination.
- Track sending statistics across date ranges with breakdowns
- Manage sending domains