
SendGrid Transactional
io.github.Neschadin由 GitHub 账号 Neschadin 发布v3.0.3更新于 Oct 24, 2026
SendGrid transactional email: preflight send, templates, and delivery diagnostics.
概览
本地运行的 SendGrid 事务邮件 MCP 服务器:校验并预检发送,再通过活动、日志和抑制记录排查投递问题。
- 可以做什么
- 校验并发送事务邮件:检查 mail/send 载荷、动态模板版本、发件人身份、收件人抑制和 send_at,仅在预检报告无阻断项时发送,并提供不实际投递的沙箱模式。发送后追踪投递:按 x-message-id 查询邮件活动,活动不可用或区域为 eu 时改用 Email Logs。排查未送达:检查与删除抑制记录,分诊退信、拦截、垃圾邮件和退订,解释错误并读取 API 权限范围。管理发送周边配置:动态模板、Event Webhook 的创建更新与测试及可选本地接收器、域名、链接品牌、TLS、邮件与跟踪设置、告警、入站解析。
- 适用场景
- 适合让助手发送或排查 SendGrid 事务邮件,而不是管理营销联系人、列表或活动。也适合在邮件发出前做检查,以及调查邮件为何退信、被抑制或未送达。
- 运行要求
- 以 npm 包形式通过 bunx 在本机运行,需要 Bun 1.4.3 或更高版本和 MCP 客户端。需要具备相应权限范围的 SENDGRID_API_KEY,以及 SENDGRID_FROM_EMAIL 中的已验证发件地址;可选配置包括区域、发件人名称、代发子用户、日志级别和 READ_ONLY。远程 HTTP 模式需要 MCP_AUTH_TOKEN 以及主机和来源白名单。
安装
在 SourceWeft 中
- 打开 控制台中的 SendGrid Transactional,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
SendGrid MCP Server
This server is for transactional send and delivery, not a map of the whole SendGrid API.
A thin SendGrid MCP treats POST /v3/mail/send as one call and spends the rest of its tools on contacts, lists, and campaigns. Those marketing APIs are out of scope here. The tools follow the checks SendGrid's own delivery troubleshooting expects:
- Before send.
sendgrid_validate_send_requestchecks the/v3/mail/sendpayload, that the dynamic template version is active, sender identity (domain authentication or a verified sender), link branding, recipient suppressions including the ASM group on the send, the DMARC warn list (GET /v3/verified_senders/domains), and thatsend_atis in the future and inside 72 hours.sendgrid_send_with_preflightposts only when that report has no blockers. Sandbox mode accepts the payload and does not deliver. - After accept. The
x-message-idresponse header is not amsg_id. Pass it asxMessageId; search compilesmsg_id LIKE '<id>%', thensendgrid_get_message_activityreads the event chain (reason,bounce_type,asm_group_id,outbound_ip). Email Activity has no real offset. If Activity returns 403/404, or the region iseuand Activity is empty, use Email Logs (POST /v3/logs) withto_emailequality. Logs rejectsmsg_id,from_email, andLIKE. - When it did not arrive.
sendgrid_check_suppressionandsendgrid_triage_delivery_issuecover bounce, block, spam, invalid, global unsubscribe, and ASM groups.sendgrid_delete_suppressionlifts one entry.sendgrid_classify_sendgrid_errorandsendgrid_get_scopesexplain a 403. Paused or canceled scheduled batches are listed; a batch that was only givensend_atis not in that list until you pause or cancel it. - The pipe around the send. Dynamic templates (including bulk rename and pruning inactive versions), Event Webhook create/update/test plus an optional local receiver, and the console settings that change delivery: domains, link branding, enforced TLS, mail and tracking settings, alerts, inbound parse.
Install: bunx --no-env-file x @neschadin/sendgrid-mcp.
Full catalog and runbooks: MCP_TOOLS.md.
This project is community-maintained and is not affiliated with, endorsed by, or sponsored by Twilio SendGrid.
Requirements
- Bun ≥ 1.4.3
- A SendGrid API key with scopes for the tools you call. Keys normally start with
SG.; any other prefix only logs a warning - A verified sender address in
SENDGRID_FROM_EMAIL - An MCP client (Cursor, Claude Desktop, VS Code, etc.)
One process, one API key. Do not share a hosted instance across tenants.
Configuration
Required
SendGrid
Every tool also accepts onBehalfOf. The value "parent" skips SENDGRID_ON_BEHALF_OF for that call. List subusers with sendgrid_list_subusers (the parent key needs that scope; this key may 403).
Handshake instructions repeat the region, API base, from address, and the workflow above. A tool call with more than 10000 combined array elements and object members is rejected. Results replace oauth_client_secret and api_key values with a length marker.
Remote HTTP
Leave MCP_TRANSPORT unset for stdio. Set MCP_TRANSPORT=http to serve Streamable HTTP on /mcp (/health is unauthenticated).
Local Event Webhook receiver
Off until SENDGRID_EVENT_WEBHOOK_PORT is set. The buffer is in-memory (default 5000 events) and is dropped when the process exits.
Point the SendGrid Event Webhook URL at the tunnel, for example https://<ngrok-host>/sendgrid/events. Read what arrived with sendgrid_get_received_webhook_events and sendgrid_get_webhook_receiver_status. Create or test the SendGrid-side webhook with sendgrid_manage_event_webhook.
MCP client setup
Cursor
mcp.json.example. --no-env-file stops Bun from also reading a .env in the client cwd. In ~/.cursor/mcp.json, envFile must be an absolute path.
Remote HTTP, after the server process is started with MCP_TRANSPORT=http:
Claude Desktop
No envFile. The desktop cwd is not your repo, so pass an absolute --env-file:
Restart the client after changing MCP config.
Safety
- Send tools can enqueue real mail. They do not ask for
confirmToken. Usesendgrid_send_with_preflight, or setREAD_ONLY=true. - Tools that change SendGrid (templates, suppressions, webhooks, domains, settings, scheduled-send pause/cancel) require
confirmToken"CONFIRM". READ_ONLY=trueblocks both sends and those mutations before the HTTP call.- Email Activity (
/v3/messages) may require the Email Activity add-on.
Development
A git tag vX.Y.Z must match version in package.json and both version fields in server.json. That tag runs tests, opens the GitHub Release, publishes @neschadin/sendgrid-mcp to npm, then publishes io.github.Neschadin/sendgrid-mcp to the MCP registry. The release has no binary assets. A prerelease tag (vX.Y.Z-...) publishes to npm with the next dist-tag, skips the MCP registry, and is marked prerelease on GitHub.
Docs
- MCP_TOOLS.md — tools, runbooks, risk matrix
- SendGrid API reference
- SendGrid for developers
License
MIT — see LICENSE.
来源:README.md,提交 4b3b65b
工具
0版本历史
2- v3.0.3最新Oct 12, 2026
- v3.0.2Oct 9, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分