SendGrid MCP Server

SendGrid MCP Server

Provides an interface to manage email marketing, contact lists, dynamic templates, and email analytics via SendGrid's API.

Garoth

Marketing
Communication
Customer Support
TypeScript
Visit Server

Tools

list_templates

List all email templates in your SendGrid account

create_contact_list

Create a new contact list in SendGrid

validate_email

Validate an email address using SendGrid

get_stats

Get SendGrid email statistics

delete_contacts

Delete contacts from your SendGrid account

list_contacts

List all contacts in your SendGrid account

send_email

Send an email using SendGrid

add_contact

Add a contact to your SendGrid marketing contacts

add_contacts_to_list

Add contacts to an existing SendGrid list

create_template

Create a new email template in SendGrid

get_template

Retrieve a SendGrid template by ID

delete_template

Delete a dynamic template from SendGrid

delete_list

Delete a contact list from SendGrid

list_contact_lists

List all contact lists in your SendGrid account

get_contacts_by_list

Get all contacts in a SendGrid list

list_verified_senders

List all verified sender identities in your SendGrid account

list_suppression_groups

List all unsubscribe groups in your SendGrid account

send_to_list

Send an email to a contact list using SendGrid Single Sends

get_single_send

Get details of a specific single send

list_single_sends

List all single sends in your SendGrid account

remove_contacts_from_list

Remove contacts from a SendGrid list without deleting them

README

SendGrid MCP Server

<img src="assets/sendgrid-logo.png" width="256" height="256" alt="SendGrid Logo" />

A Model Context Protocol (MCP) server that provides access to SendGrid's Marketing API for email marketing and contact management. https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api

Demo

In this demo, we ask the Cline SendGrid agent to make a new contact list, add my emails to it, automatically generate a template for Lost Cities facts, and send the email to the list. In this process, Cline will automatically realize that it needs to know the verified senders we have, and which unsubscribe group to use. A pretty email is delivered to my inboxes, delighting me with Lost Cities!

<img src="assets/1.png" width="760" alt="SendGrid MCP Demo 1" /> <img src="assets/2.png" width="760" alt="SendGrid MCP Demo 2" /> <img src="assets/3.png" width="760" alt="SendGrid MCP Demo 3" /> <img src="assets/4.png" width="760" alt="SendGrid MCP Demo 4" /> <img src="assets/5.png" width="760" alt="SendGrid MCP Demo 5" /> <img src="assets/6.png" width="760" alt="SendGrid MCP Demo 6" /> <img src="assets/7.png" width="760" alt="SendGrid MCP Demo 7" /> <img src="assets/8.png" width="760" alt="SendGrid MCP Demo 8" /> <img src="assets/9.png" width="760" alt="SendGrid MCP Demo 9" />

Important Note on API Support

This server exclusively supports SendGrid's v3 APIs and does not provide support for legacy functionality. This includes:

  • Dynamic templates only - legacy templates are not supported
  • Marketing API v3 for all contact & contact list operations
  • Single Sends API for bulk email sending

Available Tools

Contact Management

list_contacts

Lists all contacts in your SendGrid account.

// No parameters required

add_contact

Add a contact to your SendGrid marketing contacts.

{
  email: string;           // Required: Contact email address
  first_name?: string;     // Optional: Contact first name
  last_name?: string;      // Optional: Contact last name
  custom_fields?: object;  // Optional: Custom field values
}

delete_contacts

Delete contacts from your SendGrid account.

{
  emails: string[];  // Required: Array of email addresses to delete
}

get_contacts_by_list

Get all contacts in a SendGrid list.

{
  list_id: string;  // Required: ID of the contact list
}

List Management

list_contact_lists

List all contact lists in your SendGrid account.

// No parameters required

create_contact_list

Create a new contact list in SendGrid.

{
  name: string;  // Required: Name of the contact list
}

delete_list

Delete a contact list from SendGrid.

{
  list_id: string;  // Required: ID of the contact list to delete
}

add_contacts_to_list

Add contacts to an existing SendGrid list.

{
  list_id: string;    // Required: ID of the contact list
  emails: string[];   // Required: Array of email addresses to add
}

remove_contacts_from_list

Remove contacts from a SendGrid list without deleting them.

{
  list_id: string;    // Required: ID of the contact list
  emails: string[];   // Required: Array of email addresses to remove
}

Email Sending

send_email

Send an email using SendGrid.

{
  to: string;                             // Required: Recipient email address
  subject: string;                        // Required: Email subject line
  text: string;                          // Required: Plain text content
  from: string;                          // Required: Verified sender email address
  html?: string;                         // Optional: HTML content
  template_id?: string;                  // Optional: Dynamic template ID
  dynamic_template_data?: object;        // Optional: Template variables
}

send_to_list

Send an email to a contact list using SendGrid Single Sends.

{
  name: string;                          // Required: Name of the single send
  list_ids: string[];                    // Required: Array of list IDs to send to
  subject: string;                       // Required: Email subject line
  html_content: string;                  // Required: HTML content
  plain_content: string;                 // Required: Plain text content
  sender_id: number;                     // Required: ID of the verified sender
  suppression_group_id?: number;         // Required if custom_unsubscribe_url not provided
  custom_unsubscribe_url?: string;       // Required if suppression_group_id not provided
}

Template Management (Dynamic Templates Only)

create_template

Create a new dynamic email template.

{
  name: string;           // Required: Name of the template
  subject: string;        // Required: Default subject line
  html_content: string;   // Required: HTML content with handlebars syntax
  plain_content: string;  // Required: Plain text content with handlebars syntax
}

list_templates

List all dynamic email templates.

// No parameters required

get_template

Retrieve a template by ID.

{
  template_id: string;  // Required: ID of the template to retrieve
}

delete_template

Delete a dynamic template.

{
  template_id: string;  // Required: ID of the template to delete
}

Analytics and Validation

get_stats

Get SendGrid email statistics.

{
  start_date: string;                          // Required: Start date (YYYY-MM-DD)
  end_date?: string;                           // Optional: End date (YYYY-MM-DD)
  aggregated_by?: 'day' | 'week' | 'month';    // Optional: Aggregation period
}

validate_email

Validate an email address using SendGrid.

{
  email: string;  // Required: Email address to validate
}

Account Management

list_verified_senders

List all verified sender identities.

// No parameters required

list_suppression_groups

List all unsubscribe groups.

// No parameters required

Installation

git clone https://github.com/Garoth/sendgrid-mcp.git
cd sendgrid-mcp
npm install

Configuration

  1. Get your SendGrid API key:

    • Log in to your SendGrid account
    • Go to Settings > API Keys
    • Create a new API key with full access permissions
    • Save the API key securely as it won't be shown again
  2. Add it to your Cline MCP settings file inside VSCode's settings (ex. ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json):

{
  "mcpServers": {
    "sendgrid": {
      "command": "node",
      "args": ["/path/to/sendgrid-mcp/build/index.js"],
      "env": {
        "SENDGRID_API_KEY": "your-api-key-here"
      },
      "disabled": false,
      "autoApprove": [
        "list_contacts",
        "list_contact_lists",
        "list_templates",
        "list_single_sends",
        "get_single_send",
        "list_verified_senders",
        "list_suppression_groups",
        "get_stats",
        "validate_email"
      ]
    }
  }
}

Note: Tools that modify data (like sending emails or deleting contacts) are intentionally excluded from autoApprove for safety.

Development

Setting Up Tests

The tests use real API calls to ensure accurate responses. To run the tests:

  1. Copy the example environment file:

    cp .env.example .env
    
  2. Edit .env and add your SendGrid API key:

    SENDGRID_API_KEY=your-api-key-here
    

    Note: The .env file is gitignored to prevent committing sensitive information.

  3. Run the tests:

    npm test
    

Building

npm run build

Important Notes

  • When sending emails to lists, you must provide either a suppression_group_id or custom_unsubscribe_url to comply with email regulations
  • Sender email addresses must be verified with SendGrid before they can be used to send emails
  • All templates are created as dynamic templates with support for handlebars syntax (e.g., {{variable_name}})
  • The Single Sends API is used for all bulk email operations as it provides better tracking and management capabilities
  • The SendGrid API is "eventually consistent" - data changes (like adding contacts or updating lists) may not appear immediately after being made

License

MIT

SendGrid logo copyright / owned by Twilio

Recommended Servers

Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Playwright MCP Server

Playwright MCP Server

Provides a server utilizing Model Context Protocol to enable human-like browser automation with Playwright, allowing control over browser actions such as navigation, element interaction, and scrolling.

Featured
Local
TypeScript
Apple MCP Server

Apple MCP Server

Enables interaction with Apple apps like Messages, Notes, and Contacts through the MCP protocol to send messages, search, and open app content using natural language.

Featured
Local
TypeScript
contentful-mcp

contentful-mcp

Update, create, delete content, content-models and assets in your Contentful Space

Featured
TypeScript
serper-search-scrape-mcp-server

serper-search-scrape-mcp-server

This Serper MCP Server supports search and webpage scraping, and all the most recent parameters introduced by the Serper API, like location.

Featured
TypeScript
The Verge News MCP Server

The Verge News MCP Server

Provides tools to fetch and search news from The Verge's RSS feed, allowing users to get today's news, retrieve random articles from the past week, and search for specific keywords in recent Verge content.

Featured
TypeScript
Google Search Console MCP Server

Google Search Console MCP Server

A server that provides access to Google Search Console data through the Model Context Protocol, allowing users to retrieve and analyze search analytics data with customizable dimensions and reporting periods.

Featured
TypeScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
@kazuph/mcp-gmail-gas

@kazuph/mcp-gmail-gas

Model Context Protocol server for Gmail integration. This allows Claude Desktop (or any MCP client) to interact with your Gmail account through Google Apps Script.

Featured
JavaScript