mcpField
M
MCP Server for Personal Mailer

MCP Server for Personal Mailer

本地服务
github.com/AlvinHon通信协作136 周前更新

关于 MCP Server for Personal Mailer

MCP Server for Personal Mailer 是一个 Rust 示例服务,可通过 LLM 聊天界面中的提示词发送邮件。它使用 lettre 作为 SMTP 客户端,并演示邮件模板的创建和使用。

主要功能

  1. 01根据聊天提示词发送邮件
  2. 02创建并使用邮件模板
  3. 03通过 SMTP 客户端发送
  4. 04基于 Rust MCP SDK 构建

适用场景

  1. 01撰写并发送邀请邮件
  2. 02创建可重复使用的客户问候模板
  3. 03使用已保存的模板发送邮件

MCP 相关

它向 MCP 客户端提供邮件发送和模板操作,使 LLM 聊天界面能够将自然语言请求转为邮件操作。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

暂未收录安装方式

我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。

代码仓库

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

个人邮件发送器的 MCP 服务

一个基于 Rust 的个人邮件发送器 MCP(Model Context Protocol)服务示例项目。用户只需在 Cursor 和 Copilot 等 LLM 聊天界面中输入提示词,即可轻松发送电子邮件。

本项目使用 MCP 官方的 rust sdk(正在积极开发中)实现。 底层主要使用 lettre crate 作为 SMTP 客户端。

用法

本节介绍一些用例,展示 MCP 服务为何比传统电子邮件程序更有趣。

传统电子邮件程序要求用户了解如何向程序输入数据才能完成操作(例如发送电子邮件)。而在这里,我们只需使用简单的语言,大模型就会帮助我们生成输入数据,以便将其传入“程序”。

示例 1:

send an formal email to Bob ([email protected]). invite him to my friend Chris's wedding. closing with my name "Alvin"
示例输出

大模型:

Email sent successfully!

SMTP:

From: [email protected]
Subject: Invitation to Chris's Wedding
Content-Type: text/plain; charset=utf-8
To: [email protected]
Content-Transfer-Encoding: quoted-printable
Date: Sun, 18 May 2025 12:59:33 +0000
X-Peer: ('127.0.0.1', 58769)

Dear Bob,

I hope this message finds you well. I am writing to formally invite you to =
my friend Chris's wedding. It would be a pleasure to have you join us for t=
his special occasion.

Please let me know if you are able to attend.

Best regards,
Alvin

示例 2:

add a email template named "greeting". It is a greeting to a new customer.
示例输出

大模型:

Email template created successfully!

模板:

Hello {customer_name},

Welcome to our service! We are excited to have you as a new customer.

Best regards,
The Team
send greeting email to customer "abc"
示例输出

大模型:

Email sent with template successfully!

SMTP:

From: [email protected]
Subject: Welcome to our service!
Content-Type: text/plain; charset=utf-8
To: [email protected]
Content-Transfer-Encoding: 7bit
Date: Sun, 18 May 2025 12:28:52 +0000
X-Peer: ('127.0.0.1', 58333)

Hello abc,

Welcome to our service! We are excited to have you as a new customer.

Best regards,
The Team

本地运行以进行测试

本节介绍如何在本地运行 MCP 服务以进行测试。

前提条件:

  • 作为 SMTP 服务端的 Python 模块 aiosmtpd
  • 安装了 GitHub Copilot 的 Visual Studio Code,用作大模型聊天界面和 MCP 客户端

请按以下步骤操作:

  1. 运行 SMTP 服务端。
    python -m aiosmtpd -n -l 127.0.0.1:2525
    
  2. 按照此指南在 VSCode 中设置 MCP Agent。
  3. 在 VSCode 的文件 mcp.json 中点击“start”按钮,启动 MCP Agent。
  4. 运行 MCP 服务:
    cargo run
    

最后,尝试在聊天界面中输入提示词,例如:“给 [email protected] 发送一封电子邮件,主题为 'test',正文为 'hello world'”。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。