
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 分