Skip to main content
Glama
SMTP MCP Server

SMTP MCP Server

SMTP 电子邮件 MCP 服务器

模型上下文协议 (MCP) 服务器为 Claude 和其他兼容 MCP 的 AI 助手提供电子邮件发送功能。

特征

  • 多个 SMTP 配置:配置和管理多个 SMTP 服务器

  • 电子邮件模板:创建、更新和使用可重复使用的电子邮件模板

  • 批量电子邮件发送:通过批处理和速率限制向多个收件人发送电子邮件

  • HTML 支持:全面支持 HTML,提供丰富的电子邮件内容

  • 日志记录:全面记录所有电子邮件活动

  • 模板变量:使用模板变量的动态内容

Related MCP server: Email MCP Server

安装

# Clone the repository
git clone https://github.com/samihalawa/mcp-server-smtp.git
cd mcp-server-smtp

# Install dependencies
npm install

# Build the server
npm run build

用法

启动服务器

npm start

配置

将服务器添加到您的 MCP 配置:

{
  "servers": {
    "smtp-email-server": {
      "command": "/path/to/node",
      "args": ["/path/to/mcp-server-smtp/build/index.js"],
      "enabled": true,
      "port": 3007,
      "environment": {
        "NODE_PATH": "/path/to/node_modules",
        "PATH": "/usr/local/bin:/usr/bin:/bin"
      }
    }
  }
}

可用工具

发送电子邮件

向一个或多个收件人发送电子邮件。

参数:

  • to :包含电子邮件和可选姓名的收件人数组

  • subject :电子邮件主题

  • body :电子邮件正文(支持 HTML)

  • from :(可选)发件人电子邮件和姓名

  • cc :(可选)抄送收件人

  • bcc :(可选)密件抄送收件人

  • templateId :(可选)要使用的模板的 ID

  • templateData :(可选)用于填充模板变量的数据

  • smtpConfigId :(可选)要使用的 SMTP 配置的 ID

发送批量电子邮件

批量向多个收件人发送电子邮件。

参数:

  • recipients :包含电子邮件和可选姓名的收件人数组

  • subject :电子邮件主题

  • body :电子邮件正文(支持 HTML)

  • from :(可选)发件人电子邮件和姓名

  • cc :(可选)抄送收件人

  • bcc :(可选)密件抄送收件人

  • templateId :(可选)要使用的模板的 ID

  • templateData :(可选)用于填充模板变量的数据

  • batchSize :(可选)每批发送的电子邮件数量

  • delayBetweenBatches :(可选)批次之间的延迟(以毫秒为单位)

  • smtpConfigId :(可选)要使用的 SMTP 配置的 ID

获取 smtp 配置

获取所有已配置的 SMTP 服务器。

参数:无

添加 smtp 配置

添加新的 SMTP 服务器配置。

参数:

  • name :配置的名称

  • host :SMTP 服务器主机名

  • port :SMTP 服务器端口

  • secure :是否使用 SSL/TLS

  • auth :身份验证凭证(用户和密码)

  • isDefault :(可选)这是否是默认配置

更新 smtp 配置

更新现有的 SMTP 服务器配置。

参数:

  • id :要更新的配置的 ID

  • name :配置的名称

  • host :SMTP 服务器主机名

  • port :SMTP 服务器端口

  • secure :是否使用 SSL/TLS

  • auth :身份验证凭证(用户和密码)

  • isDefault :(可选)这是否是默认配置

删除 smtp 配置

删除 SMTP 服务器配置。

参数:

  • id :要删除的配置的 ID

获取电子邮件模板

获取所有电子邮件模板。

参数:无

添加电子邮件模板

添加新的电子邮件模板。

参数:

  • name :模板名称

  • subject :电子邮件主题模板

  • body :电子邮件正文模板(支持 HTML)

  • isDefault :(可选)这是否是默认模板

更新电子邮件模板

更新现有的电子邮件模板。

参数:

  • id :要更新的模板的 ID

  • name :模板名称

  • subject :电子邮件主题模板

  • body :电子邮件正文模板(支持 HTML)

  • isDefault :(可选)这是否是默认模板

删除电子邮件模板

删除电子邮件模板。

参数:

  • id :要删除的模板的 ID

获取电子邮件日志

获取已发送电子邮件的日志。

参数:无

示例用法

  1. 配置 SMTP 服务器:

    add-smtp-config(
      name: "Gmail",
      host: "smtp.gmail.com",
      port: 587,
      secure: false,
      auth: {
        user: "your-email@gmail.com",
        pass: "your-app-password"
      },
      isDefault: true
    )
  2. 创建电子邮件模板:

    add-email-template(
      name: "Welcome Email",
      subject: "Welcome to {{company}}!",
      body: "<h1>Hello {{name}},</h1><p>Welcome to {{company}}!</p>",
      isDefault: false
    )
  3. 使用模板发送电子邮件:

    send-email(
      to: [{ email: "recipient@example.com", name: "John Doe" }],
      templateId: "welcome-email",
      templateData: {
        name: "John",
        company: "ACME Corp"
      }
    )
  4. 发送批量电子邮件:

    send-bulk-emails(
      recipients: [
        { email: "user1@example.com", name: "User 1" },
        { email: "user2@example.com", name: "User 2" }
      ],
      subject: "Important Announcement",
      body: "<p>This is an important announcement.</p>",
      batchSize: 10,
      delayBetweenBatches: 1000
    )

要求

  • Node.js 14+

  • 用于发送电子邮件的 Nodemailer

  • 访问 SMTP 服务器

执照

麻省理工学院

Available Tools

6 tools
accounts_listA

List every configured email account and show which account is the default. Use this before other tools when multiple SMTP/IMAP accounts are configured.

Inputs: no named parameters.

email_respondA

Reply to or forward an existing email. Use this to continue email conversations, respond to messages, or forward information to others.

Inputs: body (required), email_id (required), to, body_type, +5 more.

email_sendA

Send a new email with HTML support and file attachments. Use this to send messages, project updates, or any new email conversation.

Inputs: to (required), body (required), subject (required), cc, +5 more.

emails_findA

Search for emails in your inbox with flexible filters. Optionally get full email content and attachments. Use this to find specific emails, check for unread messages, or browse your inbox.

Inputs: limit, query, filters, account_name, +2 more.

emails_modifyA

Change email states like read/unread, flagged, or move between folders. Use this to organize your inbox, mark emails as read, archive messages, or flag important emails.

Inputs: email_ids (required), flag, unflag, mark_read, +3 more.

folders_listA

List all available email folders/labels in your account. Use this to see your folder structure and organize emails.

Inputs: account_name, include_counts.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct operation: account listing, folder listing, searching, modifying, sending, and responding. There is no overlap; even email_send and email_respond are clearly separated by new vs. reply/forward.

    Naming Consistency4/5

    Most tools follow a consistent resource_action pattern (e.g., accounts_list, emails_find). However, there is minor inconsistency in singular vs. plural usage (accounts_list vs. email_send) and action placement, but it remains readable.

    Tool Count5/5

    With 6 tools, the server is well-scoped for email operations. Each tool earns its place, covering account context, folder navigation, search, state changes, and message creation without redundancy.

    Completeness5/5

    The toolset covers the core email workflow: discover accounts and folders, find messages, modify their state, send new emails, and reply/forward. No essential operation is missing; even email deletion can be handled via moving to trash.

    Maintenance

    ActivityMaintained
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables sending emails via SMTP with support for HTML content, attachments, bulk sending, and template-based emails. Features session management and full MCP Streamable HTTP transport compliance.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables sending emails through SMTP using nodemailer, allowing AI assistants to send plain text and HTML emails with configurable SMTP credentials.
      2
      ISC
    • F
      license
      A
      quality
      D
      maintenance
      Enables sending emails through SMTP with support for multiple recipients, attachments, CC/BCC, and both plain text and HTML formats. Includes preset configurations for common email providers like Gmail, QQ, Outlook, and 163.
      5
      -