Skip to main content
Glama
samihalawa

SMTP MCP Server

by samihalawa

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 服务器

执照

麻省理工学院

Install Server
A
license - permissive license
A
quality
A
maintenance

Maintenance

Maintainers
Response time
0dRelease cycle
4Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Send transactional email over a verified domain — templates, attachments, custom headers.

  • Send transactional email, run campaigns, manage contacts and automations, audit deliverability.

  • Email for AI agents: send mail, manage contacts, automations & webhooks. Zero-DNS first send.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/samihalawa/email-smtp-imap-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server