MCP Email Server

Integrations

  • Allows sending emails through Gmail's SMTP server with support for multiple recipients and file attachments.

  • Supports sending emails with XML files as attachments.

MCP 电子邮件服务器

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

特征

  • 向多个收件人发送电子邮件
  • 支持电子邮件附件
  • 根据模式匹配在目录中搜索文件
  • 使用 SMTP 进行安全电子邮件传输

可用工具

  • send_email - 根据提供的主题、正文和收件人发送电子邮件。
    • receiver (字符串数组,必需):收件人电子邮件地址列表
    • body (字符串,必需):电子邮件的主要内容
    • subject (字符串,必需):电子邮件的主题行
    • attachments (字符串或字符串数组,可选):电子邮件附件(文件名)
  • search_attachments - 在指定目录中搜索与给定模式匹配的文件。
    • pattern (字符串,必需):在文件名中搜索的文本模式

提示

  • 发送电子邮件
    • 发送带有可选附件的电子邮件
    • 参数:
      • receiver (必需):接收者电子邮件地址列表
      • body (必填):电子邮件的主要内容
      • subject (必填):电子邮件的主题行
      • attachments (可选):电子邮件附件
  • 搜索附件
    • 搜索与模式匹配的文件
    • 参数:
      • pattern (必需):在文件名中搜索的文本模式

安装

使用 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 许可证的条款和条件。

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

模型上下文协议服务器使 LLM 能够撰写和发送带有附件的电子邮件,以及在指定目录中搜索与给定模式匹配的文件。

  1. Features
    1. Available Tools
    2. Prompts
  2. Installation
    1. Using pip
    2. Email Configuration
  3. Usage
    1. Running the Server
    2. Configure for Claude.app
  4. Security Notes
    1. Supported File Types
      1. Example Usage
        1. Sending an Email
        2. Searching for Attachments
      2. Contributing
        1. License

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that enables LLMs to interact with Salesforce data through SOQL queries, SOSL searches, and various API operations including record management.
            Last updated -
            10
            53
            Python
            MIT License
          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that gives LLMs the ability to interact with Ethereum networks, manage wallets, query blockchain data, and execute smart contract operations through a standardized interface.
            Last updated -
            31
            323
            2
            TypeScript
            MIT License
          • -
            security
            F
            license
            -
            quality
            A Model Context Protocol server that enables LLMs to extract and use content from unstructured documents across a wide variety of file formats.
            Last updated -
            2
            Python
            • Apple
          • -
            security
            F
            license
            -
            quality
            A Model Context Protocol server that enables LLMs to fetch and process web content in multiple formats (HTML, JSON, Markdown, text) with automatic format detection.
            Last updated -
            TypeScript
            • Apple

          View all related MCP servers

          ID: 6q0abxepu2