mcpField
M
mcp-sendgrid

mcp-sendgrid

Local
github.com/codesparCommunication275Updated 4w ago

About mcp-sendgrid

mcp-sendgrid is an MCP server for SendGrid that exposes 20 tools for transactional and marketing email. It targets agents building commerce notification flows and can be paired with @codespar/mcp-twilio for SMS and WhatsApp coverage.

Key features

  1. 01Send plain and dynamic template emails
  2. 02Manage marketing contacts and contact lists
  3. 03Handle bounces and unsubscribe group suppressions
  4. 04Inspect Event Webhook settings and email stats

Use cases

  1. 01Send order confirmation and shipping update emails
  2. 02Send reminder emails for abandoned carts
  3. 03Manage unsubscribe lists and bounced addresses

MCP support

This is an MCP server that exposes SendGrid email sending, contacts, templates and suppression operations as 20 tools to MCP clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-sendgrid": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-sendgrid"
],
"env": {
"SENDGRID_API_KEY": "<SENDGRID_API_KEY>",
"SENDGRID_FROM_EMAIL": "<SENDGRID_FROM_EMAIL>"
}
}
}
}
Run commandnpx -y @codespar/mcp-sendgrid
Environment variables to set
SENDGRID_API_KEYSecretSendGrid API key. Used as Bearer token in the Authorization header.
SENDGRID_FROM_EMAILOptional default From address used by send_mail / send_template when `from.email` is omitted. Must be a Verified Sender or authenticated domain.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@codespar/mcp-sendgrid0.2.2

Tools

20

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
asmobjectNoUnsubscribe group settings: { group_id, groups_to_display? }
fromobjectNoSender. { email, name? }. If omitted, SENDGRID_FROM_EMAIL is used.
contentarrayNoContent blocks: [{ type: 'text/plain' | 'text/html', value }]. Omit if using template_id.
send_atnumberNoUnix timestamp to schedule send (must be within 72h)
subjectstringNoGlobal subject (overridden by personalization.subject)
reply_toobjectNoOptional reply-to. { email, name? }
categoriesarrayNoUp to 10 category tags for analytics
attachmentsarrayNoAttachments: [{ content (base64), type, filename, disposition?, content_id? }]
template_idstringNoDynamic template id (starts with `d-`). Use with dynamic_template_data on each personalization.
mail_settingsobjectNoe.g. { sandbox_mode: { enable: true } }
personalizationsarrayYesArray of personalization objects. Each has `to` (array of {email,name}), optional `cc`, `bcc`, `subject`, `dynamic_template_data`, `substitutions`.
tracking_settingsobjectNoClick / open / subscription tracking config

Details

From the project README

@codespar/mcp-sendgrid

MCP server for SendGrid — global transactional and marketing email.

SendGrid is Twilio-owned (acquired 2019). Together with @codespar/mcp-twilio this package closes the messaging loop:

  • Twilio — SMS, WhatsApp, Voice, Verify
  • SendGrid — email (transactional + marketing)

Agents building commerce notification flows — order confirmations, shipping updates, abandoned-cart nudges, promos — can now cover every channel through two packages.

Tools (20)

ToolPurpose
send_mailSend an email via POST /mail/send.
send_templateConvenience wrapper for POST /mail/send with a dynamic template.
add_contactUpsert contacts in Marketing Campaigns via PUT /marketing/contacts.
list_contactsList Marketing Campaigns contacts via GET /marketing/contacts.
delete_contactDelete contacts by id via DELETE /marketing/contacts?ids=....
search_contactsSearch contacts with an SGQL query via POST /marketing/contacts/search.
get_contactRetrieve a single Marketing Campaigns contact by id via GET /marketing/contacts/{id}.
list_listsList all Marketing Campaigns contact lists via GET /marketing/lists.
create_listCreate a Marketing Campaigns contact list via POST /marketing/lists.
delete_listDelete a Marketing Campaigns contact list via DELETE /marketing/lists/{id}.
list_templatesList transactional templates via GET /templates.
create_templateCreate a transactional template via POST /templates.
list_suppressionsList all suppressed recipients for an unsubscribe group via GET /asm/groups/{group_id}/suppressions.
add_suppressionAdd recipients to a suppression group via POST /asm/groups/{group_id}/suppressions.
list_unsubscribe_groupsList all unsubscribe groups on the account via GET /asm/groups.
get_bouncesRetrieve bounced recipients via GET /suppression/bounces.
delete_bounceRemove a bounced address from the bounce suppression list via DELETE /suppression/bounces/{email}.
cancel_scheduled_sendCancel or pause a scheduled send by batch_id via POST /user/scheduled_sends.
get_event_webhook_settingsRetrieve the Event Webhook configuration via GET /user/webhooks/event/settings.
get_statsGlobal email stats via GET /stats.

Install

npm install @codespar/mcp-sendgrid

Environment

SENDGRID_API_KEY="SG...."         # required (secret)
SENDGRID_FROM_EMAIL="[email protected]"   # optional default sender

The SENDGRID_FROM_EMAIL must be either a Verified Sender or belong to an authenticated domain.

Authentication

Bearer-token auth. The server handles this automatically.

Authorization: Bearer <SENDGRID_API_KEY>

API surface

  • Base URL: https://api.sendgrid.com/v3
  • All requests/responses are application/json
  • POST /mail/send returns 202 Accepted on success (no body)

Send with a dynamic template

{
  "to": "[email protected]",
  "template_id": "d-abc123...",
  "dynamic_template_data": {
    "order_id": "1001",
    "total_brl": "R$ 249,90",
    "tracking_url": "https://example.com/track/1001"
  }
}

Run

# stdio (default — for Claude Desktop, Cursor, etc)
npx @codespar/mcp-sendgrid

# HTTP (for server-to-server testing)
MCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-sendgrid

Pairs with

Enterprise

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.