Mcp Mailtrap

io.github.pijusz由 GitHub 账号 pijusz 发布v0.1.4更新于 Oct 27, 2026

MCP server for the Mailtrap email platform — analytics, sending, contacts, sandbox

概览

AI 生成的概览

Mailtrap 邮件平台的 MCP 服务器,让助手发送邮件、查看日志与统计、管理联系人、模板、域名和沙箱收件箱。

可以做什么
  • 发送事务性、批量或沙箱测试邮件,单次批量最多 500 封
  • 读取发送统计与邮件日志,查看投递事件,列出并删除抑制项,检查名单卫生
  • 创建、读取、更新和删除邮件模板,并将 react-email 组件文件渲染为 HTML 和纯文本
  • 管理联系人、联系人列表、自定义字段、批量导入导出,并触发联系人自动化
  • 操作沙箱项目与收件箱:列出邮件、以 HTML/文本/原始/EML 读取正文、分析垃圾邮件评分与邮件头、转发邮件
  • 查看发信域名与 DNS 记录、账户与账单用量,并管理 API 令牌和账户权限
适用场景
当你使用 Mailtrap 处理事务性或营销邮件,希望助手起草并发送邮件、排查投递问题、清理联系人名单,或在上线前于沙箱中测试邮件时适用。
运行要求
通过 npx(Node 18+)或预编译二进制在本地运行。需要 MAILTRAP_API_TOKEN 中的 Mailtrap API 令牌;可选 MAILTRAP_SENDING_TOKEN、MAILTRAP_ACCOUNT_ID、MAILTRAP_DEFAULT_FROM_EMAIL、MAILTRAP_TEST_INBOX_ID 和 DEBUG。需要访问 Mailtrap API 的网络连接。
安装前请注意
该令牌可广泛访问 Mailtrap 账户,包括发送真实邮件以及管理 API 令牌和账户权限。许多工具会写入或删除数据:发送、批量发送、删除模板和联系人、删除抑制项、清理收件箱和重置凭据。发送会消耗套餐额度,账单用量也可见。请限制令牌权限,并在批准发送或删除操作前先确认。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Mailtrap,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[mcpj-mailtrap]

mcpj-mailtrap

Mailtrap MCP server — analytics, email logs, contacts, sandbox testing & more via natural language.
Built with Bun + TypeScript. Works with Claude, Cursor, and any MCP client.


Quick Start

1. Get Your API Token

Get an API token from Mailtrap API Tokens.

2. Add to Claude Code

Minimal

bash
claude mcp add mailtrap -e MAILTRAP_API_TOKEN=your_token -- npx mcpj-mailtrap

Full

bash
claude mcp add mailtrap \  -e MAILTRAP_API_TOKEN=your_token \  -e MAILTRAP_SENDING_TOKEN=your_sending_token \  -e MAILTRAP_ACCOUNT_ID=12345 \  -e [email protected] \  -e MAILTRAP_TEST_INBOX_ID=12345 \  -- npx mcpj-mailtrap

That's it. Restart Claude Code and the tools are available.

Also works with bunx mcpj-mailtrap@latest if you have Bun. Requires Node 18+ when running via npx.

Claude Desktop / Cursor

Minimal

json
{  "mcpServers": {    "mailtrap": {      "command": "npx",      "args": ["-y", "mcpj-mailtrap@latest"],      "env": {        "MAILTRAP_API_TOKEN": "your_token"      }    }  }}

Full

json
{  "mcpServers": {    "mailtrap": {      "command": "npx",      "args": ["-y", "mcpj-mailtrap@latest"],      "env": {        "MAILTRAP_API_TOKEN": "your_token",        "MAILTRAP_SENDING_TOKEN": "your_sending_token",        "MAILTRAP_ACCOUNT_ID": "12345",        "MAILTRAP_DEFAULT_FROM_EMAIL": "[email protected]",        "MAILTRAP_TEST_INBOX_ID": "12345"      }    }  }}
Alternative: standalone binary

Download a pre-built binary from Releases:

PlatformFile
macOS (Apple Silicon)mcpj-mailtrap-darwin-arm64
macOS (Intel)mcpj-mailtrap-darwin-x64
Linuxmcpj-mailtrap-linux-x64
Windowsmcpj-mailtrap-windows-x64.exe

macOS / Linux:

bash
curl -Lo mcpj-mailtrap https://github.com/pijusz/mcp-mailtrap/releases/latest/download/mcpj-mailtrap-darwin-arm64chmod +x mcpj-mailtrapsudo mv mcpj-mailtrap /usr/local/bin/claude mcp add mailtrap -e MAILTRAP_API_TOKEN=your_token -- /usr/local/bin/mcpj-mailtrap

Windows (PowerShell):

powershell
Invoke-WebRequest -Uri "https://github.com/pijusz/mcp-mailtrap/releases/latest/download/mcpj-mailtrap-windows-x64.exe" -OutFile "$env:LOCALAPPDATA\mcpj-mailtrap.exe"claude mcp add mailtrap -e MAILTRAP_API_TOKEN=your_token -- "%LOCALAPPDATA%\mcpj-mailtrap.exe"

Tools (46)

Analytics

ToolDescription
get_statsSending statistics — delivery, bounce, open, click, spam rates. Group by domain, category, ESP, or date

Email Logs

ToolDescription
get_email_logsList sent emails filtered by status, stream, date range, recipient, sender, subject, or category. Cursor-based pagination
get_email_logSingle message detail with delivery events timeline
get_suppressionsList suppressed emails (bounces, spam complaints, unsubscribes) with the IDs delete_suppression needs
delete_suppressionRe-enable sending to a suppressed address
check_list_hygieneFind suppressed emails that still exist in contact lists and suggest exact cleanup actions

Sending

ToolDescription
send_emailSend via transactional or bulk stream. Supports HTML, text, or templates
batch_sendSend up to 500 emails in one request
send_test_emailSend to a sandbox inbox for testing, with optional env defaults for inbox and sender

Templates

ToolDescription
list_templatesList all email templates
get_templateGet template details including HTML/text body
create_templateCreate a new template
update_templateUpdate an existing template
delete_templateDelete a template
render_react_emailRender a react-email component file (.tsx, .jsx, .js, .mjs) to HTML + plain text

Contacts

ToolDescription
create_contactCreate a contact with email, custom fields, list membership
get_contactGet contact by UUID or email
update_contactUpdate contact fields, list membership, subscription status
delete_contactDelete a contact
trigger_contact_eventTrigger automations for a contact
list_contact_listsList all contact lists
get_contact_listGet a single contact list
create_contact_listCreate a new contact list
update_contact_listRename a contact list
delete_contact_listDelete a contact list
manage_contact_fieldList, get, create, update, or delete custom contact fields
import_contactsBulk import up to 50k contacts, or check import status
export_contactsStart contact export or check export status

Email Sandbox

ToolDescription
list_projectsList sandbox projects with inboxes
get_projectGet a single project
manage_projectCreate, update, or delete a project
list_inboxesList all sandbox inboxes
get_inboxGet inbox details (credentials redacted by default)
manage_inboxCreate, update, clean, mark read, reset credentials, or delete
get_messagesList messages in a sandbox inbox
get_messageGet message body in HTML/text/raw/EML format, with optional attachments
analyze_messageCombined spam score + HTML analysis + headers report
forward_messageForward a test message to an email

Domains

ToolDescription
list_domainsList sending domains with DNS status
get_domainGet domain details including DNS records
manage_domainCreate or delete a sending domain
send_domain_setup_instructionsEmail DNS setup instructions to a colleague

Accounts

ToolDescription
list_accountsList accounts or get one by ID
get_billing_usagePlan limits and current usage
manage_account_accessList, remove, update permissions, view resources
manage_api_tokenList, get, create, delete, or reset API tokens

Configuration

VariableRequiredDefaultDescription
MAILTRAP_API_TOKENYes—General API token from mailtrap.io/api-tokens
MAILTRAP_SENDING_TOKENNoMAILTRAP_API_TOKENSeparate token for transactional and bulk send.api requests
MAILTRAP_ACCOUNT_IDNoauto-discoveredDefault account ID
MAILTRAP_DEFAULT_FROM_EMAILNo—Default sender email for send_email / send_test_email
MAILTRAP_TEST_INBOX_IDNo—Default sandbox inbox ID for send_test_email
DEBUGNo—Enable debug logging

Updates

Using npx @latest (recommended): You always get the latest version — no manual updates needed.

Using a binary: The server checks for new releases on startup and logs to stderr if outdated:

[mcpj-mailtrap] Update available: v0.2.0 (current: v0.1.0)

Check your installed version:

bash
mcpj-mailtrap --version

Development

Requires Bun.

bash
git clone https://github.com/pijusz/mcp-mailtrap.gitcd mcp-mailtrapbun installbun test           # testsbun run typecheck  # tscbun run build      # standalone binarybun run inspect    # MCP Inspectorbun run check      # biome format + lint

License

MIT

来源:README.md,提交 37aa2c0

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.4最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分