Skip to main content
Glama
Shy2593666979

MCP Email Server

MCP 电子邮件服务器

提供电子邮件功能的模型上下文协议 (MLM) 服务器。该服务器支持 LLM 撰写和发送电子邮件,以及在指定目录中搜索附件。 1742711978001

1742712768132

特征

  • 向多个收件人发送电子邮件

  • 支持电子邮件附件

  • 根据模式匹配在目录中搜索文件

  • 使用 SMTP 进行安全电子邮件传输

可用工具

  • send_email - 根据提供的主题、正文和收件人发送电子邮件。

    • receiver (字符串数组,必需):收件人电子邮件地址列表

    • body (字符串,必需):电子邮件的主要内容

    • subject (字符串,必需):电子邮件的主题行

    • attachments (字符串或字符串数组,可选):电子邮件附件(文件名)

  • search_attachments - 在指定目录中搜索与给定模式匹配的文件。

    • pattern (字符串,必需):在文件名中搜索的文本模式

提示

  • 发送电子邮件

    • 发送带有可选附件的电子邮件

    • 参数:

      • receiver (必需):接收者电子邮件地址列表

      • body (必填):电子邮件的主要内容

      • subject (必填):电子邮件的主题行

      • attachments (可选):电子邮件附件

  • 搜索附件

    • 搜索与模式匹配的文件

    • 参数:

      • pattern (必需):在文件名中搜索的文本模式

Related MCP server: MCP Mail Server

安装

使用 pip

安装所需的依赖项:

pip install pydantic python-dotenv

电子邮件配置

带有 SMTP 服务器配置的email.json文件:

[
  {
    "domain": "@gmail.com",
    "server": "smtp.gmail.com", 
    "port": 587
  },
  {
    "domain": "@outlook.com",
    "server": "smtp.office365.com",
    "port": 587
  },
  {
    "domain": "@yahoo.com",
    "server": "smtp.mail.yahoo.com",
    "port": 587
  }
]

用法

运行服务器

使用以下命令启动 MCP 电子邮件服务器:

python -m mcp_email_server (--dir /path/to/attachment/directory)

为 Claude.app 配置

添加到您的 Claude 设置:

康达

{
  "mcpServers": {
    "email": {
      "command": "D:\\conda\\envs\\mcp\\python.exe",
      "args": [
        "C:\\Users\\YourUserName\\Desktop\\servers\\src\\email\\src\\mcp_server_email",
        "--dir",
        "C:\\Users\\YourUserName\\Desktop"
      ],
      "env": {
        "SENDER": "2593666979q@gmail.com",
        "PASSWORD": "tuogk......."
      }
    }
  }
}

紫外线

{
  "mcpServers": {
    "email": {
      "command": "uv",
      "args": [
        "~\\servers\\src\\email\\src\\mcp_server_email",
        "--dir",
        "C:\\Users\\YourUserName\\Desktop"
      ],
      "env": {
        "SENDER": "2593666979q@gmail.com",
        "PASSWORD": "tuogk......."
      }
    }
  }
}

安全说明

  • 对于 Gmail 和其他服务,您可能需要使用应用专用密码

  • 出于安全原因,服务器仅支持有限的附件文件类型

支持的文件类型

服务器支持以下附件文件类型:

  • 文档:doc、docx、xls、xlsx、ppt、pptx、pdf

  • 档案:zip、rar、7z、tar、gz

  • 文本文件:txt、log、csv、json、xml

  • 图像:jpg、jpeg、png、gif、bmp

  • 其他:md

示例用法

发送电子邮件

{
  "receiver": ["recipient@example.com"],
  "subject": "Test Email from MCP Server",
  "body": "This is a test email sent via the MCP Email Server.",
  "attachments": ["document.pdf", "image.jpg"]
}

搜索附件

{
  "pattern": "report"
}

贡献

我们鼓励您为扩展和改进 MCP 电子邮件服务器做出贡献。无论您是想添加新工具、增强现有功能还是改进文档,您的贡献都弥足珍贵。

有关其他 MCP 服务器和实现模式的示例,请参阅: https://github.com/modelcontextprotocol/servers

欢迎提交 Pull 请求!欢迎贡献新想法、错误修复或功能增强,让 MCP 电子邮件服务器更加强大、实用。

执照

MCP 电子邮件服务器遵循 MIT 许可证。这意味着您可以自由使用、修改和分发该软件,但须遵守 MIT 许可证的条款和条件。

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    A Model Context Protocol server that provides a seamless email management interface through Claude, allowing users to search, read, and send emails directly through natural language conversations.
    4
    114
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    A Model Context Protocol server that enables email operations through POP3 and SMTP protocols in Cursor AI, allowing users to send, receive, list, and manage emails using natural language commands.
    468 npm
    52
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that enables AI assistants to search, read, and send emails with attachment support through the Gmail API. It also provides tools for comprehensive label management and uses secure OAuth2 authentication for mailbox access.
    181 npm
    MIT
  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    A Model Context Protocol server that provides email access via IMAP and SMTP, enabling AI agents to read, search, send, and manage emails. It features specialized tools for folder management, message retrieval, and replying to threads through a standardized HTTP/SSE interface.
    MIT