Postmark MCP Server
An MCP server implementation that enables sending emails via Postmark email services with features for sending plain text/HTML emails, using templates, tracking delivery statistics, and listing available templates.
README
Postmark MCP Server
An MCP server implementation for Postmark email services.
Features
- Exposes a Model Context Protocol (MCP) server for sending emails via Postmark
- Simple configuration via environment variables
- Comprehensive error handling and graceful shutdown
- Secure logging practices (no sensitive data exposure)
- Automatic email tracking configuration
Requirements
- Node.js (v16 or higher recommended)
- A Postmark account and server token
Setup
-
Clone the repository:
git clone https://github.com/ActiveCampaign/postmark-mcp cd postmark-mcp -
Install dependencies:
npm install -
Configure environment variables:
- Copy
.env.exampleto.env:cp .env.example .env - Edit
.envand fill in your Postmark credentials and settings.
Variable Description Required POSTMARK_SERVER_TOKEN Your Postmark server API token Yes DEFAULT_SENDER_EMAIL Default sender email address Yes DEFAULT_MESSAGE_STREAM Postmark message stream (e.g., 'outbound') Yes - Copy
-
Run the server:
npm start
Quick Install via Cursor Deeplink
You can quickly install this MCP server in Cursor by clicking the following button:
<div> <a href="cursor://anysphere.cursor-deeplink/mcp/install?name=Postmark&config=eyJjb21tYW5kIjoibm9kZSIsImFyZ3MiOlsiaW5kZXguanMiXSwiZW52Ijp7IlBPU1RNQVJLX1NFUlZFUl9UT0tFTiI6IiIsIkRFRkFVTFRfU0VOREVSX0VNQUlMIjoiIiwiREVGQVVMVF9NRVNTQUdFX1NUUkVBTSI6Im91dGJvdW5kIn19"> <img src="https://img.shields.io/badge/Add_Postmark_MCP_Server-to_Cursor-00A4DB?style=for-the-badge&logo=cursor&logoColor=white" alt="Add Postmark MCP Server to Cursor" /> </a> </div>
Note: After clicking the button, you'll need to:
- Set your
POSTMARK_SERVER_TOKENin the MCP configuration- Set your
DEFAULT_SENDER_EMAILin the MCP configuration- Set your
DEFAULT_MESSAGE_STREAMin the MCP configuration (defaults to "outbound")
Claude and Cursor MCP Configuration Example
{
"mcpServers": {
"Postmark": {
"command": "your-node-path", // which node
"args": ["/Users/your-name/your-location/postmark-mcp/index.js"], // realpath index.js
"env": {
"POSTMARK_SERVER_TOKEN": "your-postmark-server-token",
"DEFAULT_SENDER_EMAIL": "your-default-sender-email",
"DEFAULT_MESSAGE_STREAM": "your-default-message-stream"
}
}
}
}
Tool Reference
This section provides a complete reference for the Postmark MCP server tools, including example prompts and expected payloads for each.
Table of Contents
Email Management Tools
1. sendEmail
Sends a single text email.
Example Prompt:
Send an email using Postmark to recipient@example.com with the subject "Meeting Reminder" and the message "Don't forget our team meeting tomorrow at 2 PM. Please bring your quarterly statistics report (and maybe some snacks).""
Expected Payload:
{
"to": "recipient@example.com",
"subject": "Meeting Reminder",
"textBody": "Don't forget our team meeting tomorrow at 2 PM. Please bring your quarterly statistics report (and maybe some snacks).",
"htmlBody": "HTML version of the email body", // Optional
"from": "sender@example.com", // Optional, uses DEFAULT_SENDER_EMAIL if not provided
"tag": "meetings" // Optional
}
Response Format:
Email sent successfully!
MessageID: message-id-here
To: recipient@example.com
Subject: Meeting Reminder
2. sendEmailWithTemplate
Sends an email using a pre-defined template.
Example Prompt:
Send an email with Postmark template alias "welcome" to customer@example.com with the following template variables:
{
"name": "John Doe",
"product_name": "MyApp",
"login_url": "https://myapp.com/login"
}
Expected Payload:
{
"to": "customer@example.com",
"templateId": 12345, // Either templateId or templateAlias must be provided, but not both
"templateAlias": "welcome", // Either templateId or templateAlias must be provided, but not both
"templateModel": {
"name": "John Doe",
"product_name": "MyApp",
"login_url": "https://myapp.com/login"
},
"from": "sender@example.com", // Optional, uses DEFAULT_SENDER_EMAIL if not provided
"tag": "onboarding" // Optional
}
Response Format:
Template email sent successfully!
MessageID: message-id-here
To: recipient@example.com
Template: template-id-or-alias-here
Template Management Tools
3. listTemplates
Lists all available templates.
Example Prompt:
Show me a list of all the email templates available in our Postmark account.
Response Format:
📋 Found 2 templates:
• Basic
- ID: 12345678
- Alias: basic
- Subject: none
• Welcome
- ID: 02345679
- Alias: welcome
- Subject: none
Statistics & Tracking Tools
4. getDeliveryStats
Retrieves email delivery statistics.
Example Prompt:
Show me our Postmark email delivery statistics from 2025-05-01 to 2025-05-15 for the "marketing" tag.
Expected Payload:
{
"tag": "marketing", // Optional
"fromDate": "2025-05-01", // Optional, YYYY-MM-DD format
"toDate": "2025-05-15" // Optional, YYYY-MM-DD format
}
Response Format:
Email Statistics Summary
Sent: 100 emails
Open Rate: 45.5% (45/99 tracked emails)
Click Rate: 15.2% (15/99 tracked links)
Period: 2025-05-01 to 2025-05-15
Tag: marketing
Implementation Details
Automatic Configuration
All emails are automatically configured with:
TrackOpens: trueTrackLinks: "HtmlAndText"- Message stream from
DEFAULT_MESSAGE_STREAMenvironment variable
Error Handling
The server implements comprehensive error handling:
- Validation of all required environment variables
- Graceful shutdown on SIGTERM and SIGINT
- Proper error handling for API calls
- No exposure of sensitive information in logs
- Consistent error message formatting
Logging
- Uses appropriate log levels (
infofor normal operations,errorfor errors) - Excludes sensitive information from logs
- Provides clear operation status and results
For more information about the Postmark API, visit Postmark's Developer Documentation.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。