sendgrid

sendgrid

3.5

SendGrid MCP Server is a comprehensive email management platform utilizing SendGrid's Web API v3.

The SendGrid MCP Server is a robust email management platform that leverages SendGrid's Web API v3. This RESTful API is fully featured and designed for easy integration with various applications, providing a powerful set of tools to manage and streamline email communications effectively. The server supports a wide range of functionalities, including sending emails, handling errors, managing alerts, blocks, bounces, invalid emails, spam reports, scheduled sends, unsubscribe groups, suppressions, and tracking settings. It is designed to ensure that email communications are efficient, reliable, and easy to manage, making it an ideal choice for businesses looking to enhance their email operations.

Features

  • Send Mail Status Codes: Provides detailed status codes for successful requests and errors.
  • Error Handling: Offers comprehensive error codes and messages for debugging.
  • Alerts: Tools to update and retrieve alerts.
  • Blocks: Manage blocked email addresses with retrieval and deletion options.
  • Bounces: Tools to manage bounced emails, including retrieval and deletion.

MCP Tools

  • Alerts: Update and retrieve alerts.
  • Blocks: Manage blocked email addresses.
  • Bounces: Manage bounced emails.
  • Invalid Emails: Manage invalid email addresses.
  • Spam Reports: Manage spam reports.
  • Scheduled Sends: Manage scheduled email sends.
  • Unsubscribe Groups: Manage suppression groups.
  • Suppressions (Unsubscribe): Manage email suppressions.
  • Settings - Tracking: Manage tracking settings.
  • Settings - Mail: Manage mail settings.

Usage with Different Platforms

python

python
import sendgrid
from sendgrid.helpers.mail import Mail

sg = sendgrid.SendGridAPIClient(api_key='YOUR_API_KEY')
message = Mail(
    from_email='from@example.com',
    to_emails='to@example.com',
    subject='Sending with SendGrid is Fun',
    html_content='<strong>and easy to do anywhere, even with Python</strong>')
response = sg.send(message)
print(response.status_code)
print(response.body)
print(response.headers)

nodejs

javascript
const sgMail = require('@sendgrid/mail');
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
const msg = {
  to: 'to@example.com',
  from: 'from@example.com',
  subject: 'Sending with SendGrid is Fun',
  text: 'and easy to do anywhere, even with Node.js',
  html: '<strong>and easy to do anywhere, even with Node.js</strong>',
};
sgMail.send(msg).then(() => {
  console.log('Message sent')
}).catch((error) => {
  console.log(error.response.body)
})