mcp-sendgrid — Claude Code MCP server: email, install
Connects SendGrid to an AI agent for transactional and marketing email, templates, contacts, suppression data, and delivery stats.
claude mcp add --env SENDGRID_API_KEY=<SENDGRID_API_KEY> --env SENDGRID_FROM_EMAIL=<SENDGRID_FROM_EMAIL> --transport stdio sendgrid -- npx -y @codespar/mcp-sendgridWhat mcp-sendgrid does
mcp-sendgrid exposes 20 SendGrid tools to an agent. It can send direct messages or use dynamic templates, maintain Marketing Campaigns contacts and lists, manage transactional templates, and inspect unsubscribe groups and suppression records. The server also provides bounce data, account email stats, scheduled-send controls, and Event Webhook settings.
Set SENDGRID_API_KEY before starting it. SENDGRID_FROM_EMAIL is optional, but that address must be a Verified Sender or belong to an authenticated domain. The package runs through npx over stdio, with an HTTP mode available for server-to-server testing. The server cannot connect without SENDGRID_API_KEY.
What it helps with
- send a transactional email through SendGrid
- fill a message with a dynamic template
- upsert or search a marketing contact
- inspect bounced recipients
- read account-wide email statistics
Example prompts for the agent
- Send a SendGrid email to the buyer confirming the order.
- Use template
d-abc123...and fill it with the order details. - Search Marketing Campaigns contacts with an SGQL query.
How to install mcp-sendgrid
Platform CLI
claude mcp add --env SENDGRID_API_KEY=<SENDGRID_API_KEY> --env SENDGRID_FROM_EMAIL=<SENDGRID_FROM_EMAIL> --transport stdio sendgrid -- npx -y @codespar/mcp-sendgridReplace <…> with your own values
Platform CLI
codex mcp add sendgrid --env SENDGRID_API_KEY=<SENDGRID_API_KEY> --env SENDGRID_FROM_EMAIL=<SENDGRID_FROM_EMAIL> -- npx -y @codespar/mcp-sendgridReplace <…> with your own values
Config file
{
"mcpServers": {
"sendgrid": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-sendgrid"
],
"env": {
"SENDGRID_API_KEY": "<SENDGRID_API_KEY>",
"SENDGRID_FROM_EMAIL": "<SENDGRID_FROM_EMAIL>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"sendgrid": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@codespar/mcp-sendgrid"
],
"env": {
"SENDGRID_API_KEY": "<SENDGRID_API_KEY>",
"SENDGRID_FROM_EMAIL": "<SENDGRID_FROM_EMAIL>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e SENDGRID_API_KEY=<SENDGRID_API_KEY> -e SENDGRID_FROM_EMAIL=<SENDGRID_FROM_EMAIL> sendgrid npx -y @codespar/mcp-sendgridReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mcp-sendgrid
How do I install mcp-sendgrid in Claude Code?
Run claude mcp add mcp-sendgrid -e SENDGRID_API_KEY=<SENDGRID_API_KEY> -- npx -y @codespar/mcp-sendgrid. This registers the server with the SendGrid key.
What does mcp-sendgrid do?
It gives an agent SendGrid operations for email delivery, dynamic templates, contacts, lists, suppressions, bounce records, and email statistics.
What credentials does mcp-sendgrid need?
Set SENDGRID_API_KEY. When you provide SENDGRID_FROM_EMAIL, it must be a Verified Sender address or belong to an authenticated domain.