SendGrid MCP Server

Transactional SendGrid MCP: preflight send, templates, delivery diagnostics, account/console settings, optional Event Webhook receiver. Self-hosted binary, BYOK.

Documentation

SendGrid

SendGrid MCP Server

MCP server for Twilio SendGrid: transactional email with preflight checks, template management, delivery diagnostics, account/console settings, and optional local Event Webhook capture.

End users run a single compiled binary — Bun is not required.

Contact/list marketing CRUD is intentionally out of scope.

This project is community-maintained and is not affiliated with, endorsed by, or sponsored by Twilio SendGrid.

Features

  • Safe sendvalidate_send_request, send_with_preflight, sandbox mode
  • Templates — list/create/update/activate dynamic templates
  • Diagnostics — Email Activity, suppressions, stats, error classification, delivery triage
  • Webhooks — Event Webhook config in SendGrid + optional local receiver (ngrok-friendly)
  • Account & console — verified senders, domain auth, mail/tracking settings, alerts, inbound parse

Full tool catalog: MCP_TOOLS.md

Install (binary)

Download the binary for your OS from GitHub Releases.

PlatformAsset
Linux x64sendgrid-linux-x64
Linux arm64sendgrid-linux-arm64
macOS Intelsendgrid-darwin-x64
macOS Apple Siliconsendgrid-darwin-arm64
Windows x64sendgrid-windows-x64.exe
chmod +x sendgrid-linux-x64
mv sendgrid-linux-x64 ~/.local/bin/sendgrid

The binary is built with bun build --compile and embeds the Bun runtime. Users do not install Bun.

Requirements

  • A SendGrid API key with scopes for the tools you use
  • A verified sender address matching SENDGRID_FROM_EMAIL
  • An MCP client (Cursor, Claude Desktop, VS Code, etc.)

Each user runs the server locally with their own API key (bring-your-own-key). Do not share one hosted instance with shared credentials.

Configuration

Required environment variables

VariableDescription
SENDGRID_API_KEYSendGrid API key (SG....)
SENDGRID_FROM_EMAILDefault From address (verified sender)

Optional

VariableDefaultDescription
SENDGRID_FROM_NAMESendGrid MCPDefault From display name
SENDGRID_REGIONglobalUse eu for https://api.eu.sendgrid.com/v3
SENDGRID_API_BASE_URLhttps://api.sendgrid.com/v3Full SendGrid API base URL override
SENDGRID_MCP_LOG_LEVELinfodebug | info | warn | error

Optional: local Event Webhook receiver

Enabled only when SENDGRID_EVENT_WEBHOOK_PORT is set.

VariableDefault
SENDGRID_EVENT_WEBHOOK_PORT(disabled)
SENDGRID_EVENT_WEBHOOK_HOST0.0.0.0
SENDGRID_EVENT_WEBHOOK_PATH/sendgrid/events
SENDGRID_EVENT_WEBHOOK_HEALTH_PATH/sendgrid/events/health
SENDGRID_EVENT_WEBHOOK_MAX_EVENTS5000
SENDGRID_EVENT_WEBHOOK_VERBOSEfalse
SENDGRID_EVENT_WEBHOOK_REQUIRE_SIGNATUREfalse
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY— (required if signature enforced)

Point SendGrid Event Webhook URL to your tunnel, e.g. https://<ngrok-host>/sendgrid/events. Inspect events via MCP tools get_received_webhook_events / get_webhook_receiver_status.

For public tunnels, prefer signed webhook verification: SENDGRID_EVENT_WEBHOOK_REQUIRE_SIGNATURE=true and SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY=<SendGrid public key>.

MCP client setup

Cursor

Settings → MCP → add server (or edit ~/.cursor/mcp.json):

{
  "mcpServers": {
    "sendgrid": {
      "command": "/absolute/path/to/sendgrid",
      "args": [],
      "env": {
        "SENDGRID_API_KEY": "SG.xxx",
        "SENDGRID_FROM_EMAIL": "[email protected]",
        "SENDGRID_FROM_NAME": "Your App"
      }
    }
  }
}

Claude Desktop

{
  "mcpServers": {
    "sendgrid": {
      "command": "/absolute/path/to/sendgrid",
      "args": [],
      "env": {
        "SENDGRID_API_KEY": "SG.xxx",
        "SENDGRID_FROM_EMAIL": "[email protected]"
      }
    }
  }
}

Restart the client after changing MCP config.

Safety

  • Send tools can enqueue real email. Prefer send_with_preflight in automation.
  • Mutating console tools require confirmToken: "CONFIRM" (alerts, mail/tracking settings, verified senders, domains, webhooks).
  • Email Activity (/v3/messages) may require the Email Activity add-on.

Development (maintainers only)

Bun is only needed to build from source, not to run the release binary.

git clone https://github.com/Neschadin/sendgrid-mcp.git
cd sendgrid-mcp
bun install
bun run dev          # stdio MCP from TypeScript
bun run build        # compile → bin/sendgrid (local platform)
./scripts/build-release.sh   # all release targets → dist/
bun run lint
bun run typecheck
bun run smoke

MCP Inspector

SENDGRID_API_KEY=SG.xxx [email protected] bun run inspect

Docs

License

MIT — see LICENSE.