How it works
Claude Code config gives the agent direct access to Mailtrap’s Email API to send transactional emails, manage templates, check delivery logs, review sending stats, and configure sending domains. Describe what you need in plain language; the agent resolves the right Mailtrap tool and executes the call after you confirm.

Configuration
Step 1: Install Node.js on your machine
Step 2: Create a Mailtrap account and verify your sending domain
Step 3: Grab your API token from Email API/SMTP > API Tokens > Add Token and your Account ID from Account Settings
Step 4: Add the Mailtrap MCP server via the Claude Code CLI:
claude mcp add --transport stdio \
--env MAILTRAP_API_TOKEN=your_api_token \
--env MAILTRAP_ACCOUNT_ID=your_account_id \
--env DEFAULT_FROM_EMAIL=you@yourdomain.com \
--env MAILTRAP_TEST_INBOX_ID=your_sandbox_inbox_id \
mailtrap -- npx -y mcp-mailtrap
Step 5: Verify the connection inside Claude Code with /mcp
Note: The command above uses local scope (default) – the server is private to you in the current project. You can:
- Add
--scope projectto write the config to.mcp.jsoninstead, which you can commit to version control so every team member gets the same Mailtrap tools. - Add
--scope userto make it available across all your projects.
For detailed guidance, consult the Mailtrap MCP Server 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.