mcp-email-sender

mcp-email-sender

An MCP server that enables AI agents to validate email addresses and send emails via SMTP with zero external dependencies.

Category
访问服务器

README

MCP Email Sender — Email Validation & SMTP for AI Agents

An MCP (Model Context Protocol) server that gives AI agents the ability to validate email addresses, check MX records, detect disposable/role-based emails, and send emails via SMTP — all with zero external dependencies.

Features

  • 8 MCP Tools: validate_email, validate_email_batch, check_mx_records, is_disposable, is_role_based, send_email, send_email_batch, test_smtp_connection
  • Zero dependencies — pure Python stdlib (smtplib, email, re, socket)
  • Email validation — format check, disposable detection, role-based detection, MX record lookup
  • Batch operations — validate or send multiple emails in one call
  • SMTP support — TLS, SSL, plain, with CC/BCC/Reply-To
  • STDIO JSON-RPC mode — drop-in for Claude Desktop, Hermes, or any MCP client
  • Environment-based config — SMTP credentials from env vars or tool args

Quick Start

# STDIO mode (for MCP clients)
python -m src.server --stdio

# Print manifest
python -m src.server --manifest

Use as a library

from src.server import MCPEmailServer
import json

server = MCPEmailServer()

# Validate email
result = server.handle_tool_call("validate_email", {"email": "user@gmail.com"})
print(json.loads(result))  # {"valid_format": true, "overall_valid": true, ...}

# Batch validate
result = server.handle_tool_call("validate_email_batch", {
    "emails": ["user@gmail.com", "test@mailinator.com", "bad-email"]
})

# Send email
result = server.handle_tool_call("send_email", {
    "to": "recipient@example.com",
    "subject": "Hello from AI",
    "body": "This email was sent by an AI agent via MCP.",
    "smtp_host": "smtp.gmail.com",
    "smtp_port": 587,
    "smtp_username": "your@gmail.com",
    "smtp_password": "app-password",
    "use_tls": True
})

MCP Tool Reference

Tool Description Required Params
validate_email Full validation (format, disposable, role, MX) email
validate_email_batch Batch validate multiple emails emails
check_mx_records MX records for a domain domain
is_disposable Check if disposable email service email
is_role_based Check if role-based (admin@, info@) email
send_email Send via SMTP to, subject, body
send_email_batch Send multiple emails emails
test_smtp_connection Test SMTP server connection —

SMTP Configuration

Set via environment variables or pass in tool args:

export SMTP_HOST=smtp.gmail.com
export SMTP_PORT=587
export SMTP_USERNAME=your@gmail.com
export SMTP_PASSWORD=your-app-password
export SMTP_TLS=true

Integration with Claude Desktop

{
  "mcpServers": {
    "email-sender": {
      "command": "python",
      "args": ["-m", "src.server", "--stdio"],
      "cwd": "/path/to/mcp-email-sender",
      "env": {
        "SMTP_HOST": "smtp.gmail.com",
        "SMTP_PORT": "587",
        "SMTP_USERNAME": "your@gmail.com",
        "SMTP_PASSWORD": "your-app-password",
        "SMTP_TLS": "true"
      }
    }
  }
}

Tests

python -m pytest tests/ -v  # 37 tests, all passing

License

MIT

Author

aaameobius-crypto — github.com/aaameobius-crypto

Freelance portfolio: https://ameobius-space.github.io/kwork-portfolio/

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选