SendGrid MCP Server
SendGrid MCP Server provides comprehensive access to SendGrid API v3 through 58 tools for email marketing, transactional email, template management, contacts, and analytics.
Marketing Automations: list, view, update, delete, create workflows; open creator/editor in browser.
Single Send Campaigns: list and view campaigns; open creator/stats pages.
Contacts: create, update, delete, list, search, paginate; manage custom fields and list assignments.
Email Lists: create, update, delete, list; add/remove contacts; open CSV uploader.
Segments & Custom Fields: list, update, delete segments; open segment creator; manage custom contact fields (Text, Number, Date).
Senders: list, create, delete verified senders.
Dynamic Templates: list, get, create, update, delete templates and versions; create full HTML template in one step; open visual editor; supports Handlebars, plain-text generation, test data previews.
Mail Sending: send transactional emails with full personalization; send using dynamic templates with substitution.
Statistics & Analytics: global stats and overviews; breakdowns by browser, client, device, country, mailbox provider, category, subuser; up to 13 months history aggregated day/week/month.
Utilities: get API permission scopes.
Safety & Integration: read-only safety mode blocks mutations by default (can be disabled); supports stdio and Streamable HTTP transports with token or OAuth 2.1 auth; browser integrations for automations, templates, campaigns, segments, and CSV uploads.
Provides comprehensive access to SendGrid's API v3 for email
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SendGrid MCP Servershow me the open rate for our last newsletter campaign"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SendGrid MCP Server
A Model Context Protocol (MCP) server that provides comprehensive access to SendGrid's API v3 for email marketing, transactional email operations, dynamic template management, and detailed analytics. Features 58 tools covering all aspects of email management and performance analysis.
Built and maintained by a SendGrid engineer, as an independent project — not an official SendGrid product.
v1.1.0 — new: Streamable HTTP transport with OAuth 2.1 (resource server), in-process TLS, and proxy support. Connect this server from Claude custom connectors, the OpenAI Responses API
mcptool, or any remote MCP client. See Install the server and RELEASES.md.
Features
Marketing Automations: Create and manage email automation workflows
Single Send Campaigns: Manage one-time email campaigns with detailed performance tracking
Contact Management: Complete CRUD operations for contacts with advanced search and bulk operations
Email Statistics & Analytics: Multi-dimensional performance analysis across browsers, devices, geography, and email providers with 13-month historical data
Dynamic Segment Management: Create, update, and delete contact segments with complex filtering criteria that automatically refresh
Dynamic Template Management: Create, manage, and version HTML email templates with Handlebars support for personalization
Custom Fields Management: Define and manage additional contact data fields for enhanced targeting
Mail Sending: Send transactional emails via SendGrid with full personalization support
Sender Identity Management: Manage verified sender identities with authentication tracking
Suppression Lists: Manage bounces, spam reports, and unsubscribes for deliverability optimization
Account Settings: Access account details and configuration management
Browser Integration: Quick links to SendGrid web interface for visual operations
Read-Only Safety Mode: Secure operation mode prevents accidental data modification while maintaining full analytics access
Related MCP server: SMTP MCP Server
Supported MCP Clients
✅ Claude Desktop - Official desktop app ✅ Claude Code - Official CLI tool ✅ Claude custom connectors - via Streamable HTTP (see Install the server) ✅ OpenAI Responses API / Apps SDK - via Streamable HTTP ✅ MCP Market - Hosted, one-click deploy, no install required (see Install the server) ✅ Cline - VS Code extension ✅ Zed Editor - Modern code editor ✅ Continue - VS Code autopilot ✅ Codex CLI - via Streamable HTTP ✅ Any MCP-compatible client
Getting Started
Follow these steps in order — by the end you'll have the server installed (or deployed), your SendGrid API key set, and your MCP client connected.
This is the actual request path, whichever client you end up using — some launch the server locally over stdio, others reach it over the network via Streamable HTTP (MCP Market, self-hosted), which adds a choice of client auth on top:
┌──────────┐
│ Client │
└────┬─────┘
┌──────────────────────┴───────────────────┐
│ │
stdio (local subprocess) HTTP (network)
│ auth: none | token | oauth │
│ │
└──────────────────────┬───────────────────┘
▼
┌────────────────────┐
│ MCP Server │
│ (this repo) │
└─────────┬──────────┘
│ SENDGRID_API_KEY
│ (always required, any transport)
▼
┌────────────────────┐
│ SendGrid API │
└────────────────────┘SENDGRID_API_KEY is required no matter which path you take. READ_ONLY=true
(the default) is a further gate inside the MCP Server box — it blocks
create/update/delete/send tools once a request is already in, regardless of
which branch it arrived on. See Environment Variables
for the full list of what you can configure.
1. Install the server
Install it locally if your client launches it itself, or go remote if it connects over the network instead.
Local (stdio) — for Claude Desktop, Claude Code, Cline, Zed, Continue, or any client that runs the server as a subprocess:
npm install -g sendgrid-mcpThis installs the sendgrid-mcp command globally, which your MCP client will launch as a subprocess. Requires Node.js 20+.
Remote (HTTP) — nothing to install locally; pick one:
MCP Market deploys and hosts this server for you — nothing to install locally and no environment variables to manage on your machine. You still need a SendGrid API key; you'll enter it into MCP Market instead of your own shell/config.
From MCP Market's MCP Servers page, deploy a custom MCP from either source:
GitHub — select the GitHub source, choose Public or Private repo, paste the repo URL (
https://github.com/deyikong/sendgrid-mcp), and pick a server name.npm — select the npm source, enter the package name (
sendgrid-mcp), and pick a server name.

Either way, MCP Market builds and runs it for you; it shows up under
MCP Servers with a Running status once ready. Continue to
Configure your MCP client to set your
credentials and connect.
Run the server yourself and expose it over Streamable HTTP instead of letting
a client launch it locally — for Claude custom connectors, OpenAI's Responses
API mcp tool / Apps SDK, or any other remote client.
The MCP endpoint is POST /mcp; GET /health returns a status document for
load balancers. Requests are handled statelessly (no session id required),
which is what hosted clients expect.
none/token/oauth below are not alternate ways to connect — they're
three different locks on the one new door (HTTP), as shown in the
request-flow diagram above.
Quick start (local development)
export SENDGRID_API_KEY="SG.your_api_key_here"
export MCP_TRANSPORT=http
export MCP_AUTH_MODE=token
export MCP_AUTH_TOKEN="$(openssl rand -hex 32)"
sendgrid-mcpAuthentication
Set MCP_AUTH_MODE to one of:
Mode | Use for | Requires |
| Production / remote clients |
|
| Local dev, simple self-hosting |
|
| Loopback development only | — refuses to start on a public bind |
OAuth mode makes this server an OAuth 2.1 resource server. It does not issue or store credentials — it verifies access tokens minted by your existing identity provider (Auth0, Okta, Entra ID, Google, Stytch, …) against that provider's published JWKS.
export MCP_AUTH_MODE=oauth
export MCP_OAUTH_ISSUER="https://your-tenant.auth0.com"
export MCP_OAUTH_AUDIENCE="https://mcp.example.com"
export MCP_OAUTH_REQUIRED_SCOPES="sendgrid:read"
export MCP_PUBLIC_URL="https://mcp.example.com"SENDGRID_API_KEY (see the diagram in Getting Started)
is still required alongside these — OAuth only controls who can reach the server, not what the server
uses to talk to SendGrid.
The server publishes RFC 9728
Protected Resource Metadata at /.well-known/oauth-protected-resource, so
clients discover your authorization server automatically: an unauthenticated
request gets a 401 whose WWW-Authenticate header points at that document,
the client reads it, sends the user to your IdP to log in, and retries with the
resulting token.
Tokens are rejected (401) if expired, wrongly signed, or issued for a
different issuer or audience; a valid token missing a required scope gets 403.
Setting up your identity provider
Whichever provider you use, you're configuring the same three things: an issuer URL, an audience (a stable identifier for this API resource), and a scope clients will request. A few concrete walkthroughs:
Sign in to your Auth0 Dashboard and go to Applications → APIs → Create API.
Set an Identifier — this is your audience, e.g.
https://mcp.example.com. It doesn't need to resolve to anything; it just needs to be unique.Under the API's Permissions tab, add the scopes your server should require, e.g.
sendgrid:read,sendgrid:write.Your Issuer URL is your tenant domain, shown on the API's Settings tab:
https://YOUR_TENANT.auth0.com/.
export MCP_OAUTH_ISSUER="https://YOUR_TENANT.auth0.com/"
export MCP_OAUTH_AUDIENCE="https://mcp.example.com"
export MCP_OAUTH_REQUIRED_SCOPES="sendgrid:read"Sign in to the Okta Admin Console and go to Security → API → Authorization Servers.
Use the
defaultauthorization server, or create a new one. Its Issuer URI, shown at the top of the server's settings page, looks likehttps://{yourOktaDomain}/oauth2/{authServerId}.On the same page, the Audience field (default
api://default) is what you'll use for the audience — set it to something specific to this server, e.g.api://sendgrid-mcp.Open the Scopes tab and add a scope, e.g.
sendgrid:read.
export MCP_OAUTH_ISSUER="https://YOUR_OKTA_DOMAIN/oauth2/YOUR_AUTH_SERVER_ID"
export MCP_OAUTH_AUDIENCE="api://sendgrid-mcp"
export MCP_OAUTH_REQUIRED_SCOPES="sendgrid:read"In the Azure Portal, go to Microsoft Entra ID → App registrations → New registration to represent this MCP server as a resource.
Open the new app's Expose an API page and set the Application ID URI — this becomes your audience, e.g.
api://<client-id>.On the same page, click Add a scope to define one, e.g.
sendgrid.read.Your Issuer URL is
https://login.microsoftonline.com/{tenant-id}/v2.0, where{tenant-id}is the directory (tenant) ID from the app's Overview page.
export MCP_OAUTH_ISSUER="https://login.microsoftonline.com/YOUR_TENANT_ID/v2.0"
export MCP_OAUTH_AUDIENCE="api://YOUR_CLIENT_ID"
export MCP_OAUTH_REQUIRED_SCOPES="sendgrid.read"Other providers (Google Identity Platform, Stytch, …) follow the same shape:
find the OpenID Connect issuer (usually published at
<issuer>/.well-known/openid-configuration), define an audience/resource
identifier for this server, and create a scope for it.
Whichever provider you use, also set MCP_PUBLIC_URL to the
externally-reachable URL of your server (e.g. https://mcp.example.com) —
clients use it during OAuth discovery.
TLS
Either terminate TLS in-process:
export TLS_KEY_FILE=/etc/ssl/private/mcp.key
export TLS_CERT_FILE=/etc/ssl/certs/mcp.crt
export TLS_CA_FILE=/etc/ssl/certs/chain.pem # optional intermediates…or terminate it at a proxy and tell the server to trust the forwarded headers:
export TRUST_PROXY=true
export MCP_PUBLIC_URL="https://mcp.example.com"TRUST_PROXY is off by default because X-Forwarded-* headers are
client-controlled unless a proxy you control overwrites them. TLS 1.2 is the
enforced minimum in in-process mode.
Connecting clients
OpenAI (Responses API):
{
"model": "gpt-5",
"tools": [{
"type": "mcp",
"server_label": "sendgrid",
"server_url": "https://mcp.example.com/mcp",
"authorization": "ACCESS_TOKEN"
}],
"input": "List my SendGrid automations"
}Claude (custom connector): add https://mcp.example.com/mcp as a custom
connector. In oauth mode Claude walks the discovery flow and prompts the user
to log in; in token mode supply the bearer token directly.
Security
The server refuses to start on misconfigurations that would quietly expose your SendGrid account, rather than coming up in a weaker mode than you intended:
Binding to a non-loopback address without either TLS or
TRUST_PROXYMCP_AUTH_MODE=noneon anything but a loopback bindAn
http://MCP_PUBLIC_URLthat is not loopbackA missing or under-length
MCP_AUTH_TOKEN, oroauthmode without an issuer and audienceTLS_KEY_FILEandTLS_CERT_FILEset only one of the pair
Beyond that:
Keep
READ_ONLY=trueunless you need write and send operations. This is the single most effective limit on blast radius — it is the difference between a leaked token exposing analytics and one sending mail from your domain.Set
MCP_ALLOWED_HOSTS/MCP_ALLOWED_ORIGINSto enable DNS-rebinding protection, which matters most for locally bound servers reachable from a browser.Scope your SendGrid API key to only the permissions this server needs; the key is the real credential behind every request.
2. Get your SendGrid API key
Go to SendGrid API Keys
Click "Create API Key"
Choose "Full Access" or select specific permissions
Copy the generated key (starts with
SG.)
3. Configure your MCP client
Once your server is deployed (see Install the server), set your credentials and connect a client.
Set your environment variables
Open your deployed server → the Variables tab → My Credentials, and fill in:

Variable | Required | Description |
| ✅ | Your SendGrid API key (starts with SG.) |
| ❌ | Server name for identification |
| ❌ | Server version |
| ❌ | Logging level (debug, info, warn, error) |
| ❌ | API request timeout in milliseconds |
| ❌ | Enable read-only mode (true/false) |
Each field saves independently — only SENDGRID_API_KEY is required.
Connect a client
Click + Connect on your server's page. MCP Market shows one-click install options for Claude Desktop, Claude Code, Codex CLI, Cursor, VS Code, Windsurf, Cline, JetBrains, Gemini CLI, Amazon Q, Goose, and Continue — pick yours and follow its prompt.

For any other client, use the Connection URL option instead, which gives
you a Streamable HTTP endpoint unique to your deployment. The examples below
use deyikong/sendgrid-mcp for illustration — yours will have your own
username and server name:
https://link.mcpmarket.com/<your-username>/<your-server-name>/mcpWire it up the same way as any other self-hosted endpoint, e.g.:
# Claude Code
claude mcp add --transport http sendgrid https://link.mcpmarket.com/<your-username>/<your-server-name>/mcp
# Codex CLI
codex mcp add sendgrid --url https://link.mcpmarket.com/<your-username>/<your-server-name>/mcpMCP Market manages hosting, TLS, and availability for the deployed server; for account, billing, or deployment questions, refer to MCP Market directly rather than this repository.
The official Claude desktop application with native MCP support.
Configuration File Locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%/Claude/claude_desktop_config.json
Configuration:
{
"mcpServers": {
"sendgrid": {
"command": "sendgrid-mcp",
"env": {
"SENDGRID_API_KEY": "SG.your_api_key_here",
"READ_ONLY": "true"
}
}
}
}Optional Configuration:
{
"mcpServers": {
"sendgrid": {
"command": "sendgrid-mcp",
"env": {
"SENDGRID_API_KEY": "SG.your_api_key_here",
"READ_ONLY": "false",
"LOG_LEVEL": "info",
"REQUEST_TIMEOUT": "30000"
}
}
}
}After configuration:
Save the file
Restart Claude Desktop
The SendGrid MCP server will be available in Claude
Claude's official command-line interface with MCP support.
Installation:
npm install -g @anthropic-ai/claude-codeConfiguration File Location:
All platforms:
~/.claude/config.json
Configuration:
{
"mcpServers": {
"sendgrid": {
"command": "sendgrid-mcp",
"env": {
"SENDGRID_API_KEY": "SG.your_api_key_here",
"READ_ONLY": "true"
}
}
}
}Usage:
# Start Claude Code with SendGrid MCP
claude
# The SendGrid tools will be automatically available
# Ask Claude: "List my SendGrid automations"Popular VS Code extension with MCP support.
Installation:
Install the Cline extension from VS Code marketplace
Open Cline settings
Configuration File:
Open VS Code Settings
Search for "Cline: MCP Settings"
Edit the MCP configuration JSON
Configuration:
{
"mcpServers": {
"sendgrid": {
"command": "sendgrid-mcp",
"env": {
"SENDGRID_API_KEY": "SG.your_api_key_here",
"READ_ONLY": "true"
}
}
}
}Modern code editor with built-in AI and MCP support.
Configuration File Location:
macOS/Linux:
~/.config/zed/settings.jsonWindows:
%APPDATA%/Zed/settings.json
Configuration:
{
"context_servers": {
"sendgrid-mcp": {
"command": "sendgrid-mcp",
"env": {
"SENDGRID_API_KEY": "SG.your_api_key_here",
"READ_ONLY": "true"
}
}
}
}Open-source autopilot for VS Code with MCP support.
Configuration File Location:
All platforms:
~/.continue/config.json
Configuration:
{
"experimental": {
"modelContextProtocolServers": [
{
"command": "sendgrid-mcp",
"env": {
"SENDGRID_API_KEY": "SG.your_api_key_here",
"READ_ONLY": "true"
}
}
]
}
}For any MCP-compatible client not listed above:
Command Line:
# With environment variables
SENDGRID_API_KEY="SG.your_api_key_here" READ_ONLY="true" sendgrid-mcpConfiguration Template:
{
"command": "sendgrid-mcp",
"env": {
"SENDGRID_API_KEY": "SG.your_api_key_here",
"READ_ONLY": "true"
}
}Environment Variables
The server is configured entirely through environment variables. SENDGRID_API_KEY is the only required one.
Variable | Required | Description | Default |
| ✅ | Your SendGrid API key (starts with SG.) | - |
| ❌ | Enable read-only mode (true/false) |
|
| ❌ | Server name for identification |
|
| ❌ | Server version |
|
| ❌ | Logging level (debug, info, warn, error) |
|
| ❌ | API request timeout in milliseconds |
|
READ_ONLY defaults to true. In this mode every tool is registered and visible, but operations that create, update, delete, or send are blocked at runtime with a clear error message — only list/get/search/browser-link tools actually run. This is the safest default while you're getting set up. See Read-Only Mode for the full breakdown of what's blocked, and set READ_ONLY=false once you're ready to allow write and send operations.
These variables are set inside your MCP client's configuration (as an env block) — see Configure your MCP client. Self-hosted HTTP mode has its own set of variables (transport, auth, TLS) — see Install the server.
Read-Only Mode
By default, the SendGrid MCP server runs in read-only mode (READ_ONLY=true) for safety. All tools are registered and available, but mutable operations are blocked at runtime with helpful error messages.
How Read-Only Mode Works
When READ_ONLY=true (default):
All tools are registered and visible to the AI assistant
Non-mutating operations work normally (list, get, search, open browser links)
Mutating operations are blocked with a clear error message:
❌ Operation blocked: Server is running in READ_ONLY mode. Set READ_ONLY=false in your environment to enable write operations.
Read-Only Safe Operations
These 32 operations work normally when READ_ONLY=true:
Automations & Campaigns:
list_automations,get_automation,open_automation_creator,open_automation_editorlist_single_sends,get_single_send,open_single_send_creator,open_single_send_stats
Contacts, Lists & Segments:
list_contacts,get_contact,search_contacts,search_contacts_by_emailslist_email_listslist_segments,open_segment_creatorlist_custom_fields
Senders:
list_senders,open_csv_uploader
Templates:
list_templates,get_template,get_template_version,open_template_editor
Statistics (all read-only by design):
get_global_stats,get_stats_overview,get_stats_by_browser,get_stats_by_client_type,get_stats_by_device_type,get_stats_by_mailbox_provider,get_stats_by_country,get_category_stats,get_subuser_stats
Utilities:
get_scopes
Blocked Operations in Read-Only Mode
These 26 operations are blocked when READ_ONLY=true:
update_automation_settings,update_automation_step,delete_automationcreate_contact,update_contact,delete_contactcreate_contact_with_lists,remove_contact_from_listscreate_email_list,update_email_list,delete_email_listcreate_custom_field,update_custom_field,delete_custom_fieldcreate_sender,delete_senderupdate_segment,delete_segmentcreate_template,update_template,delete_templatecreate_template_version,update_template_version,delete_template_versioncreate_html_templatesend_mail
Full Access Mode
To enable create, update, delete, and send operations, set READ_ONLY=false in your MCP client's env block:
{
"env": {
"SENDGRID_API_KEY": "SG.your_api_key_here",
"READ_ONLY": "false"
}
}This will allow all mutating operations to execute normally while maintaining all read operations.
⚠️ Security Note: Only disable read-only mode if you need write access and trust the environment where the server is running.
Available Tools
The server exposes 58 tools grouped into 10 categories. Every tool is registered regardless of READ_ONLY mode — see Read-Only Mode for which ones are blocked by default.
📚 For natural-language prompts you can say directly to Claude, see EXAMPLE_PROMPTS.md. The examples below show the underlying JSON tool calls.
Tools Summary
Category | Tools | Read-Only | Mutable |
7 | 4 | 3 | |
4 | 4 | 0 | |
7 | 4 | 3 | |
6 | 1 | 5 | |
8 | 3 | 5 | |
4 | 2 | 2 | |
11 | 4 | 7 | |
1 | 0 | 1 | |
9 | 9 | 0 | |
1 | 1 | 0 | |
Total | 58 | 32 | 26 |
Marketing Automations
list_automations- List all marketing automations with metadataget_automation- Get detailed information about a specific automationupdate_automation_settings- Update automation-level settings (name, status)update_automation_step- Update individual step settings (status, wait time)delete_automation- Permanently delete an automationopen_automation_creator- Open automation creator in browseropen_automation_editor- Open specific automation editor
Example — get automation details:
{
"tool": "get_automation",
"arguments": {
"automation_id": "automation_id_here"
}
}Example — pause an entire automation:
{
"tool": "update_automation_settings",
"arguments": {
"automation_id": "automation_id_here",
"status": "paused"
}
}Example — update a single step (status, wait time):
{
"tool": "update_automation_step",
"arguments": {
"automation_id": "automation_id_here",
"step_id": "step_id_here",
"step_status": "active",
"wait_time": 1440
}
}Example — delete an automation:
{
"tool": "delete_automation",
"arguments": {
"automation_id": "automation_id_here"
}
}Single Send Campaigns
list_single_sends- List all single send campaigns with metadataget_single_send- Retrieve detailed content and settings for a single send campaignopen_single_send_creator- Open campaign creator in browser for visual designopen_single_send_stats- View detailed campaign performance statistics
Example — get a campaign's content and settings:
{
"tool": "get_single_send",
"arguments": {
"singlesend_id": "singlesend_id_here"
}
}Contact CRUD Operations
list_contacts- List all contacts with pagination and filteringget_contact- Get detailed information about a specific contactcreate_contact- Create new contacts with custom fieldsupdate_contact- Update existing contact information and custom datadelete_contact- Delete contacts permanently with cleanupsearch_contacts- Search for contacts using advanced query conditionssearch_contacts_by_emails- Search for specific contacts by email addresses
Example — create a new contact:
{
"tool": "create_contact",
"arguments": {
"contacts": [
{
"email": "newuser@example.com",
"first_name": "Jane",
"last_name": "Smith"
}
]
}
}Example — search for contacts by email:
{
"tool": "search_contacts_by_emails",
"arguments": {
"emails": ["john@example.com", "jane@example.com"]
}
}Example — search contacts with a query condition:
{
"tool": "search_contacts",
"arguments": {
"query": "email LIKE '@example.com'",
"page_size": 10
}
}Example — update a contact:
{
"tool": "update_contact",
"arguments": {
"contacts": [
{
"id": "contact_id_here",
"first_name": "John",
"last_name": "Updated"
}
]
}
}Example — delete contacts:
{
"tool": "delete_contact",
"arguments": {
"contact_ids": ["contact_id_1", "contact_id_2"]
}
}Email List Management
list_email_lists- List all email listscreate_email_list- Create a new email listupdate_email_list- Update email list propertiesdelete_email_list- Delete an email listcreate_contact_with_lists- Create contacts and assign to listsremove_contact_from_lists- Remove contacts from a specific list
Example — list email lists:
{
"tool": "list_email_lists",
"arguments": {
"page_size": 100
}
}Example — rename an email list:
{
"tool": "update_email_list",
"arguments": {
"list_id": "list_id_here",
"name": "Updated List Name"
}
}Example — remove contacts from a list:
{
"tool": "remove_contact_from_lists",
"arguments": {
"list_id": "list_id_here",
"contact_ids": ["contact_id_1", "contact_id_2"]
}
}Example — delete an email list:
{
"tool": "delete_email_list",
"arguments": {
"list_id": "list_id_here"
}
}Segments & Custom Fields
list_segments- List dynamic segments with parent relationships and criteriaopen_segment_creator- Open segment creator in browser for visual query buildingupdate_segment- Update existing segment name or query criteria with real-time refreshdelete_segment- Delete an existing segment (contacts remain unaffected)list_custom_fields- List custom field definitions with data typescreate_custom_field- Create new custom fields (Text, Number, Date types)update_custom_field- Update existing custom field definitionsdelete_custom_field- Delete custom field definitions with data cleanup
Example — rename a segment:
{
"tool": "update_segment",
"arguments": {
"segment_id": "segment_id_here",
"name": "Updated Segment Name"
}
}Example — update a segment's query criteria:
{
"tool": "update_segment",
"arguments": {
"segment_id": "segment_id_here",
"query_dsl": "{\"and\": [{\"field\": \"email\", \"value\": \"@example.com\", \"operator\": \"like\"}]}"
}
}Example — delete a segment:
{
"tool": "delete_segment",
"arguments": {
"segment_id": "segment_id_here"
}
}Example — create a custom field:
{
"tool": "create_custom_field",
"arguments": {
"name": "customer_tier",
"field_type": "Text"
}
}Example — update a custom field:
{
"tool": "update_custom_field",
"arguments": {
"field_id": "field_id_here",
"name": "customer_level"
}
}Example — delete a custom field:
{
"tool": "delete_custom_field",
"arguments": {
"field_id": "field_id_here"
}
}Senders & Import
list_senders- List verified sender identitiescreate_sender- Create new sender identitydelete_sender- Delete a verified sender identityopen_csv_uploader- Open CSV upload interface
Example — create a sender identity:
{
"tool": "create_sender",
"arguments": {
"nickname": "Marketing Team",
"from": { "email": "marketing@yourdomain.com", "name": "Your Company" },
"reply_to": { "email": "replies@yourdomain.com", "name": "Your Company" },
"address": "123 Main St",
"city": "Denver",
"state": "CO",
"zip": "80202",
"country": "United States"
}
}Example — delete a sender identity:
{
"tool": "delete_sender",
"arguments": {
"sender_id": "sender_id_here"
}
}Dynamic Templates
list_templates- List all dynamic and legacy templatesget_template- Get details of a specific template including all versionscreate_template- Create a new dynamic templateupdate_template- Update template name and settingsdelete_template- Delete a template and all its versionscreate_template_version- Create a new version with HTML content and settingsget_template_version- Get details of a specific template versionupdate_template_version- Update version content, subject, and settingsdelete_template_version- Delete a specific template versioncreate_html_template- Create complete template with HTML content in one step (perfect for AI agents)open_template_editor- Open SendGrid's visual template editor in browser
Templates support Handlebars syntax for dynamic content ({{variable}}, {{#each}}, {{#if}}), responsive HTML with inline CSS, up to 300 versions per template, test-data previews, and automatic plain-text generation.
Example — create a complete template in one step (best for AI agents):
{
"tool": "create_html_template",
"arguments": {
"template_name": "Welcome Email",
"version_name": "Version 1.0",
"subject": "Welcome to {{companyName}}, {{firstName}}!",
"html_content": "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title>Welcome</title></head><body style=\"font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto;\"><h1 style=\"color: #333;\">Welcome {{firstName}}!</h1><p>Thank you for joining {{companyName}}. We're excited to have you on board.</p></body></html>",
"test_data": "{\"firstName\":\"John\",\"companyName\":\"Acme Corp\"}"
}
}Example — add a new version with HTML content:
{
"tool": "create_template_version",
"arguments": {
"template_id": "your_template_id",
"name": "Newsletter v1.0",
"subject": "{{month}} Newsletter - {{companyName}}",
"html_content": "<!DOCTYPE html><html><head><meta charset=\"utf-8\"></head><body><h1>{{month}} Newsletter</h1>{{#each articles}}<div><h2>{{title}}</h2><p>{{summary}}</p><a href=\"{{link}}\">Read More</a></div>{{/each}}</body></html>",
"test_data": "{\"month\":\"January\",\"companyName\":\"Acme\",\"articles\":[{\"title\":\"Article 1\",\"summary\":\"Summary here\",\"link\":\"https://example.com\"}]}"
}
}Mail Sending
send_mail- Send transactional emails (supports templates with dynamic template data)
Example — send a simple email:
{
"tool": "send_mail",
"arguments": {
"personalizations": [
{
"to": [{"email": "recipient@example.com", "name": "John Doe"}],
"subject": "Hello from SendGrid MCP!"
}
],
"from": {"email": "sender@yourdomain.com", "name": "Your Name"},
"content": [
{
"type": "text/plain",
"value": "Hello! This email was sent via SendGrid MCP server."
}
]
}
}Example — send using a dynamic template:
{
"tool": "send_mail",
"arguments": {
"personalizations": [
{
"to": [{"email": "user@example.com", "name": "John Doe"}],
"dynamic_template_data": {
"firstName": "John",
"companyName": "Acme Corp",
"orderNumber": "12345",
"items": [
{"name": "Product A", "price": "29.99"},
{"name": "Product B", "price": "19.99"}
]
}
}
],
"from": {"email": "noreply@yourcompany.com", "name": "Your Company"},
"template_id": "d-1234567890abcdef1234567890abcdef"
}
}Email Statistics & Analytics
get_global_stats- Retrieve overall email performance metricsget_stats_overview- Get comprehensive statistics across multiple dimensionsget_stats_by_browser- Statistics broken down by browser type (Chrome, Firefox, Safari, etc.)get_stats_by_client_type- Statistics by email client type (desktop, mobile, webmail)get_stats_by_device_type- Statistics by device type (desktop, mobile, tablet)get_stats_by_mailbox_provider- Statistics by mailbox provider (Gmail, Outlook, Yahoo, etc.)get_stats_by_country- Statistics by country and state/provinceget_category_stats- Statistics for specific email categories (13-month history)get_subuser_stats- Statistics for specific subuser accounts
Tracks delivery, open, and click-through rates; bounce rates (hard/soft), spam reports, and unsubscribes; geographic performance and device preferences; email client compatibility and browser rendering; and provider-specific deliverability.
Example — global email statistics:
{
"tool": "get_global_stats",
"arguments": {
"start_date": "2024-01-01",
"end_date": "2024-01-31",
"aggregated_by": "day"
}
}Example — statistics by mailbox provider:
{
"tool": "get_stats_by_mailbox_provider",
"arguments": {
"start_date": "2024-01-01",
"end_date": "2024-01-07",
"aggregated_by": "day",
"mailbox_providers": "gmail.com,outlook.com,yahoo.com"
}
}Example — geographic performance statistics:
{
"tool": "get_stats_by_country",
"arguments": {
"start_date": "2024-01-01",
"end_date": "2024-01-31",
"country": "US",
"aggregated_by": "week"
}
}Example — comprehensive statistics overview:
{
"tool": "get_stats_overview",
"arguments": {
"start_date": "2024-01-01",
"end_date": "2024-01-07",
"aggregated_by": "day",
"include_subusers": false
}
}Utilities
get_scopes- Get available API permission scopes (no arguments)
Available Resources
sendgrid://automations- Marketing automations datasendgrid://singlesends- Single send campaigns datasendgrid://lists- Email lists datasendgrid://contacts- Contact segments datasendgrid://suppressions- Suppression lists (bounces, spam, etc.)sendgrid://account- Account profile informationsendgrid://stats- Global email statistics and performance metrics (30-day overview)sendgrid://stats/browsers- Email statistics by browser type (7-day data)sendgrid://stats/devices- Email statistics by device type (7-day data)sendgrid://stats/geography- Email statistics by geographic location (7-day data)sendgrid://stats/providers- Email statistics by mailbox provider (7-day data)
Available Prompts
sendgrid_automation_help- Get help with marketing automationssendgrid_campaign_help- Get help with single send campaignssendgrid_contacts_help- Get help with comprehensive contact managementsendgrid_list_management_help- Get help with email list CRUD operationssendgrid_update_list_help- Get help with updating/renaming email listssendgrid_contact_crud_help- Get help with contact create/read/update/delete operationssendgrid_custom_fields_help- Get help with custom field definitions managementsendgrid_segment_management_help- Get help with managing dynamic contact segmentssendgrid_sender_management_help- Get help with sender identity managementsendgrid_templates_help- Get help with creating and managing dynamic email templatessendgrid_suppressions_help- Get help with suppression listssendgrid_settings_help- Get help with account settingssendgrid_mail_send_help- Get help with sending emailssendgrid_stats_help- Get help with analyzing email performance and statistics
Development & Contributing
This section is for developers who want to modify the server or contribute to development.
Prerequisites
Node.js 20+ and npm
SendGrid account with API key
Git
Development Setup
# Clone the repository
git clone https://github.com/deyikong/sendgrid-mcp.git
cd sendgrid-mcp
# Install dependencies
npm install
# Build the project
npm run build
# Link for local development
npm link
# Test the local build
sendgrid-mcpUsing a local build in an MCP client (instead of the npm-installed binary):
{
"mcpServers": {
"sendgrid": {
"command": "node",
"args": ["/absolute/path/to/sendgrid-mcp/build/index.js"],
"env": {
"SENDGRID_API_KEY": "SG.your_api_key_here",
"READ_ONLY": "true"
}
}
}
}Project Structure
src/
├── index.ts # Main entry point
├── shared/ # Shared utilities
│ ├── auth.ts # Authentication
│ ├── api.ts # SendGrid API client
│ ├── env.ts # Environment validation
│ └── types.ts # Shared types
├── tools/ # Tool definitions
│ ├── automations.ts # Automation tools (7 tools)
│ ├── campaigns.ts # Campaign tools (4 tools)
│ ├── contacts.ts # Contact, list, segment & sender tools (25 tools)
│ ├── mail.ts # Mail sending tools (1 tool)
│ ├── misc.ts # Miscellaneous tools (1 tool)
│ ├── stats.ts # Statistics tools (9 tools)
│ └── templates.ts # Template tools (11 tools)
├── resources/ # Resource definitions
│ └── sendgrid.ts # MCP resources
└── prompts/ # Prompt definitions
└── help.ts # Help promptsAdding New Tools
Add tool definition to appropriate file in
src/tools/Follow the existing pattern with config and handler
Export from
src/tools/index.tsUpdate README.md with new tool documentation
Run
npm run buildto compile
Available Scripts
npm run build- Compile TypeScript to JavaScriptnpm start- Run the compiled servernpm test- Build and run the test suite
Testing Your Changes
# Build the project
npm run build
# Test with environment variables
SENDGRID_API_KEY="SG.your_key" READ_ONLY="true" node build/index.jsFor manually verifying a real client can connect over each HTTP auth mode (token, none, TLS, OAuth) rather than just the automated suite, see TESTING.md.
Creating a Release
For maintainers only:
Update version in
package.json:npm version patch # or minor, majorPush changes and tags:
git push && git push --tagsCreate GitHub release - this triggers automatic npm publishing via GitHub Actions
Publishing Process
Automated: GitHub Actions publishes to npm on release creation
Provenance: All packages include provenance attestation for security
Versioning: Follows semantic versioning (semver)
Package:
sendgrid-mcpon npm — update withnpm update -g sendgrid-mcp
Troubleshooting
Common Issues
1. Server Not Found / Command Not Found
Error: sendgrid-mcp: command not foundSolution:
Ensure you installed globally:
npm install -g sendgrid-mcpCheck npm global bin directory is in PATH:
npm config get prefixTry reinstalling:
npm uninstall -g sendgrid-mcp && npm install -g sendgrid-mcp
2. Invalid API Key
Error: SENDGRID_API_KEY must start with 'SG.'Solution:
Ensure your API key starts with
SG.Verify you copied the complete key from SendGrid
Check for extra spaces or quotes in your configuration
Generate a new API key at SendGrid API Keys
3. Permission Errors
Error: 403 ForbiddenSolution:
Your API key may not have sufficient permissions
Create a new key with "Full Access" or required scopes
Verify the key hasn't been revoked or expired
4. Read-Only Mode Blocking Operations
❌ Operation blocked: Server is running in READ_ONLY modeSolution:
This is intentional security protection
To enable write operations, set
READ_ONLY: "false"in your MCP client configurationExample:
{ "env": { "SENDGRID_API_KEY": "SG.your_key", "READ_ONLY": "false" } }
5. MCP Client Not Detecting Server
Solution:
Verify the configuration file location for your specific client
Ensure JSON syntax is valid (no trailing commas, proper quotes)
Restart your MCP client after configuration changes
Check client logs for specific error messages
6. Connection Timeout
Error: Request timeoutSolution:
Check your internet connection
Increase timeout in configuration:
{ "env": { "REQUEST_TIMEOUT": "60000" } }Verify SendGrid API is accessible (not blocked by firewall/proxy)
Getting Help
Built-in Help: Use help prompts in your MCP client (e.g., ask Claude: "help with sendgrid automations")
SendGrid API: Official API Documentation
MCP Protocol: Model Context Protocol Docs
Issues: Report bugs at the GitHub repository
Debug Mode
Enable detailed logging by setting the LOG_LEVEL:
{
"env": {
"SENDGRID_API_KEY": "SG.your_key",
"LOG_LEVEL": "debug"
}
}This will provide detailed information about API requests and responses.
License
This project is licensed under the ISC License.
Contributing
Fork the repository
Create a feature branch
Make your changes
Test thoroughly
Submit a pull request
Support
For issues related to:
SendGrid API: Check SendGrid Documentation
MCP Protocol: Check Model Context Protocol
This Server: Open an issue in this repository
Feedback
I work at SendGrid and maintain this project. Feedback, bug reports, and feature requests are always welcome — please open an issue or start a discussion on the repository.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityFmaintenanceProvides an interface to manage email marketing, contact lists, dynamic templates, and email analytics via SendGrid's API.2158129ISC
- AlicenseAqualityAmaintenanceEnables sending emails via SMTP with template management, supporting multiple SMTP configurations, template creation with variable substitution, and bulk email sending with rate limiting.643419MIT
- FlicenseBqualityDmaintenanceEnables management of email campaigns, subscribers, lists, segments, journeys, templates, transactional email, and client/account settings through the Campaign Monitor API via natural language.1001

sendcraft-mcpofficial
AlicenseAqualityDmaintenanceEnables AI agents to send emails, manage campaigns, subscribers, templates, and domains via the SendCraft email API.2626MIT
Related MCP Connectors
Send transactional email, run campaigns, manage contacts and automations, audit deliverability.
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Send transactional email over a verified domain — templates, attachments, custom headers.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/deyikong/sendgrid-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server