SendGrid MCP Server
SendGrid MCP 服务器
模型上下文协议 (MCP) 服务器,提供对 SendGrid 营销 API 的访问,用于电子邮件营销和联系人管理。https ://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api
演示
在这个演示中,我们让 Cline SendGrid 代理创建一个新的联系人列表,将我的邮件添加到其中,自动生成“失落之城”相关信息的模板,并将邮件发送到列表。在这个过程中,Cline 会自动识别我们已验证的发件人,以及需要使用哪个退订组。一封精美的邮件发送到我的收件箱,让我对“失落之城”的邮件感到欣喜若狂!
Related MCP server: SendGrid MCP Server
关于 API 支持的重要说明
此服务器仅支持 SendGrid 的 v3 API,不支持旧版功能。这些功能包括:
仅限动态模板 - 不支持旧版模板
适用于所有联系人和联系人列表操作的营销 API v3
用于批量发送电子邮件的单一发送 API
可用工具
联系人管理
列出联系人
列出您的 SendGrid 帐户中的所有联系人。
// No parameters required添加联系人
将联系人添加到您的 SendGrid 营销联系人。
{
email: string; // Required: Contact email address
first_name?: string; // Optional: Contact first name
last_name?: string; // Optional: Contact last name
custom_fields?: object; // Optional: Custom field values
}删除联系人
从您的 SendGrid 帐户中删除联系人。
{
emails: string[]; // Required: Array of email addresses to delete
}通过列表获取联系人
获取 SendGrid 列表中的所有联系人。
{
list_id: string; // Required: ID of the contact list
}列表管理
列出联系人列表
列出您的 SendGrid 帐户中的所有联系人列表。
// No parameters required创建联系人列表
在 SendGrid 中创建新的联系人列表。
{
name: string; // Required: Name of the contact list
}删除列表
从 SendGrid 中删除联系人列表。
{
list_id: string; // Required: ID of the contact list to delete
}将联系人添加到列表
将联系人添加到现有的 SendGrid 列表。
{
list_id: string; // Required: ID of the contact list
emails: string[]; // Required: Array of email addresses to add
}从列表中删除联系人
从 SendGrid 列表中移除联系人但不删除它们。
{
list_id: string; // Required: ID of the contact list
emails: string[]; // Required: Array of email addresses to remove
}电子邮件发送
发送电子邮件
使用 SendGrid 发送电子邮件。
{
to: string; // Required: Recipient email address
subject: string; // Required: Email subject line
text: string; // Required: Plain text content
from: string; // Required: Verified sender email address
html?: string; // Optional: HTML content
template_id?: string; // Optional: Dynamic template ID
dynamic_template_data?: object; // Optional: Template variables
}发送至列表
使用 SendGrid Single Sends 向联系人列表发送电子邮件。
{
name: string; // Required: Name of the single send
list_ids: string[]; // Required: Array of list IDs to send to
subject: string; // Required: Email subject line
html_content: string; // Required: HTML content
plain_content: string; // Required: Plain text content
sender_id: number; // Required: ID of the verified sender
suppression_group_id?: number; // Required if custom_unsubscribe_url not provided
custom_unsubscribe_url?: string; // Required if suppression_group_id not provided
}模板管理(仅限动态模板)
创建模板
创建一个新的动态电子邮件模板。
{
name: string; // Required: Name of the template
subject: string; // Required: Default subject line
html_content: string; // Required: HTML content with handlebars syntax
plain_content: string; // Required: Plain text content with handlebars syntax
}列表模板
列出所有动态电子邮件模板。
// No parameters required获取模板
通过 ID 检索模板。
{
template_id: string; // Required: ID of the template to retrieve
}删除_模板
删除动态模板。
{
template_id: string; // Required: ID of the template to delete
}分析和验证
获取统计数据
获取 SendGrid 电子邮件统计信息。
{
start_date: string; // Required: Start date (YYYY-MM-DD)
end_date?: string; // Optional: End date (YYYY-MM-DD)
aggregated_by?: 'day' | 'week' | 'month'; // Optional: Aggregation period
}验证电子邮件
使用 SendGrid 验证电子邮件地址。
{
email: string; // Required: Email address to validate
}账户管理
列表_已验证_发件人
列出所有已验证的发件人身份。
// No parameters required列出压制群组
列出所有取消订阅的群组。
// No parameters required安装
git clone https://github.com/Garoth/sendgrid-mcp.git
cd sendgrid-mcp
npm install配置
获取您的 SendGrid API 密钥:
登录您的 SendGrid 帐户
前往“设置”>“API 密钥”
创建具有完全访问权限的新 API 密钥
安全保存 API 密钥,因为它不会再次显示
将其添加到 VSCode 设置中的 Cline MCP 设置文件中(例如 ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json):
{
"mcpServers": {
"sendgrid": {
"command": "node",
"args": ["/path/to/sendgrid-mcp/build/index.js"],
"env": {
"SENDGRID_API_KEY": "your-api-key-here"
},
"disabled": false,
"autoApprove": [
"list_contacts",
"list_contact_lists",
"list_templates",
"list_single_sends",
"get_single_send",
"list_verified_senders",
"list_suppression_groups",
"get_stats",
"validate_email"
]
}
}
}注意:出于安全考虑,修改数据的工具(如发送电子邮件或删除联系人)被有意排除在自动批准之外。
发展
设置测试
测试使用真实的 API 调用来确保响应准确。运行测试的步骤如下:
复制示例环境文件:
cp .env.example .env编辑
.env并添加您的 SendGrid API 密钥:SENDGRID_API_KEY=your-api-key-here注意:
.env文件被 gitignored 以防止提交敏感信息。运行测试:
npm test
建筑
npm run build重要提示
向列表发送电子邮件时,您必须提供 suppression_group_id 或 custom_unsubscribe_url 以遵守电子邮件法规
发件人电子邮件地址必须先通过 SendGrid 验证,然后才能用于发送电子邮件
所有模板均创建为动态模板,并支持 handlebars 语法(例如 {{variable_name}})
单一发送 API 用于所有批量电子邮件操作,因为它提供更好的跟踪和管理功能
SendGrid API 是“最终一致的”——数据更改(例如添加联系人或更新列表)可能不会在更改后立即生效
执照
麻省理工学院
SendGrid 徽标版权归 Twilio 所有
Available Tools
21 toolsadd_contactC
Add a contact to your SendGrid marketing contacts
Inputs: email (required), first_name, last_name, custom_fields.
add_contacts_to_listC
Add contacts to an existing SendGrid list
Inputs: list_id (required), emails (required).
create_contact_listC
Create a new contact list in SendGrid
Inputs: name (required).
create_templateC
Create a new email template in SendGrid
Inputs: name (required), subject (required), html_content (required), plain_content (required).
delete_contactsC
Delete contacts from your SendGrid account
Inputs: emails (required).
delete_listC
Delete a contact list from SendGrid
Inputs: list_id (required).
delete_templateC
Delete a dynamic template from SendGrid
Inputs: template_id (required).
get_contacts_by_listC
Get all contacts in a SendGrid list
Inputs: list_id (required).
get_single_sendC
Get details of a specific single send
Inputs: single_send_id (required).
get_statsC
Get SendGrid email statistics
Inputs: start_date (required), end_date, aggregated_by.
get_templateC
Retrieve a SendGrid template by ID
Inputs: template_id (required).
list_contact_listsB
List all contact lists in your SendGrid account
Inputs: no named parameters.
list_contactsB
List all contacts in your SendGrid account
Inputs: no named parameters.
list_single_sendsB
List all single sends in your SendGrid account
Inputs: no named parameters.
list_suppression_groupsB
List all unsubscribe groups in your SendGrid account
Inputs: no named parameters.
list_templatesB
List all email templates in your SendGrid account
Inputs: no named parameters.
list_verified_sendersA
List all verified sender identities in your SendGrid account
Inputs: no named parameters.
remove_contacts_from_listA
Remove contacts from a SendGrid list without deleting them
Inputs: list_id (required), emails (required).
send_emailC
Send an email using SendGrid
Inputs: to (required), subject (required), text (required), from (required), +3 more.
send_to_listC
Send an email to a contact list using SendGrid Single Sends
Inputs: name (required), list_ids (required), subject (required), html_content (required), +4 more.
validate_emailC
Validate an email address using SendGrid
Inputs: email (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 21 tools
Most tools have distinct purposes, but some overlap exists between list_contacts and get_contacts_by_list, and between send_email and send_to_list, which could cause minor confusion. However, descriptions clarify the differences (e.g., list vs. get by list, general send vs. list-specific send).
All tool names follow a consistent verb_noun or verb_noun_preposition pattern (e.g., add_contact, list_contact_lists, get_contacts_by_list), with clear and predictable naming conventions throughout the set.
With 21 tools, the count is borderline high for a SendGrid server, as it covers contacts, lists, templates, sends, and stats, which might feel heavy but is reasonable given the broad scope. It's not excessive but leans toward the upper limit of typical scoping.
The tool set provides comprehensive coverage for SendGrid's core email marketing and contact management functions, including CRUD operations for contacts, lists, and templates, as well as sending emails, retrieving stats, and validation, with no obvious gaps in the surface.
Maintenance
Related MCP Connectors
Send email and read templates, marketing contacts, lists, stats, bounces and unsubscribes.
Send email, check deliverability, set up domains, and run templates, contacts and campaigns.
Send transactional email, run campaigns, manage contacts and automations, audit deliverability.
Send transactional email, verify domains, build contact segments, and draft marketing campaigns.
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables comprehensive email marketing and transactional email operations through SendGrid's API v3. Supports contact management, campaign creation, email automation, list management, and email sending with built-in read-only safety mode.58442 npm4ISC
- AlicenseNot gradedqualityDmaintenanceEnables AI models to send emails, manage contacts, and interact with SendGrid's email platform via MCP.1MIT
- AlicenseBqualityCmaintenanceManages SendGrid email workflows including design library, transactional templates, marketing contacts and lists, single sends, and direct email sends via the SendGrid v3 API.80442 npmMIT
- AlicenseBqualityDmaintenanceEnables sending transactional emails, managing templates, suppression lists, sending domains, webhooks, subaccounts, and retrieving account metrics via the SparkPost API.2015 npmMIT
Appeared in Searches
- Automating Workflow for File Processing and Communication
- Automating File Processing and Communication Tasks
- A workflow for processing and sharing meeting-related materials
- A workflow for processing and summarizing voice recordings into meeting notes and sending emails
- Automating Business Processes in Marketing