# Mailtrap MCP Server

Mailtrap MCP Server lets you automate email workflows from your AI IDE (e.g., VS Code, Cursor) or send emails with simple prompts from AI assistants like Claude Desktop.

MCP server by Mailtrap. Category: Agent craft.

## Install

Project (for this project only):

```sh
npx add-mcp mcp-mailtrap --env 'MAILTRAP_API_TOKEN=${MAILTRAP_API_TOKEN}' --env 'DEFAULT_FROM_EMAIL=${DEFAULT_FROM_EMAIL}'
```

Works with: Claude Code, Codex CLI, Cursor, Copilot CLI, opencode.

Global (for every project on this machine):

```sh
npx add-mcp mcp-mailtrap --env 'MAILTRAP_API_TOKEN=${MAILTRAP_API_TOKEN}' --env 'DEFAULT_FROM_EMAIL=${DEFAULT_FROM_EMAIL}' -g
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

## Where it runs

Your computer.

## What it needs

Environment variables:

- `MAILTRAP_API_TOKEN` (required): Mailtrap API Token (Sending Domains > Integration > API)
- `DEFAULT_FROM_EMAIL` (required): Sender Email Address (From email, same location as the API token)
- `MAILTRAP_ACCOUNT_ID` (optional): Mailtrap Account ID (Settings > Account Settings), used for template management
- `MAILTRAP_TEST_INBOX_ID` (optional): Mailtrap Test Inbox ID (Sandbox ID, found in the Email Sandbox inbox URL), used for sandbox testing

## Tags

- Runs on your computer: It runs as a program on your machine, with your access.
- Needs a key or account: It asks for an API key or a sign in before it works.

## Source

[Open the source](https://docs.mailtrap.io/for-ai-agents/tools/mcp-server). Checked 2026-10-10. This summary may contain AI-generated text, so it can be wrong. Check the source before you rely on it.

- Previous: [Mailgun MCP Server](https://syn4pse.dev/terminal/mailgun-mcp-server.md)
- Next: [Make MCP Server](https://syn4pse.dev/terminal/make-mcp-server.md)
- [Terminal](https://syn4pse.dev/terminal.md)
- [Suggest a change](mailto:terminal@syn4pse.dev?subject=Terminal%20suggestion)
