Send Emails via SendGrid API
Send single, batch, templated, or scheduled emails via SendGrid - plus template creation and email performance stats.
Why it matters
Integrate AI assistants with SendGrid to programmatically send, manage, and track email communications, including templated and batch messages.
Outcomes
What it gets done
Send individual and batch emails
Utilize and create email templates
Schedule email delivery
Retrieve email statistics
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-sendgrid | bash Capabilities
Tools your agent gets
Send plain text or HTML emails to recipients
Send dynamic emails using pre-built SendGrid templates
Send emails to multiple recipients simultaneously
View existing email templates in SendGrid account
Get email statistics for a specific time period
Schedule email sending for a future date and time
Create a new dynamic email template in SendGrid
Overview
SendGrid MCP Server
SendGrid MCP Server lets an AI assistant send single, batch, templated, and scheduled emails via SendGrid's API, manage dynamic templates, and retrieve email performance statistics for a date range. Use it for AI-driven email sending and campaign management via SendGrid. Requires a verified SendGrid sender email and API key.
What it does
SendGrid MCP Server lets AI assistants send emails, manage dynamic templates, and pull statistics through SendGrid's API v3, covering single sends, batch sends to multiple recipients, template-based dynamic emails, and future-scheduled sends.
When to use - and when NOT to
Use it when you want an AI assistant to send a one-off email ("Send an invoice reminder to customer@company.com"), a templated dynamic email with variables, a batch announcement to multiple recipients, a scheduled email for a future time, or to review email performance statistics for a date range. Do not use it without a verified SendGrid sender email - FROM_EMAIL must be a sender address already verified in your SendGrid account, and SENDGRID_API_KEY is required for all operations - both credentials should be treated as secrets and never committed to a public repository.
Capabilities
sendEmail: send a plain-text or HTML email to one recipient.sendEmailWithTemplate: send a dynamic email using a SendGrid template ID and variable data.sendBatchEmails: send the same email to multiple recipients at once.scheduleEmail: schedule an email for a future Unix timestamp.listTemplates: view existing dynamic email templates.createTemplate: create a new dynamic template with HTML/plain-text bodies and{{variable}}placeholders.getStats: get email statistics for a date range (e.g. "Show email statistics for January 2024"), aggregated by day/week/month.
How to install
git clone https://github.com/recepyavuz0/sendgrid-mcp-server.git
cd sendgrid-mcp-server
npm install
Configure a .env file:
SENDGRID_API_KEY=your_sendgrid_api_key_here
FROM_EMAIL=your_verified_sender_email@domain.com
Build the project with npm run build, then run it standalone with npm start (the server also communicates over stdin/stdout when launched by an MCP client directly). Configure Cursor or Claude Desktop:
{
"mcpServers": {
"sendgrid-api-mcp-server": {
"command": "npx",
"args": ["-y", "sendgrid-api-mcp-server"],
"env": {
"SENDGRID_API_KEY": "your_api_key",
"FROM_EMAIL": "your_email@domain.com"
}
}
}
}
Also compatible with Zed, VS Code MCP Extension, Continue.dev, and other custom MCP clients using the same config pattern, since the server relies only on the standard MCP protocol rather than client-specific integration code.
Example prompts drawn from the tool docs: "Send email to user@test.com using template d-123456789 with data: {name: 'John', company: 'ABC Corp'}", "Schedule a meeting reminder to user@test.com for tomorrow at 10:00 AM", and "Create a welcome-email template with {{name}} and {{company}} variables".
Who it's for
Marketers, support teams, and developers who want an AI assistant to send transactional or campaign emails, manage templates, and check delivery stats through SendGrid conversationally instead of using the SendGrid dashboard or writing API calls directly.
Source README
SendGrid MCP Server
๐ Model Context Protocol (MCP) server with SendGrid API integration
This project is an MCP server that enables AI assistants (Claude, ChatGPT, etc.) to send emails, manage templates, and track statistics using the SendGrid's API v3.
๐ Features
๐ง Email Operations
- Single Email Sending: Send emails in plain text or HTML format
- Batch Email Sending: Send emails to multiple recipients simultaneously
- Template-based Emails: Send dynamic emails using pre-built templates
- Scheduled Emails: Schedule emails to be sent at a future date and time
๐ Template Management
- Template Listing: View existing email templates
- Template Creation: Create new dynamic email templates
๐ Statistics and Reporting
- Email Statistics: View email statistics for specific date ranges
- Detailed Reports: Get daily, weekly, or monthly reports
๐ ๏ธ Installation
1. Clone the Repository
git clone https://github.com/recepyavuz0/sendgrid-mcp-server.git
cd sendgrid-mcp-server
2. Install Dependencies
npm install
3. Set Environment Variables
Create a .env file in the project root directory:
SENDGRID_API_KEY=your_sendgrid_api_key_here
FROM_EMAIL=your_verified_sender_email@domain.com
Important Notes:
SENDGRID_API_KEY: API key obtained from your SendGrid accountFROM_EMAIL: Verified sender email address in SendGrid
4. Build the Project
npm run build
๐ง Usage
Standalone Execution
npm start
Usage with MCP Client
The MCP server works over stdin/stdout. You can use it with various clients:
๐ฏ Client Integrations
๐ฑ๏ธ Usage with Cursor IDE
To use the MCP server in Cursor:
- Go to Cursor Settings > Extensions > MCP section
- Add a new MCP server:
{
"mcpServers": {
"sendgrid-api-mcp-server": {
"command": "npx",
"args": ["-y", "sendgrid-api-mcp-server"],
"env": {
"SENDGRID_API_KEY": "your_api_key",
"FROM_EMAIL": "your_email@domain.com"
}
}
}
}
- Restart Cursor
- Now you can send emails in Chat:
Example Usage:
"Send a project meeting reminder to john@example.com"
"Send an HTML welcome message to user@test.com"
๐ค Usage with Claude Desktop
For usage in Claude Desktop application:
- Edit your Claude configuration file (
~/.claude_desktop_config.json):
{
"mcpServers": {
"sendgrid-api-mcp-server": {
"command": "npx",
"args": ["-y", "sendgrid-api-mcp-server"],
"env": {
"SENDGRID_API_KEY": "your_api_key",
"FROM_EMAIL": "your_email@domain.com"
}
}
}
}
- Restart Claude Desktop
- Give email commands directly in chat
๐ Other MCP Clients
This MCP server is compatible with the following clients since it uses the standard MCP protocol:
- Zed Editor
- VS Code MCP Extension
- Continue.dev
- Custom MCP clients
Similar configuration structure is used for each client.
๐ Available Tools
1. sendEmail - Send Email
Basic email sending functionality.
Parameters:
to: Recipient email addresssubject: Email subjecttext: Email texthtml: HTML format (optional)
Example Usage:
"Send a meeting reminder to ali@example.com: 'We'll meet tomorrow at 2:00 PM.'"
2. sendEmailWithTemplate - Template-based Email
Send dynamic emails using pre-built templates.
Parameters:
to: Recipient email addresssubject: Email subjecttemplateId: SendGrid template IDdynamicData: Template variables
Example Usage:
"Send email to user@test.com using template d-123456789 with data: {name: 'John', company: 'ABC Corp'}"
3. sendBatchEmails - Batch Email
Send emails to multiple recipients simultaneously.
Parameters:
toList: List of recipient email addressessubject: Email subjecttext: Email texthtml: HTML format (optional)
Example Usage:
"Send new feature announcement to john@test.com, jane@test.com, bob@test.com"
4. listTemplates - List Templates
View existing email templates.
Example Usage:
"List existing email templates"
5. getStats - Email Statistics
Get email statistics for a specific date range.
Parameters:
start_date: Start date (YYYY-MM-DD)end_date: End date (YYYY-MM-DD)aggregated_by: Grouping (day/week/month)
Example Usage:
"Show email statistics for January 2024"
6. scheduleEmail - Scheduled Email
Schedule an email to be sent at a future date.
Parameters:
to: Recipient email addresssubject: Email subjecttext: Email textsend_at: Unix timestamp (seconds)html: HTML format (optional)
Example Usage:
"Schedule a meeting reminder to user@test.com for tomorrow at 10:00 AM"
7. createTemplate - Create Template
Create a new dynamic email template.
Parameters:
name: Template namesubject: Email subject templatehtml_body: HTML content (with {{variable}} format)plain_body: Plain text content
Example Usage:
"Create a welcome-email template with {{name}} and {{company}} variables"
๐ก Usage Examples
Simple Email Sending
AI: "Send an invoice reminder to customer@company.com"
Dynamic Email with Template
AI: "Send monthly newsletter to all customers using template d-123456789"
Batch Email Campaign
AI: "Send new policy announcement to team@company.com, sales@company.com, support@company.com"
Statistics Tracking
AI: "Generate this month's email performance report"
Scheduled Campaign
AI: "Schedule weekly meeting reminder to entire team for Monday 9:00 AM"
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.