Amazon SES Sample MCP Server (SESv2)
Explore the Amazon SESv2 sample MCP server to send and manage emails—follow the AWS blog post for setup and usage details.
npx -y @aws-samples/sample-for-amazon-ses-mcpOverview
This repository provides a sample Model Context Protocol (MCP) server that demonstrates how to integrate MCP-compatible model clients with Amazon Simple Email Service (SES) v2. The project is a reference implementation you can run locally or deploy to AWS to prototype workflows where language models generate or manage email content and SES handles delivery, templating, and event tracking.
The sample server is useful for developers who want a concrete example of connecting LLM-driven content generation to a production email system. It shows how to accept MCP requests, convert model outputs into email payloads, call SESv2 APIs, and surface delivery or template-management operations back to the model or downstream systems.
Features
- Reference MCP server implementation for working with Amazon SESv2
- Send transactional and templated emails using SESv2 APIs
- Create and manage email templates (sample flows)
- Example configuration for local development and containerized deployment
- Guidance on SES identity verification and IAM permissions
- Links to resources: repository, AWS blog post, SES documentation, MCP specification
Installation / Configuration
Clone the GitHub repository and start the server. The sample includes environment-driven configuration to connect to AWS.
- Clone the repo:
- Install dependencies (Node/npm is typical for this sample):
- Create a .env file (example below) or export environment variables:
# .env
AWS_ACCESS_KEY_ID=YOUR_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY
AWS_REGION=us-east-1
[email protected]
PORT=8080
- Start the server:
# or
- (Optional) Run in Docker:
Environment variables reference:
| Variable | Description |
|---|---|
| AWS_ACCESS_KEY_ID | AWS access key with SES permissions |
| AWS_SECRET_ACCESS_KEY | AWS secret key |
| AWS_REGION | AWS region for SES (e.g., us-east-1) |
| SES_FROM_ADDRESS | Verified “From” address in SES |
| PORT | Server listen port (default 8080) |
Important AWS steps:
- Verify the sender email or domain in the SES console (or use a domain verified for production delivery).
- In non-production SES accounts (sandbox), verify recipient addresses or request sandbox removal.
- Grant the IAM user/role permissions such as ses:SendEmail, ses:SendRawEmail, ses:CreateTemplate, ses:DeleteTemplate, ses:GetTemplate, and ses:ListTemplates.
Available Resources
- GitHub repository: https://github.com/aws-samples/sample-for-amazon-ses-mcp
- AWS blog post: follow the linked AWS blog post in the repo for full setup and usage walkthroughs (contains step-by-step guidance and screenshots).
- Amazon SES documentation: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/
- MCP specification and examples (check the repo README for links to the protocol spec)
Use Cases
- Automated transactional emails: Use an LLM to assemble personalized receipt or confirmation content, then call SESv2 to deliver it reliably.
- Example: A model receives order context via MCP, generates a friendly receipt email body and subject, and the server sends it through SESv2 with appropriate headers.
- Template-driven campaigns: Maintain templates in SES and have models fill personalization slots before sending.
- Example: Generate dynamic snippets (e.g., personalized recommendations) and merge them into a stored SES template for scalable delivery.
- Support and summarization workflows: Automatically generate summarized responses to customer tickets and send them as email replies.
- Example: Model reads conversation context, produces a concise reply, and the MCP server dispatches the outgoing email and logs delivery status.
- A/B testing and content optimization: Send variant content from model-generated options and use SES delivery events to measure engagement.
- Example: Request several subject/body variants from a model, send each to a cohort using SES, and track opens/clicks for iteration.
Helpful Tips
- Start in an SES sandbox for safe testing, then request production sending quotas once ready.
- Keep credentials secure; prefer IAM roles when deploying on AWS services (ECS, Lambda, EC2).
- Monitor SES sending metrics and event notifications (SNS) to handle bounces and complaints.
- Consult the repo’s examples and the AWS blog post for sample MCP request/