Skip to main content
Glama
bhoggard

SendGrid MCP Server

by bhoggard

SendGrid MCP Server

一个 Python MCP(Model Context Protocol)服务器,让 AI 助手能够发送 电子邮件并通过 SendGrid 的 Web API v3 管理联系人。

工具

工具

描述

send_email

向一个或多个收件人发送纯文本/HTML 电子邮件

get_template_info

检查动态模板的结构

send_template_email

通过带替换数据的动态模板发送

add_contact

添加/更新营销联系人(由 SendGrid 异步处理)

search_contacts

使用有界 SGQL 查询搜索联系人

get_contact_lists

列出已命名的营销联系人列表

authenticate_domain

为新的发信域名启动域名身份验证,返回需要添加的 DNS 记录

list_domain_authentications

列出域名及其验证状态

validate_domain_authentication

添加记录后重新检查 DNS

delete_domain_authentication

移除域名身份验证

设置

  1. 创建虚拟环境并安装依赖项:

    python -m venv venv
    source venv/bin/activate   # Windows: venv\Scripts\activate
    pip install -r requirements.txt
  2. .env.example 复制为 .env,并填写你的 SendGrid API 密钥 (SendGrid 控制台中的 Settings > API Keys)和默认发件人:

    cp .env.example .env
  3. 发送前,请在 SendGrid 的 Settings > Sender Authentication 下验证你的发件人邮箱, 未验证的发件人将被拒绝。

  4. (可选)在 Email API > Dynamic Templates 下创建动态模板, 并在 .env 中设置 DEFAULT_TEMPLATE_ID

运行

python main.py

这会通过 stdio 运行服务器,这是 Claude Desktop 等 MCP 客户端 对本地子进程所期望的传输方式。

验证是否正常工作

python smoke_test.py

列出已注册的工具,并对你的 SendGrid 账户发起一次实时调用。如需进行交互式 schema/工具检查:

npx @modelcontextprotocol/inspector python main.py

连接到 Claude Desktop

添加到 claude_desktop_config.json

{
  "mcpServers": {
    "sendgrid-mcp": {
      "command": "python",
      "args": ["/path/to/twilio-sendgrid-mcp/main.py"],
      "cwd": "/path/to/twilio-sendgrid-mcp",
      "env": {
        "SENDGRID_API_KEY": "SG.your-actual-api-key-here"
      }
    }
  }
}

之后重启 Claude Desktop。如果某个工具调用失败,请检查 ~/Library/Logs/Claude/mcp*.log(macOS)以查看服务器的 stderr 输出。

-
license - not tested
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (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 Connectors

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

  • Email for AI agents — send, receive as a webhook, manage domains, templates, routing.

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

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/bhoggard/twilio-sendgrid-mcp'

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