Sponsored by Deepsite.site

mcp-email-docker

Created By
fantasy-lotus8 months ago
基于Typescript实现的Notify MCP Server,支持Docker一键部署到remote|local
Content

mcp-email-docker

基于 Model Context Protocol (MCP) 的邮件通知服务,支持通过Streamable HTTP, SSE(Server-Sent Events)与客户端通信,并通过 SMTP 服务发送通知邮件。已支持 Docker 镜像部署。 本项目也适合作为新手上手学习MCP Server的学习项目


功能特性

  • 支持接入MCP Client通过 MCP 协议发送邮件或其他通知
  • ⭐️ 兼容旧SSE和新Streamable HTTP协议
  • ⭐️ 支持 Docker 一键部署到remote or local,通过Http而不是Stdio通信
    • Dockerfile使用多阶段构建以及slim nodejs环境降低image打包大小

目录结构

.
├── package.json        # 项目依赖与脚本
├── Dockerfile          # Docker 镜像构建文件
├──.dockerignore        # Docker build忽略设置
├── tsconfig.json       # TypeScript 配置
├── src/
│   ├── index.ts        # 服务器入口
│   ├── mcp/
│   │   └── notify.ts   # MCP 通知服务实现
│   └── tool/
│       └── notify.ts   # 邮件发送工具
└── .env.example        # 环境变量示例

快速开始

1. 安装依赖

npm install

2. 配置环境变量

在项目根目录下创建 .env 文件,内容示例:

SMTP_USER=你的邮箱账号
SMTP_PASS=你的邮箱SMTP授权码
SMTP_SERVICE=
SMTP_HOST
PORT=

3. 本地开发启动

npm run build
npm start

或直接用 ts-node:

npx ts-node src/index.ts

Docker 部署

1. 构建镜像

docker build -t yourname/mcp-email-docker .

2. 运行容器

docker run -p 8080:8080 \
  -e SMTP_USER=你的邮箱账号 \
  -e SMTP_PASS=你的邮箱SMTP授权码 \
  -e SMTP_SERVICE=QQ \
  -e SMTP_HOST=smtp.qq.com \
  yourname/mcp-email-docker

或使用 .env 文件:

docker run --env-file .env -p 8080:8080 yourname/mcp-email-docker

API 说明

  • GET /sse
    建立 SSE 连接,用于实时消息推送。

  • POST /messages?sessionId=xxx
    客户端发送消息接口,需携带 sessionId

  • POST /mcp
    通过 Streamable HTTP协议连接mcp server


MCP 邮件通知参数

  • method:通知方式,目前仅基于nodemailer实现 "email"
  • to:收件人邮箱
  • content:邮件内容

依赖


License

MIT

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Tavily Mcp
Playwright McpPlaywright MCP server
CursorThe AI Code Editor
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
ChatWiseThe second fastest AI chatbot™
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Serper MCP ServerA Serper MCP Server
DeepChatYour AI Partner on Desktop
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Amap Maps高德地图官方 MCP Server
WindsurfThe new purpose-built IDE to harness magic
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.