# Email MCP Server
自动化获取/更新邮件模板信息的 MCP (Model Context Protocol) 服务器。
## 项目简介
Email MCP Server 是一个基于 Model Context Protocol (MCP) 的服务器实现,用于自动化管理邮件模板系统。它提供了三个核心工具,让 AI 助手(如 Claude)能够直接与邮件系统交互,实现邮件模板的获取、更新和审核规则查询。
## 功能特性
### 提供的 Tools
1. **get_email_template_info** - 获取邮件模板信息
- 输入:模板ID(如 1345、2133、2344)
- 输出:邮件模板的详细信息,包括标题、正文、状态、敏感词等
2. **update_email_template_status** - 更新邮件模板状态
- 输入:模板ID和更新内容(支持全部字段)
- 输出:更新成功或失败的状态信息
3. **fetch_review_rules** - 获取审核规则
- 输入:无
- 输出:结构化的审核规则,包括可用变量和规则说明
## 快速开始
### 安装
```bash
pip install email-mcp-server
```
### 在 Claude Desktop 中使用
配置文件位置:
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
添加配置:
```json
{
"mcpServers": {
"email-mcp-server": {
"command": "python",
"args": ["-m", "email_mcp_server.server"],
"env": {
"EMAIL_SYSTEM_URL": "https://system_url.com",
"EMAIL_SYSTEM_USERNAME": "your_email@example.com",
"EMAIL_SYSTEM_PASSWORD": "your_password"
}
}
}
}
```
## 使用示例
### 在 Claude 中使用
```
请帮我获取邮件模板 1509 的信息
```
```
请更新邮件模板 1509 的状态为审核通过
```
```
请告诉我邮件模板的审核规则
```
## 审核规则说明
### 可用变量
#### 标题变量
- `{{ Greeting }}` - 问候语
#### 正文变量
- `{{ Salutation }}` - 称呼语(如:Dear Prof. xxx)
- `{{ Opening }}` - 开场白
- `{{ ClosingPhrase }}` - 结束寒暄语
- `{{ ClosingSalutation }}` - 结束称呼语
#### 其他变量
- `{{ Email }}` - 邮箱地址
- `{{ First name }}` - 名
- `{{ Middle name }}` - 中间名
- `{{ Last name }}` - 姓
- `{{ Title }}` - 职称
- `{{ Affiliation }}` - 单位/机构
- `{{ Roles }}` - 角色
- `{{ Note }}` - 备注
### 审核规则
1. 邮件主体内容要放在 `{{ Opening }}` 和 `{{ ClosingPhrase }}` 中间
2. 最后 `{{ ClosingSalutation }}` 下面放落款
3. 所有邮件变量必须用 `{{` 和 `}}` 包裹
4. 邮件模板内容不能和邮件变量名重复
5. 敏感词不能超过10个
6. 敏感词不能同时包含涉及"政治、金钱、利益、暴力"等其中两种类型
7. text正文和HTML正文的主体内容必须保持相同
8. 邮件正文和变量之间语义不得冲突
## 许可证
MIT License - 详见 [LICENSE](LINSE) 文件
Raw data
{
"_id": null,
"home_page": null,
"name": "email-mcp-server",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "mcp, email, template, automation",
"author": "Email MCP Server Team",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/8b/3f/6f0249045fb1c90099250ce95b7ca5a1c41e61f47f1b72148b604a6b69ac/email_mcp_server-0.1.0.tar.gz",
"platform": null,
"description": "# Email MCP Server\r\n\r\n\u81ea\u52a8\u5316\u83b7\u53d6/\u66f4\u65b0\u90ae\u4ef6\u6a21\u677f\u4fe1\u606f\u7684 MCP (Model Context Protocol) \u670d\u52a1\u5668\u3002\r\n\r\n## \u9879\u76ee\u7b80\u4ecb\r\n\r\nEmail MCP Server \u662f\u4e00\u4e2a\u57fa\u4e8e Model Context Protocol (MCP) \u7684\u670d\u52a1\u5668\u5b9e\u73b0\uff0c\u7528\u4e8e\u81ea\u52a8\u5316\u7ba1\u7406\u90ae\u4ef6\u6a21\u677f\u7cfb\u7edf\u3002\u5b83\u63d0\u4f9b\u4e86\u4e09\u4e2a\u6838\u5fc3\u5de5\u5177\uff0c\u8ba9 AI \u52a9\u624b\uff08\u5982 Claude\uff09\u80fd\u591f\u76f4\u63a5\u4e0e\u90ae\u4ef6\u7cfb\u7edf\u4ea4\u4e92\uff0c\u5b9e\u73b0\u90ae\u4ef6\u6a21\u677f\u7684\u83b7\u53d6\u3001\u66f4\u65b0\u548c\u5ba1\u6838\u89c4\u5219\u67e5\u8be2\u3002\r\n\r\n## \u529f\u80fd\u7279\u6027\r\n\r\n### \u63d0\u4f9b\u7684 Tools\r\n\r\n1. **get_email_template_info** - \u83b7\u53d6\u90ae\u4ef6\u6a21\u677f\u4fe1\u606f\r\n - \u8f93\u5165\uff1a\u6a21\u677fID\uff08\u5982 1345\u30012133\u30012344\uff09\r\n - \u8f93\u51fa\uff1a\u90ae\u4ef6\u6a21\u677f\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\u6807\u9898\u3001\u6b63\u6587\u3001\u72b6\u6001\u3001\u654f\u611f\u8bcd\u7b49\r\n\r\n2. **update_email_template_status** - \u66f4\u65b0\u90ae\u4ef6\u6a21\u677f\u72b6\u6001\r\n - \u8f93\u5165\uff1a\u6a21\u677fID\u548c\u66f4\u65b0\u5185\u5bb9\uff08\u652f\u6301\u5168\u90e8\u5b57\u6bb5\uff09\r\n - \u8f93\u51fa\uff1a\u66f4\u65b0\u6210\u529f\u6216\u5931\u8d25\u7684\u72b6\u6001\u4fe1\u606f\r\n\r\n3. **fetch_review_rules** - \u83b7\u53d6\u5ba1\u6838\u89c4\u5219\r\n - \u8f93\u5165\uff1a\u65e0\r\n - \u8f93\u51fa\uff1a\u7ed3\u6784\u5316\u7684\u5ba1\u6838\u89c4\u5219\uff0c\u5305\u62ec\u53ef\u7528\u53d8\u91cf\u548c\u89c4\u5219\u8bf4\u660e\r\n\r\n## \u5feb\u901f\u5f00\u59cb\r\n\r\n### \u5b89\u88c5\r\n```bash\r\npip install email-mcp-server\r\n```\r\n\r\n### \u5728 Claude Desktop \u4e2d\u4f7f\u7528\r\n\r\n\u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e\uff1a\r\n- Windows: `%APPDATA%\\Claude\\claude_desktop_config.json`\r\n- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`\r\n\r\n\u6dfb\u52a0\u914d\u7f6e\uff1a\r\n```json\r\n{\r\n \"mcpServers\": {\r\n \"email-mcp-server\": {\r\n \"command\": \"python\",\r\n \"args\": [\"-m\", \"email_mcp_server.server\"],\r\n \"env\": {\r\n \"EMAIL_SYSTEM_URL\": \"https://system_url.com\",\r\n \"EMAIL_SYSTEM_USERNAME\": \"your_email@example.com\",\r\n \"EMAIL_SYSTEM_PASSWORD\": \"your_password\"\r\n }\r\n }\r\n }\r\n}\r\n```\r\n\r\n## \u4f7f\u7528\u793a\u4f8b\r\n\r\n### \u5728 Claude \u4e2d\u4f7f\u7528\r\n\r\n```\r\n\u8bf7\u5e2e\u6211\u83b7\u53d6\u90ae\u4ef6\u6a21\u677f 1509 \u7684\u4fe1\u606f\r\n```\r\n\r\n```\r\n\u8bf7\u66f4\u65b0\u90ae\u4ef6\u6a21\u677f 1509 \u7684\u72b6\u6001\u4e3a\u5ba1\u6838\u901a\u8fc7\r\n```\r\n\r\n```\r\n\u8bf7\u544a\u8bc9\u6211\u90ae\u4ef6\u6a21\u677f\u7684\u5ba1\u6838\u89c4\u5219\r\n```\r\n\r\n## \u5ba1\u6838\u89c4\u5219\u8bf4\u660e\r\n\r\n### \u53ef\u7528\u53d8\u91cf\r\n\r\n#### \u6807\u9898\u53d8\u91cf\r\n- `{{ Greeting }}` - \u95ee\u5019\u8bed\r\n\r\n#### \u6b63\u6587\u53d8\u91cf\r\n- `{{ Salutation }}` - \u79f0\u547c\u8bed\uff08\u5982\uff1aDear Prof. xxx\uff09\r\n- `{{ Opening }}` - \u5f00\u573a\u767d\r\n- `{{ ClosingPhrase }}` - \u7ed3\u675f\u5bd2\u6684\u8bed\r\n- `{{ ClosingSalutation }}` - \u7ed3\u675f\u79f0\u547c\u8bed\r\n\r\n#### \u5176\u4ed6\u53d8\u91cf\r\n- `{{ Email }}` - \u90ae\u7bb1\u5730\u5740\r\n- `{{ First name }}` - \u540d\r\n- `{{ Middle name }}` - \u4e2d\u95f4\u540d\r\n- `{{ Last name }}` - \u59d3\r\n- `{{ Title }}` - \u804c\u79f0\r\n- `{{ Affiliation }}` - \u5355\u4f4d/\u673a\u6784\r\n- `{{ Roles }}` - \u89d2\u8272\r\n- `{{ Note }}` - \u5907\u6ce8\r\n\r\n### \u5ba1\u6838\u89c4\u5219\r\n\r\n1. \u90ae\u4ef6\u4e3b\u4f53\u5185\u5bb9\u8981\u653e\u5728 `{{ Opening }}` \u548c `{{ ClosingPhrase }}` \u4e2d\u95f4\r\n2. \u6700\u540e `{{ ClosingSalutation }}` \u4e0b\u9762\u653e\u843d\u6b3e\r\n3. \u6240\u6709\u90ae\u4ef6\u53d8\u91cf\u5fc5\u987b\u7528 `{{` \u548c `}}` \u5305\u88f9\r\n4. \u90ae\u4ef6\u6a21\u677f\u5185\u5bb9\u4e0d\u80fd\u548c\u90ae\u4ef6\u53d8\u91cf\u540d\u91cd\u590d\r\n5. \u654f\u611f\u8bcd\u4e0d\u80fd\u8d85\u8fc710\u4e2a\r\n6. \u654f\u611f\u8bcd\u4e0d\u80fd\u540c\u65f6\u5305\u542b\u6d89\u53ca\"\u653f\u6cbb\u3001\u91d1\u94b1\u3001\u5229\u76ca\u3001\u66b4\u529b\"\u7b49\u5176\u4e2d\u4e24\u79cd\u7c7b\u578b\r\n7. text\u6b63\u6587\u548cHTML\u6b63\u6587\u7684\u4e3b\u4f53\u5185\u5bb9\u5fc5\u987b\u4fdd\u6301\u76f8\u540c\r\n8. \u90ae\u4ef6\u6b63\u6587\u548c\u53d8\u91cf\u4e4b\u95f4\u8bed\u4e49\u4e0d\u5f97\u51b2\u7a81\r\n\r\n## \u8bb8\u53ef\u8bc1\r\n\r\nMIT License - \u8be6\u89c1 [LICENSE](LINSE) \u6587\u4ef6\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "MCP Server for email template management",
"version": "0.1.0",
"project_urls": null,
"split_keywords": [
"mcp",
" email",
" template",
" automation"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "9ab8439dfa5de6ad5107d500f428ee59118424216ef0ce0fcab4f098c3556ae9",
"md5": "8c72f2e46f3570acacb4dca249d21d15",
"sha256": "462fb9821567b30f25b0e0c4308efe0b76dd2a45fbdfeb71b68b31f57c149b88"
},
"downloads": -1,
"filename": "email_mcp_server-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8c72f2e46f3570acacb4dca249d21d15",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 8979,
"upload_time": "2025-08-30T07:26:01",
"upload_time_iso_8601": "2025-08-30T07:26:01.336951Z",
"url": "https://files.pythonhosted.org/packages/9a/b8/439dfa5de6ad5107d500f428ee59118424216ef0ce0fcab4f098c3556ae9/email_mcp_server-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "8b3f6f0249045fb1c90099250ce95b7ca5a1c41e61f47f1b72148b604a6b69ac",
"md5": "3b8118f4183049d4a2e60176dbcd55ee",
"sha256": "cd5736379c1a490c0dfac65a2389d6b722295851ae1fbf1b028e925ba9fb33b8"
},
"downloads": -1,
"filename": "email_mcp_server-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "3b8118f4183049d4a2e60176dbcd55ee",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 8310,
"upload_time": "2025-08-30T07:26:02",
"upload_time_iso_8601": "2025-08-30T07:26:02.427497Z",
"url": "https://files.pythonhosted.org/packages/8b/3f/6f0249045fb1c90099250ce95b7ca5a1c41e61f47f1b72148b604a6b69ac/email_mcp_server-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-30 07:26:02",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "email-mcp-server"
}