npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@michaelguo/email-mcp-server-nodejs

v1.0.0

Published

A NodeJS MCP Server that sends emails (simulated)

Downloads

3

Readme

Email MCP Server (NodeJS)

npm version License: MIT

一个基于 NodeJS 的 Model Context Protocol (MCP) 服务器,提供邮件发送功能(模拟发送)。

功能特性

  • 邮件发送工具: 提供模拟邮件发送功能,支持自定义发件人、收件人、主题和正文
  • 服务器信息资源: 展示服务器的基本信息和功能特性
  • 邮件撰写提示模板: 用于辅助邮件内容撰写的提示模板
  • 发送状态跟踪: 提供邮件发送状态和时间戳记录
  • 安全模拟: 不会真实发送邮件,仅用于演示和测试

安装

从 npm 安装(推荐)

npm install -g @michaelguo91/email-mcp-server-nodejs

从源码安装

  1. 克隆或下载项目到本地
  2. 安装依赖:
npm install

构建

npm run build

运行

开发模式

npm run dev

生产模式

npm start

监听模式(自动重新编译)

npm run watch

使用方法

这个 MCP 服务器通过 stdio 传输层与客户端通信。它提供以下功能:

工具 (Tools)

send_email

发送邮件(模拟发送)。

参数:

  • to (string): 收件人邮箱地址
  • subject (string): 邮件主题
  • body (string): 邮件正文内容
  • from (string, 可选): 发件人邮箱地址(默认为 [email protected]
  • config (string): 配置信息

示例:

{
  "name": "send_email",
  "arguments": {
    "to": "[email protected]",
    "subject": "测试邮件",
    "body": "这是一封测试邮件的内容。",
    "from": "[email protected]",
    "config": "配置信息"
  }
}

返回:

{
  "content": [
    {
      "type": "text",
      "text": "📧 邮件发送成功!\n\n邮件ID: email_1234567890_abc123\n发送时间: 2024-01-01T12:00:00.000Z\n发件人: [email protected]\n收件人: [email protected]\n主题: 测试邮件\n正文长度: 15 字符\n\n状态: ✅ 已发送(模拟)\n\n注意:这是模拟发送,邮件并未真实发送到目标邮箱。"
    }
  ]
}

资源 (Resources)

server-info

获取服务器的基本信息和功能特性。

URI: info://server

提示 (Prompts)

compose_email

用于邮件撰写的提示模板。

参数:

  • recipient (string): 收件人邮箱地址
  • purpose (string): 邮件目的或类型
  • tone (string, 可选): 邮件语调(正式/非正式/友好等)

与 MCP 客户端集成

全局安装后使用

如果你全局安装了这个包,可以直接使用命令:

{
  "mcpServers": {
    "email-server": {
      "command": "email-mcp-server"
    }
  }
}

本地安装使用

要在 MCP 客户端中使用此服务器,请将以下配置添加到客户端的配置文件中:

{
  "mcpServers": {
    "email-server": {
      "command": "node",
      "args": ["path/to/email-mcp-server-nodejs/dist/index.js"]
    }
  }
}

使用 npx(无需安装)

{
  "mcpServers": {
    "email-server": {
      "command": "npx",
      "args": ["@michaelguo91/email-mcp-server-nodejs"]
    }
  }
}

测试

你可以使用 MCP Inspector 来测试这个服务器:

npx @modelcontextprotocol/inspector node dist/index.js

或者使用项目自带的测试客户端:

npm test

项目结构

email-mcp-server-nodejs/
├── src/
│   └── index.ts          # 主服务器文件
├── scripts/
│   └── publish.sh        # 发布脚本
├── dist/                 # 编译后的 JavaScript 文件
├── package.json          # 项目配置和依赖
├── tsconfig.json         # TypeScript 配置
├── test-client.js        # 测试客户端
└── README.md            # 项目说明

技术栈

  • NodeJS: JavaScript 运行时
  • TypeScript: 类型安全的 JavaScript
  • MCP SDK: Model Context Protocol TypeScript SDK
  • Zod: 运行时类型验证

安全说明

⚠️ 重要提醒: 这是一个模拟邮件发送服务器,不会真实发送邮件。所有的邮件发送操作都是模拟的,仅用于演示和测试目的。

如果需要真实的邮件发送功能,请:

  1. 集成真实的邮件服务提供商(如 SendGrid、AWS SES、Nodemailer 等)
  2. 添加适当的身份验证和授权机制
  3. 实施邮件发送限制和监控

许可证

MIT License

贡献

欢迎提交 Issue 和 Pull Request!

扩展功能

你可以轻松扩展这个服务器来添加更多邮件功能:

  • 真实邮件发送集成
  • 邮件模板系统
  • 批量邮件发送
  • 邮件发送历史记录
  • 邮件附件支持
  • HTML 邮件格式支持

只需在 src/index.ts 中添加新的工具定义即可。