Skip to main content
Glama
shellyz7107

mcp-mail-notifier

by shellyz7107

mcp-mail-notifier Notification MCP Server

将 mcp-mail-notifier 项目的邮件通知功能转换为 Augment 可用的 MCP (Model Context Protocol) 工具。

功能特性

  • 📧 邮件通知: 发送任务完成通知到指定邮箱

  • ⏱️ 时间跟踪: 自动计算任务耗时

  • 🎯 项目集成: 专为 mcp-mail-notifier 项目定制

  • 🔧 MCP 兼容: 完全兼容 Augment 的 MCP 协议

  • QQ邮箱优化: 专门优化QQ邮箱SMTP配置

  • 中文支持: 中文时区和格式化支持

Related MCP server: MiniMail MCP Server

安装

1. 安装依赖

cd mcp-tools
npm install

2. 获取QQ邮箱授权码

  1. 登录QQ邮箱 (https://mail.qq.com)

  2. 点击"设置" -> "账户"

  3. 找到"POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务"

  4. 开启"IMAP/SMTP服务"

  5. 获取授权码(不是QQ密码)

3. 配置环境变量(可选)

export QQ_EMAIL_USER="your-email@qq.com"
export QQ_EMAIL_AUTH_CODE="your-auth-code"

如果不设置环境变量,将使用默认配置。

使用方法

作为 MCP 服务器运行

npm start

直接使用命令行工具

node send-notification.js "任务标题" "任务结果" "详细信息" "开始时间"

示例:

node send-notification.js "iOS应用编译" "成功" "编译完成,所有测试通过" "2024-01-01 10:00:00"

配置 Augment

在 Augment 中配置 MCP 连接:

{
  "mcpServers": {
    "mcp-mail-notifier": {
      "command": "node",
      "args": [
        "/path/to/your/project/mcp-tools/mcp-server.js"
      ],
      "env": {
        "QQ_EMAIL_USER": "your-qq-email@qq.com",
        "QQ_EMAIL_AUTH_CODE": "your-authorization-code"
      }
    }
  }
}

MCP 工具说明

1. send_notification

发送任务完成通知邮件。

参数:

  • task_title (必需): 任务标题

  • task_result (必需): 任务结果

  • details (可选): 详细信息

  • recipient (可选): 收件人邮箱

  • start_time (可选): 任务开始时间

示例:

{
  "task_title": "iOS项目文件结构重构",
  "task_result": "成功完成",
  "details": "已成功重构项目文件结构,创建Core目录统一管理核心组件",
  "start_time": "2025-09-07 00:30:00"
}

2. set_task_start_time

设置任务开始时间,用于后续计算任务耗时。

参数:

  • start_time (可选): 任务开始时间,不提供则使用当前时间

3. format_duration

格式化时间间隔显示。

参数:

  • seconds (必需): 秒数

配置说明

项目配置

send-notification.js 中的 PROJECT_CONFIG 部分:

const PROJECT_CONFIG = {
  name: 'mcp-mail-notifier',
  displayName: '📒【mcp-mail-notifier】',
  description: 'mcp-mail-notifier iOS应用'
};

邮件配置

send-notification.js 中的 EMAIL_CONFIG 部分:

const EMAIL_CONFIG = {
  recipient: 'xxx@qq.com',
  sender: {
    user: process.env.QQ_EMAIL_USER || 'xxx@qq.com',
    authCode: process.env.QQ_EMAIL_AUTH_CODE || 'your-auth-code'
  }
};

在 Augment 中使用

  1. 启动 MCP 服务器:

    npm start
  2. 在 Augment 中配置 MCP 连接,指向这个服务器

  3. 使用工具:

    • send_notification: 发送通知邮件

    • set_task_start_time: 设置任务开始时间

    • format_duration: 格式化时间显示

开发和调试

开发模式

npm run dev

测试

npm test

全局安装

npm run install-global

卸载

npm run uninstall-global

技术架构

  • MCP SDK: 使用 @modelcontextprotocol/sdk 实现 MCP 协议

  • 邮件服务: 使用 nodemailer 发送邮件

  • ES6 模块: 使用现代 JavaScript 模块系统

  • Node.js: 要求 Node.js 18+ 版本

故障排除

常见问题

  1. 535 Login Fail错误

    • 确认已开启IMAP/SMTP服务

    • 确认使用的是授权码而不是QQ密码

  2. 环境变量未设置

    • 检查QQ_EMAIL_USER和QQ_EMAIL_AUTH_CODE是否正确设置

  3. 网络连接问题

    • 确认网络可以访问smtp.qq.com:587

  4. MCP 连接问题

    • 确认 MCP 服务器正常启动

    • 检查 Augment 配置文件路径正确

调试模式

设置环境变量启用调试:

export DEBUG=nodemailer:*

安全注意事项

  • 不要将授权码提交到版本控制系统

  • 定期更换授权码

  • 使用环境变量存储敏感信息

许可证

MIT License

贡献

欢迎提交 Issue 和 Pull Request!

Available Tools

3 tools
format_durationC

格式化时间间隔显示

ParametersJSON Schema
NameRequiredDescriptionDefault
secondsYes秒数

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden, yet it only says it formats a time interval. It does not disclose the resulting string format (e.g. '1h 30m' vs '01:30:00'), rounding behavior, or locale, which is the single most important thing to know about a pure formatting function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single short phrase, front-loaded with the verb and resource and free of padding. Brevity here reflects under-specification rather than wasted words, but there is genuinely nothing redundant to trim.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description is responsible for conveying the shape of the returned display string, and it does not. For a tool whose entire value is the produced format, this leaves a significant gap in what an agent needs to use the result correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the sole parameter 'seconds' is already documented in the schema. The description adds no extra semantics (no unit clarification beyond the schema, no range constraints), so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description ('格式化时间间隔显示') essentially restates the tool name format_duration, adding only the word 'interval' where the name says 'duration'. It gives no hint of the output format or the unit/convention used, so an agent cannot distinguish what this produces versus a generic formatting helper.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to call this tool versus alternatives, no mention of acceptable input ranges, and no note of what happens with negative or fractional seconds. The sibling tools (send_notification, set_task_start_time) are unrelated, so no routing is needed, but the description offers no usage context at all.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

send_notificationC

发送任务完成通知邮件到指定邮箱

ParametersJSON Schema
NameRequiredDescriptionDefault
detailsNo详细信息(可选)
recipientNo收件人邮箱(可选,默认使用配置中的邮箱)
start_timeNo任务开始时间(可选,格式:YYYY-MM-DD HH:mm:ss)
task_titleYes任务标题
task_resultYes任务结果(如:成功、失败、完成等)
project_nameNo项目名称(可选,用于邮件标题,默认使用 mcp-mail-notifier)mcp-mail-notifier

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the external side effect of actually sending an email but omits whether this requires configured credentials, whether delivery is synchronous, whether it is retried on failure, and what the tool returns. The wording '完成通知' (completion notification) also undersells that task_result can carry failure states.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no padding. It is efficient, though it is arguably too terse for a side-effect-bearing tool rather than being wasteful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool that performs an external, irreversible action (sending email) with no annotations and no output schema, the description is incomplete. It does not cover configuration prerequisites, failure behavior, or return expectations that an agent needs to invoke it safely.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all six parameters are already documented in the schema; the baseline is 3. The description only echoes the recipient concept ('指定邮箱') and adds no format, default, or constraint details beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb (发送/send) and resource (任务完成通知邮件/task-completion notification email) with a clear target (指定邮箱). It is distinguishable from siblings like set_task_start_time and format_duration, though it does not explicitly name them as alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use or when-not-to-use guidance. The description does not state prerequisites (e.g., that mail configuration must exist) or any condition under which the agent should prefer a different tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

set_task_start_timeB

设置任务开始时间,用于后续计算任务耗时

ParametersJSON Schema
NameRequiredDescriptionDefault
start_timeNo任务开始时间(可选,格式:YYYY-MM-DD HH:mm:ss,不提供则使用当前时间)

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It does not disclose whether setting the start time overwrites a prior value, whether the operation is idempotent, what permissions are needed, or what happens on the backend—only the downstream purpose is stated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler; the action and its rationale are packed efficiently into one clause pair. Slightly terse relative to what a mutation tool could convey, but nothing is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-optional-param setter with 100% schema coverage and no output schema, the description covers the essentials. However, with zero annotations the missing details on overwrite behavior and idempotency leave a real gap for a write operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%: the single start_time parameter already documents the expected format (YYYY-MM-DD HH:mm:ss) and the fallback to current time. The description adds no parameter-level meaning beyond the schema, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('设置' / set) and resource (任务开始时间 / task start time) plus the downstream purpose (calculating task duration). The sibling tools (send_notification, format_duration) are unrelated enough that no explicit differentiation is needed, but it doesn't delineate itself against anything.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the phrase '用于后续计算任务耗时' suggests the start time is set so duration can later be computed, but there is no explicit when-to-use, when-not-to-use, or mention of alternatives like format_duration for the computation step.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv1.0.0
    • First observedformat_duration
    • First observedsend_notification
    • First observedset_task_start_time

TDQS

B3.1/5.0

Scored across 3 tools

Disambiguation5/5

The three tools have clearly distinct purposes: sending an email notification, setting a task start time, and formatting a duration. No two tools overlap in action or target resource.

Naming Consistency5/5

All tool names use a consistent snake_case verb_noun pattern: send_notification, set_task_start_time, format_duration. The convention is predictable and easy to parse.

Tool Count4/5

Three tools are a reasonable, lightweight surface for a mail notifier. Two are timing helpers rather than direct mail operations, so the set is slightly narrow but not inappropriate.

Completeness3/5

The core send_notification tool is present, and duration helpers exist, but there is no tool to retrieve or clear the stored start time or to calculate/embed elapsed duration into the notification. Other notification scenarios are also absent.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    Enables sending emails through SMTP with support for multiple recipients, attachments, CC/BCC, and both plain text and HTML formats. Includes preset configurations for common email providers like Gmail, QQ, Outlook, and 163.
    5
    -
  • A
    license
    A
    quality
    A
    maintenance
    A multi-service email platform for MCP-compatible clients that supports standard email providers, transactional APIs, and local testing environments. It enables users to send and receive emails, monitor service health, and integrate with messaging webhooks like Slack and Discord through natural language commands.
    10
    2
    MIT