alibabacloud-direct-mail-mcp
v0.0.2
Published
Local MCP server for Alibaba Cloud Direct Mail lookup plus guarded resource creation, direct email, and batch send task flows.
Maintainers
Readme
alibabacloud-direct-mail-mcp
中文 / English
Alibaba Cloud Direct Mail(邮件推送)的 MCP stdio 服务器,提供查询工具以及受保护的直接邮件、模板创建、模板测试邮件、模板批量任务、标签创建、收件人列表创建和收件人记录追加流程,底层基于 Alibaba Cloud SDK。
如需了解 Direct Mail 产品概念和官方使用说明,请参见阿里云邮件推送官方文档。
运行要求
- Node.js
>=20 - 已开通 Direct Mail 的 Alibaba Cloud 账号
- 具备所需 Direct Mail 权限的 RAM AccessKey ID 和 AccessKey Secret
- 发送流程所需的 Direct Mail 资源,例如已审核通过的发信地址、模板、标签和收件人列表
该服务是 MCP stdio 进程,通常由 MCP Host 启动,不作为交互式 Shell 命令使用。
快速开始
在 MCP Host 环境中配置凭证后,通过 npx 运行已发布的 MCP 服务:
npx -y alibabacloud-direct-mail-mcpMCP Host 配置
配置 MCP Host 通过 npx 启动该包,并通过环境变量传入 Alibaba Cloud 凭证:
{
"mcpServers": {
"aliyun-direct-mail": {
"command": "npx",
"args": ["-y", "alibabacloud-direct-mail-mcp"],
"env": {
"ALIBABA_CLOUD_ACCESS_KEY_ID": "your-access-key-id",
"ALIBABA_CLOUD_ACCESS_KEY_SECRET": "your-access-key-secret",
"ALIYUN_DM_REGION_ID": "cn-hangzhou"
}
}
}
}请先从 Alibaba Cloud RAM 用户创建 AccessKey ID 和 AccessKey Secret,再配置这些环境变量。参考 RAM AccessKey 创建指南。AccessKey Secret 仅在创建时展示,请安全保存。
ALIYUN_DM_REGION_ID 默认值为 cn-hangzhou。Direct Mail region ID 和服务 endpoint 请参考官方 endpoint 文档。
可选 Agent Skill
MCP 服务可独立运行。安装可选 Agent Skill 后,助手可以按 Direct Mail 业务流程更稳定地选择工具、核对预览并处理确认链路。该 skill 只提供助手侧 workflow guidance,不改变 MCP 服务的运行时行为。
下载地址:alibabacloud-direct-mail-agent-skill.zip。
Prompts
支持 MCP listPrompts / getPrompt 的 Host 可以选择按场景使用 workflow guidance。Prompt 细节与外部托管的 skill 保持一致;精确字段仍以工具 schema 和返回的 structuredContent 为准。
| Prompt | 使用场景 |
| ------------------------------------- | ----------------------------------------------- |
| dm_direct_email_send_assistant | 准备向明确收件人发送直接邮件或事务通知邮件。 |
| dm_template_batch_send_assistant | 准备模板 + 收件人列表的批量任务和可选测试发送。 |
| dm_delivery_investigation_assistant | 排查任务进度、投递明细、统计数据或追踪数据。 |
Tools
README 只列出便于快速浏览的用户侧业务工具。精确入参与确认控制字段请查看 MCP Host 返回的工具 schema。
| 工具 | 用途 | 风险级别 |
| -------------------------------- | ------------------------------------------------------ | ------------ |
| dm_get_account_summary | 查看 Direct Mail 账号额度、状态和资源数量。 | 只读 |
| dm_list_mail_addresses | 列出或筛选发信地址。 | 只读 |
| dm_list_config_sets | 列出发信配置集。 | 只读 |
| dm_get_config_set | 查询单个发信配置集详情。 | 只读 |
| dm_list_templates | 在批量任务或测试发送前列出 Direct Mail 模板。 | 只读 |
| dm_get_template | 查询模板主题、状态和内容,供发送前审核。 | 只读 |
| dm_create_template | 预览并在确认后创建邮件模板,创建后等待审核。 | 受保护写操作 |
| dm_list_receivers | 列出收件人列表元数据。 | 只读 |
| dm_list_receiver_details | 查询单个收件人列表明细。 | 只读 |
| dm_create_receiver_list | 预览并在确认后创建空收件人列表。 | 受保护写操作 |
| dm_add_receiver_records | 向联系人列表追加收件人记录。 | 受保护写操作 |
| dm_list_tasks | 列出 Direct Mail 批量任务,用于进度检查。 | 只读 |
| dm_list_tags | 列出用于分类和追踪的标签。 | 只读 |
| dm_create_tag | 预览并在确认后创建标签。 | 受保护写操作 |
| dm_list_send_details | 查询逐收件人或逐邮件的投递明细。 | 只读 |
| dm_get_send_statistics_summary | 查询聚合发送统计数据。 | 只读 |
| dm_list_block_sending | 查询阻断发送记录,例如退订地址。 | 只读 |
| dm_get_track_list | 查询打开和点击追踪数据。 | 只读 |
| dm_list_dedicated_ips | 列出已购买的专属 IP。 | 只读 |
| dm_list_dedicated_ip_pools | 列出专属 IP 池。 | 只读 |
| dm_get_ip_protection | 查询 Direct Mail IP 防护开关状态。 | 只读 |
| dm_send_direct_email | 发送触达类(如验证码)邮件(收件人不多于 100)。 | 受保护发送 |
| dm_start_batch_send_task | 创建批量发送任务,适用于营销邮件场景(无收件人数限制) | 受保护发送 |
| dm_send_template_test_email | 预览并确认发送模板测试邮件,不用于正式发信。 | 受保护发送 |
配置
调用真实 Direct Mail 工具前,请在 MCP Host 配置中设置这些环境变量:
"env": {
"ALIBABA_CLOUD_ACCESS_KEY_ID": "your-access-key-id",
"ALIBABA_CLOUD_ACCESS_KEY_SECRET": "your-access-key-secret",
"ALIYUN_DM_REGION_ID": "cn-hangzhou"
}ALIYUN_DM_REGION_ID 默认值为 cn-hangzhou。Direct Mail region ID 和服务 endpoint 请参考官方 endpoint 文档。
服务启动时会检查 AccessKey 环境变量是否存在,但不会在工具调用 Alibaba Cloud 前验证凭证是否有效。不要提交真实 AccessKey。
联系我们
如果你有任何疑问,欢迎通过邮箱或钉钉交流群联系我们。
- 邮箱:
[email protected] - 钉钉群号:
165445031039

中文 / English
MCP stdio server for Direct Mail lookup tools plus guarded direct email, template creation, template test email, batch send task, tag creation, receiver-list creation, and receiver-record append workflows backed by the Alibaba Cloud SDK.
For Direct Mail product concepts and official usage guidance, see the Alibaba Cloud Direct Mail documentation.
Requirements
- Node.js
>=20 - An Alibaba Cloud account with Direct Mail enabled
- A RAM AccessKey ID and AccessKey Secret with the Direct Mail permissions needed for the tools you plan to use
- Existing Direct Mail resources for send workflows, such as approved sender addresses, approved templates, tags, and recipient lists
The server is an MCP stdio process. It is normally launched by an MCP host, not used as an interactive shell command.
Quick Start
Set credentials in your MCP host environment, then run the published MCP server with npx:
npx -y alibabacloud-direct-mail-mcpMCP Host Configuration
Configure your MCP host to run the package through npx and pass Alibaba Cloud credentials through environment variables:
{
"mcpServers": {
"aliyun-direct-mail": {
"command": "npx",
"args": ["-y", "alibabacloud-direct-mail-mcp"],
"env": {
"ALIBABA_CLOUD_ACCESS_KEY_ID": "your-access-key-id",
"ALIBABA_CLOUD_ACCESS_KEY_SECRET": "your-access-key-secret",
"ALIYUN_DM_REGION_ID": "cn-hangzhou"
}
}
}
}Create the AccessKey ID and AccessKey Secret from an Alibaba Cloud RAM user before setting these environment variables. See the Alibaba Cloud RAM guide. Store the AccessKey Secret securely because Alibaba Cloud shows it only when it is created.
ALIYUN_DM_REGION_ID defaults to cn-hangzhou. For Direct Mail region IDs and service endpoints, see the official endpoint reference.
Optional Agent Skill
The MCP server runs independently. Installing the optional agent skill helps assistants follow Direct Mail workflows more reliably when choosing tools, reviewing previews, and handling the confirmation flow. The skill only provides assistant-side workflow guidance and does not change MCP server runtime behavior.
Download: alibabacloud-direct-mail-agent-skill.zip
Prompts
Hosts that support MCP listPrompts / getPrompt can choose scenario-specific workflow guidance. The prompt details are aligned with the externally hosted skill, while the tool schemas and returned structuredContent remain the source of truth for exact fields.
| Prompt | Use when |
| ------------------------------------- | ------------------------------------------------------------------------- |
| dm_direct_email_send_assistant | Preparing direct or transactional sends to explicit recipients. |
| dm_template_batch_send_assistant | Preparing template-and-receiver-list batch tasks and optional test sends. |
| dm_delivery_investigation_assistant | Investigating task progress, delivery details, statistics, or tracking. |
Tools
This README lists the user-facing business tools at a scan-friendly level. For exact input schemas and confirmation control fields, inspect the tool schemas returned by your MCP host.
| Tool | Purpose | Risk |
| -------------------------------- | -------------------------------------------------------------------------------------------- | ------------- |
| dm_get_account_summary | Inspect Direct Mail account quota, status, and resource counts. | Read-only |
| dm_list_mail_addresses | List or filter sender addresses. | Read-only |
| dm_list_config_sets | List sender configuration sets. | Read-only |
| dm_get_config_set | Retrieve one sender configuration set. | Read-only |
| dm_list_templates | List Direct Mail templates before choosing one for a batch or test send. | Read-only |
| dm_get_template | Retrieve template subject, status, and content for review. | Read-only |
| dm_create_template | Preview and create an email template after confirmation; created templates need approval. | Guarded write |
| dm_list_receivers | List recipient list metadata. | Read-only |
| dm_list_receiver_details | Inspect one recipient list schema and paged receiver details. | Read-only |
| dm_create_receiver_list | Preview and create an empty recipient list after confirmation. | Guarded write |
| dm_add_receiver_records | Preview and append records to a recipient list after schema validation and confirmation. | Guarded write |
| dm_list_tasks | List Direct Mail batch tasks for progress checks. | Read-only |
| dm_list_tags | List tags used for classification and tracking. | Read-only |
| dm_create_tag | Preview and create a tag after confirmation. | Guarded write |
| dm_list_send_details | Inspect per-recipient or per-message delivery details. | Read-only |
| dm_get_send_statistics_summary | Inspect aggregate sending counts and rates. | Read-only |
| dm_list_block_sending | Inspect blocked sending records, such as unsubscribed addresses. | Read-only |
| dm_get_track_list | Inspect open and click tracking data. | Read-only |
| dm_list_dedicated_ips | List purchased dedicated IP addresses. | Read-only |
| dm_list_dedicated_ip_pools | List dedicated IP pools. | Read-only |
| dm_get_ip_protection | Inspect the Direct Mail IP protection switch. | Read-only |
| dm_send_direct_email | Preview and send a direct or transactional inline-content email after confirmation. | Guarded send |
| dm_start_batch_send_task | Preview and start a BatchSendMail task after template, recipient-list, and test-send review. | Guarded send |
| dm_send_template_test_email | Preview one template rendering/delivery test; not a formal send path. | Guarded send |
Configuration
Set these variables in your MCP host configuration before calling real Direct Mail tools:
"env": {
"ALIBABA_CLOUD_ACCESS_KEY_ID": "your-access-key-id",
"ALIBABA_CLOUD_ACCESS_KEY_SECRET": "your-access-key-secret",
"ALIYUN_DM_REGION_ID": "cn-hangzhou"
}ALIYUN_DM_REGION_ID defaults to cn-hangzhou. For Direct Mail region IDs and service endpoints, see the official endpoint reference.
The server checks that required AccessKey variables are present during startup, but it does not verify whether those credentials are valid until a tool calls Alibaba Cloud. Do not commit real AccessKey values.
Contact Us
For questions, contact us through email or the DingTalk group.
- Email:
[email protected] - DingTalk group ID:
165445031039

