
Introduction
As LLMs become more popular, they face two main challenges: their knowledge is restricted to what they were trained on (with a knowledge cut-off), and their ability to interact with external tools is often limited.
Model Context Protocol (MCP) Servers address these issues by providing a unified interface for LLMs to communicate with custom APIs, enabling you to supply additional context and tools to the models.
For easy integration with Sitecore Send, I've created a Sitecore Send MCP Server.
In this article, I will show the details of the Sitecore Send MCP Server and provide an example of its usage.
Sitecore Send MCP Server (My Implementation)
My implementation of the Sitecore Send MCP Server can be found here:
Currently, the following tools are available:
send_smtp_email
- send an email using SMTPget_lists
- get email listsget_list_members
- get email list membersadd_list_member
- add a subscriber to an email listremove_list_member
- remove a subscriber from an email listsend_transactional_email
- send an email using the transactional email service
Use the following JSON to add the server to any LLM client supporting MCP (GitHub Copilot, Claude, or any other client):
{
"send-mcp": {
"command": "npx",
"args": [
"send-mcp"
],
"env": {
"API_KEY": "xxxxx",
"TRANSACTIONAL_EMAILS_CAMPAIGN_ID": "xxxxx",
"SMTP_ENABLED": "true",
"SMTP_FROM": "xxxxx",
"SMTP_USER": "xxxxx",
"SMTP_PASSWORD": "xxxxx"
}
}
}
Connecting to the MCP server
For the LLM client, I use 5ire (which, of course, supports MCP).
MCP currently supports two transports:
stdio
- connect to the server using standard input and output (run the server locally)- Streamable HTTP - uses HTTP POST requests for client-to-server communication and optional Server-Sent Events (SSE) streams for server-to-client communication (connect to a remote server)
stdio
transport
If you are using the stdio
mode, you can connect to the server using the following command:
Command:
npx -y send-mcp
The actual list of environment variables can be observed here.
Streamable HTTP transport
If you are using the Streamable HTTP mode, you can start the server and connect to it.
- Create a
.env
file:# required properties API_KEY=[Sitecore Send API Key] TRANSACTIONAL_EMAILS_CAMPAIGN_ID=[Transactional Emails Campaign ID] # if you want to use SMTP SMTP_ENABLED=true SMTP_FROM=[SMTP email from] SMTP_USER=[SMTP connection user] SMTP_PASSWORD=[SMTP connection password] # optional properties: these are default values, but you can overwrite them SMTP_HOST=smtp.mailendo.com SMTP_PORT=25 API_BASE_URL=https://api.sitecoresend.io/v3
-
Start the server:
npx send-mcp http --port 3000
-
Connect to the server:
URL to connect (port is specified in CLI, 3000 by default):
http://localhost:3000/mcp
Retrieve lists and subscribers information
Sending an email
As we have the tools send_smtp_email
and send_transactional_email
, we can ask the LLM to
generate and send an email to a particular subscriber.
Here is an example. When we ask to send an email, the LLM chooses the correct tool and executes it.
When the email is sent, we get information about it.
The email itself looks like this:
Implementation details:
Conclusion
As I just showed, with an MCP server it's possible (and easy!) to connect any LLM to your Sitecore Send instance and use it to get lists and subscriber information, send emails, and much more.
If you have any ideas how this MCP server can be improved, please let me know (email me or find me in Sitecore Slack).