# SendGrid MCP

> SendGrid MCP Server connects your AI client directly to world-class email infrastructure. It lets you manage everything from marketing list creation and contact updates to sending transactional emails at scale. You can also pull real-time analytics, checking delivery rates and domain reputation—all without touching the SendGrid dashboard or setting up complex SMTP connections.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** transactional-email, email-delivery, smtp, webhooks, email-analytics, marketing-campaigns

## Description

**SendGrid MCP Server** hooks up your AI client directly to world-class email infrastructure. It lets you handle everything from running full campaigns to sending single transactional messages without logging into the SendGrid dashboard or messing with complex SMTP settings.

You manage your entire email operation through conversation. You'll use this server when you need to build targeted segments, update your contact database in bulk, and check performance metrics on every send—all in one place.

### Sending Emails and Templates

When you need to blast out a transactional message, the agent calls `send_email`. This function lets you populate specific fields within a template for each recipient. Before sending, you can use `list_templates` to see every available dynamic email template. If you know the ID of a template and need its structure details, call `get_template` with that ID. You should also check `list_verified_senders` to confirm all your sending domains are verified for peak deliverability.

### Building and Managing Contacts

For marketing work, you start by building segments. Use `create_marketing_list` when you want a brand-new targeted group of people. You can see every list you've created using `list_marketing_lists`. To get the full picture of your audience, call `list_marketing_contacts` to pull a complete record of everyone in your database. When it's time to update or add records for those contacts, run `upsert_contacts`; this function handles both adding brand new people and updating existing ones efficiently.

### Monitoring Performance and Compliance

Keeping track of delivery is huge. To see overall campaign health, call `get_email_stats` which pulls detailed metrics on everything—bounces, opens, clicks—for your whole account. You can also review recent spam complaints by calling `list_spam_reports`, keeping an eye on potential reputation damage. For a high-level look at the entire SendGrid setup, use `get_account_info`. If you're worried about who's allowed to connect or what IP addresses are active, check those details using `list_ip_access`.

This server gives your agent enough tools to manage the full lifecycle: from creating a new segment with `create_marketing_list`, adding thousands of people via `upsert_contacts`, sending the message using `send_email`, and finally checking how well it performed by pulling data with `get_email_stats`.

## Tools

### create_marketing_list
Creates a brand new segment or list for your marketing contacts.

### get_account_info
Retrieves current, high-level details about your overall SendGrid account setup.

### get_email_stats
Pulls detailed statistics on all email activity (bounces, opens, clicks) for the entire account.

### get_template
Fetches specific details about an existing dynamic email template by its ID.

### list_marketing_contacts
Retrieves a list of all current contacts stored in your marketing database.

### list_ip_access
Shows you which IP addresses are currently allowed to connect to your account.

### list_marketing_lists
Shows you every existing segment or group (list) you have created for campaigns.

### list_spam_reports
Lists recent records of emails that were reported as spam by recipients.

### list_templates
Retrieves a list of all available dynamic email templates you can use for sending.

### list_verified_senders
Lists the sender identities (domains) that have been verified for high deliverability.

### send_email
Sends a transactional email using dynamic data to one or more recipients.

### upsert_contacts
Adds new marketing contacts or updates the records for existing ones in bulk.

## Prompt Examples

**Prompt:** 
```
Send a welcome email to test@example.com using template 'd-12345'.
```

**Response:** 
```
Processing email delivery... Your welcome message has been successfully accepted by SendGrid for delivery to test@example.com.
```

**Prompt:** 
```
Show me the email deliverability metrics and domain reputation for all verified sender domains.
```

**Response:** 
```
3 verified sender domains. "yourcompany.com": Reputation score 95/100 (Excellent). DKIM: valid, SPF: valid, DMARC: enforced. Deliverability: 98.4%. Bounce rate: 0.8%. Spam rate: 0.05%. "marketing.yourcompany.com": Score 89/100 (Good). Deliverability: 97.1%. "transactional.yourcompany.com": Score 97/100. Deliverability: 99.2%. Total emails sent today: 12,340. Global suppression list: 234 addresses. IP warmup status: fully warmed (all 4 IPs).
```

**Prompt:** 
```
Send a transactional email using the order confirmation template to a customer.
```

**Response:** 
```
Email sent via SendGrid. To: customer@email.com. Template: "Order Confirmation" (d-a1b2c3d4). Dynamic data populated: order number #ORD-2025-456, 3 items totaling $189.97, shipping address, estimated delivery May 22. From: orders@yourcompany.com. Message ID: msg_abc123. Delivered in 0.6 seconds. Open tracking: enabled. Click tracking: enabled on CTA buttons. Categories tagged: "transactional", "order-confirmation". Webhook events will fire for open/click/delivery.
```

## Capabilities

### Send transactional emails
The agent sends a message using a dynamic template to specified recipients.

### Build marketing segments
You create new targeted lists for your email campaigns.

### Update and manage contacts
The agent adds or changes contact records in the main database.

### Check campaign performance
You pull detailed statistics on email delivery, opens, and clicks across your account.

### Monitor sender health
The agent lists and checks the status of all verified sending identities for compliance.

## Use Cases

### Running a quarterly re-engagement campaign
The goal is to target dormant users. The agent first runs `list_marketing_contacts` to get the full list, then filters and calls `create_marketing_list` for 'Dormant Q3 Users.' Finally, it uses `send_email` with a specialized template to trigger the campaign.

### Handling high-volume system alerts
A critical bug requires sending an immediate alert email to 50 internal users. Instead of logging into an SMTP client, you ask the agent to `send_email` using a simple transactional template, populating the error codes and timestamp automatically.

### Auditing sender compliance
Before launching a new campaign, the team needs confirmation that all sending domains are compliant. They call `list_verified_senders` to get a list of approved identities, ensuring no rogue domains are used.

### Cleaning up stale contact data
The marketing team suspects some contacts are outdated. They use `upsert_contacts` with the latest data source and then check `get_account_info` to confirm the record count was updated successfully.

## Benefits

- **Consolidate Reporting:** Stop manually exporting CSVs. Use `get_email_stats` to pull delivery rates, open counts, and click-through data instantly into the chat flow.
- **Maintain Domain Reputation:** Always check your sending identity status using `list_verified_senders`. This ensures you send from domains that are fully vetted, protecting your sender score.
- **Programmatic List Building:** Instead of clicking through multiple screens to segment users, use `create_marketing_list` and `upsert_contacts` to build precise, targeted groups in one go.
- **Transactional Reliability:** Use `send_email` with dynamic templates. You can programmatically populate order numbers, names, and dates for critical alerts without touching HTML editors.
- **Operational Clarity:** Need to know why emails are bouncing? Call `list_spam_reports` or review account metadata via `get_account_info` to quickly diagnose delivery issues.

## How It Works

The bottom line is that your AI client controls SendGrid's full API suite, removing the need for manual UI navigation or separate CLI tools.

1. Subscribe to this server and input your SendGrid API Key into your AI client's settings.
2. Tell your agent what you need: e.g., 'Send a welcome email using template X.'
3. The agent runs the `send_email` tool, pulls necessary data (like contact lists via `list_marketing_contacts`), and delivers the result directly in the chat.

## Frequently Asked Questions

**How do I use get_email_stats to find out how many emails were delivered?**
Run `get_email_stats` and ask for 'total delivery count.' This tool pulls all account-wide data, so you'll get the total number of successfully processed deliveries immediately.

**Can I use send_email to only target users in a specific list?**
Yes. First, call `list_marketing_lists` to find the ID for your desired segment. Then pass that list ID or contact group reference directly into your prompt when calling `send_email`.

**What is the difference between create_marketing_list and upsert_contacts?**
`upsert_contacts` handles the people—it adds or updates records. `create_marketing_list` defines the group—it takes a set of contacts and puts them into a specific campaign segment.

**How do I check if my sending domain is verified using list_verified_senders?**
Simply call `list_verified_senders`. This tool returns all your verified identities. If a critical domain isn't listed, you know immediately that compliance needs attention before sending.

**What does list_ip_access help me check for sender security?**
It shows all IP addresses currently approved for sending. This is crucial for whitelisting and ensuring your domain reputation remains stable across various infrastructure changes.

**If I need to add or update contacts, what format should I use with upsert_contacts?**
You must provide a JSON array of objects. Each object in the array represents one contact record you want to add or modify during the single call.

**How can I use get_template to examine a specific email template's structure?**
This tool retrieves the full details and necessary parameters for any given dynamic template. You check this before sending an email to ensure your custom data maps correctly to the required fields.

**When should I run list_spam_reports if my campaign receives negative feedback?**
Run it immediately to see a detailed log of all reported spam instances. This report tells you which specific emails or senders triggered reports, letting you adjust your content fast.

**Can my AI automatically send an email using a SendGrid dynamic template?**
Yes! Use the `send_email` tool. Provide the destination email and the Template ID, and your agent will deliver the message via SendGrid's infrastructure instantly.

**How do I check the global email statistics for my account?**
Simply ask the agent to run the `get_email_stats` action. Provide a start date, and it will retrieve aggregate metrics including requests, delivered, opens, and clicks.

**How do I find my SendGrid API Key?**
Log in to your SendGrid dashboard, navigate to **Settings** > **API Keys**, and click 'Create API Key' to generate your unique secret key (SG.xxx).