DEVELOPMENT & DEVOPS · OFFICIAL MCP SERVER

Mailtrap MCP Server

mailtrap/mailtrap-mcp (mcp-mailtrap v0.13.1 on npm, MCP Registry io.mailtrap/mcp, MIT) is Mailtrap's official Node.js (>=22) stdio MCP server. Maintained by Railsware / Mailtrap, it wraps the Mailtrap API with 125+ tools (132 documented tool commands across src/tools/) for sending transactional and bulk emails, inspecting Email Sandbox messages, managing Handlebars templates, contacts, campaigns, sending domains, webhooks, delivery logs, and inbound agent inboxes.

Explore 125+ MCP tools & setup ↓

Tool surface: sending, sandbox, inbound & infrastructure

At v0.13.1 (7342a4c), mailtrap-mcp documents 132 MCP tools (125+ in official summary) grouped by Mailtrap product surface:

  • Live Email Sending (3) & Logs/Stats (4): send-email, batch-send-transactional-email, batch-send-bulk-email, list-email-logs, get-email-log-message, get-sending-stats, get-marketing-stats.
  • Email Sandbox & Testing (32 implementation files): send-sandbox-email, batch-send-sandbox-email, get-sandbox-messages, show-sandbox-email-message, plus sandbox project and inbox lifecycle tools.
  • Inbound Email (24 implementation files): manage folders, inboxes, threads, forwarding rules, and read/reply/forward inbound messages (list-inbound-messages, reply-to-inbound-message, forward-inbound-message, etc.).
  • Templates, Domains & Infrastructure: Handlebars template CRUD (create-template, list-templates, update-template, etc.), domain management + DNS instructions (send-domain-setup-instructions), webhooks, suppressions, and tracking opt-outs.
  • Contacts, Campaigns & Organization Admin: contacts, custom fields, contact events, lists, CSV imports/exports, email campaigns, API tokens, permissions, billing usage, and organization sub-accounts.

Pair with the companion Mailtrap Agent Skills repo if your agent also needs SKILL.md workflow guardrails alongside raw MCP tools.

Stdio, Docker & Smithery installation

Requires Node.js >=22 (unless running via Docker) and a Mailtrap API token from https://mailtrap.io/api-tokens.

1. Claude Desktop / Cursor (npx -y mcp-mailtrap):

{
  "mcpServers": {
    "mailtrap": {
      "command": "npx",
      "args": ["-y", "mcp-mailtrap"],
      "env": {
        "MAILTRAP_API_TOKEN": "your_mailtrap_api_token",
        "DEFAULT_FROM_EMAIL": "[email protected]",
        "MAILTRAP_ACCOUNT_ID": "your_account_id",
        "MAILTRAP_SANDBOX_ID": "your_sandbox_id"
      }
    }
  }
}

2. Docker (mcp/mailtrap stdio container) or Smithery CLI:

# Smithery quick install
npx -y smithery mcp add mailtrap/mailtrap-mcp --client claude

# Docker stdio
docker run --rm -i -e MAILTRAP_API_TOKEN="$MAILTRAP_API_TOKEN" -e MAILTRAP_ACCOUNT_ID="$MAILTRAP_ACCOUNT_ID" mcp/mailtrap

Also ships .mcpb desktop bundle releases (npm run mcpb:pack / dist/mcpb-server.js) and one-click Cursor/VS Code install links in the repository README.

Environment variables, token scoping & operational limits

  • MAILTRAP_API_TOKEN (required): required for all tools; scope tokens strictly to the smallest required permission set (never share production sending tokens when only Sandbox testing is needed).
  • MAILTRAP_ACCOUNT_ID: required for templates, get-sending-stats, email logs, sandbox list/show, domains, and suppressions (optional only for direct send, campaign, marketing stats, tracking opt-out, and list-accounts).
  • Optional / org vars: DEFAULT_FROM_EMAIL, MAILTRAP_SANDBOX_ID (deprecated fallback MAILTRAP_TEST_INBOX_ID logs a stderr warning), plus separate MAILTRAP_ORGANIZATION_ID and MAILTRAP_ORGANIZATION_API_TOKEN for sub-account tools.
  • 30-second timeout & stderr logging: Zod-validated schemas enforce required fields, operations time out at 30 seconds, and structured JSON logs write to stderr so stdout stays clean for JSON-RPC frames.

Primary sources