SendGrid MCP Server

SendGrid MCP Server

Enables AI models to send emails, manage contacts, and interact with SendGrid's email platform via MCP.

Category
Visit Server

README

SendGrid MCP Server

A production-ready Model Context Protocol (MCP) Server for SendGrid email services, built with FastMCP 2.0. This server enables AI models like Claude, GPT, and others to send emails, manage contacts, and interact with SendGrid's powerful email platform.

šŸš€ Features

  • šŸ“§ Email Management: Send HTML/text emails with templates and attachments
  • šŸ‘„ Contact Management: Add contacts and manage mailing lists
  • šŸ” Secure Authentication: Bearer token authentication with fallback support
  • ⚔ Rate Limiting: Built-in API rate limiting to prevent abuse
  • šŸ›”ļø Production Ready: Comprehensive error handling and logging
  • šŸ”§ Easy Configuration: Environment-based configuration management

šŸ“‹ Requirements

  • Python 3.8+
  • SendGrid API Key
  • FastMCP 2.0

šŸ› ļø Installation

  1. Clone the repository:

    git clone https://github.com/FINCH285/SendGrid-MCP-Server.git
    cd SendGrid-MCP-Server
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Set up environment variables:

    cp .env.example .env
    

    Edit .env with your SendGrid configuration:

    SENDGRID_API_KEY=your_sendgrid_api_key_here
    DEFAULT_FROM_EMAIL=your-verified-email@example.com
    DEFAULT_FROM_NAME=Your Name
    DEFAULT_TEMPLATE_ID=your-template-id
    RATE_LIMIT=10
    DEBUG=false
    

šŸš€ Usage

Running the Server

python main.py

The server will start and listen for MCP connections via STDIO.

Available Tools

Email Tools

  • send_email - Send HTML/text emails to multiple recipients
  • get_template_info - Fetch SendGrid template details
  • send_template_email - Send emails using dynamic templates

Contact Tools

  • add_contact - Add/update contacts with custom fields
  • get_contact_lists - Retrieve all contact lists

šŸ”§ Configuration

Authentication

The server supports two authentication methods:

  1. Environment Variable: Set SENDGRID_API_KEY in your .env file
  2. Bearer Token: Pass API key via Authorization header in MCP requests

šŸ“š SendGrid Configuration example

{
  "mcpServers": {
    "sendgrid-mcp": {
      "command": "python",
      "args": ["/path/to/your/project/main.py"],
      "cwd": "/path/to/your/project",
      "disabled": false,
      "env": {
        "SENDGRID_API_KEY": "SG.your-actual-api-key-here"
      }
    }
  }
}

For Windows users, use paths like:

"args": ["C:\\Users\\YourUsername\\project-folder\\main.py"]  
"cwd": "C:\\Users\\YourUsername\\project-folder"

For macOS/Linux users, use paths like:

"args": ["/Users/yourusername/project-folder/main.py"]
"cwd": "/Users/yourusername/project-folder"

Key configuration elements:

  • "sendgrid-mcp": The server name/identifier (customizable)

  • args: Specifies the path to your main.py file

  • cwd: Sets the working directory to your project folder

  • disabled: Set to false to enable the server

  • env: Contains your SendGrid API key (replace with your actual key starting with "SG.")

šŸ—ļø Architecture

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│   AI Model      │◄──►│   FastMCP       │◄──►│   SendGrid      │
│  (Claude/GPT)   │    │   Server        │    │     API         │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
         │                       │                       │
         │ MCP Protocol          │ HTTP/REST            │
         ā–¼                       ā–¼                       ā–¼
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│   Tools Layer   │    │   Auth Layer    │    │   Config Layer  │
│ • email_tools   │    │ • Bearer Token  │    │ • Environment   │
│ • contact_tools │    │ • API Key Auth  │    │ • Rate Limits   │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

šŸ¤ Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

šŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

šŸ†˜ Support

šŸ™ Acknowledgments

  • SendGrid for their excellent email API
  • FastMCP for the MCP framework
  • Anthropic for the Model Context Protocol specification

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
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
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
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
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured