mcp-mail-notifier

mcp-mail-notifier

Sends task completion notifications via QQ email with time tracking, compatible with Augment's MCP protocol.

Category
Visit Server

README

mcp-mail-notifier Notification MCP Server

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

功能特性

  • 📧 邮件通知: 发送任务完成通知到指定邮箱
  • ⏱️ 时间跟踪: 自动计算任务耗时
  • 🎯 项目集成: 专为 mcp-mail-notifier 项目定制
  • 🔧 MCP 兼容: 完全兼容 Augment 的 MCP 协议
  • QQ邮箱优化: 专门优化QQ邮箱SMTP配置
  • 中文支持: 中文时区和格式化支持

安装

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!

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured