@mambasms/mcp-server 0.7.12 → 0.7.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -123,13 +123,13 @@ function defineTool(name, description, shape, handler) {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
const server = new McpServer(
|
|
126
|
-
{ name: "mambasms-mcp-server", version: "0.7.
|
|
126
|
+
{ name: "mambasms-mcp-server", version: "0.7.14" },
|
|
127
127
|
{
|
|
128
128
|
instructions: `MambaSMS 营销自动化(店铺级,鉴权用 MAMBA_ACCESS_TOKEN 店铺密钥)。共 66 个工具,分四组。
|
|
129
129
|
不确定用什么/想先看总览 → mamba_guide;只知道关键词 → mamba_search;要参数细节 → mamba_tool_schema。
|
|
130
130
|
|
|
131
131
|
【模板(17)】四条创建路径:A) template_create_from_design —— 首选,传结构化 emailDesign(style/theme/hero/intro/products/offer/cta/social),写前先 catalog_query(topic=emailDesign);要骨架传 catalog_query(topic=layouts);套已有模板传 templateId。B) template_create(html) —— 组件模板里嵌 HTML 区块/迁移现成 HTML(**模板只有组件形态**;客户要富文本(含整份HTML,默认)→建活动草稿 campaign_create_email(html=...))。C) template_create(sections) —— 动态区块(购物车/浏览列表),发送时填该联系人的数据。D) template_import —— mambatpl 或 zipHtml。参考面:template_list_system/template_get_system、block_library_query、catalog_query、template_snippets(页头页脚片段,社交图标走 link.mambasms.com/dynamicImage/{platform}/{size}/{shape}/{color},key 大小写敏感)。效果:template_preview(免登永久链接)、template_send_test。图片用 upload_image 转存 CDN。退订必须 {Unsubscribe}。
|
|
132
|
-
【先确认再动手】第一次给客户做邮件(模板或活动)时,先问一次要哪种形式(除非客户已说清),**只两种**:A. 富文本(默认,含 HTML 源码——简单排版或整份 HTML 都可;产物是**活动草稿** edition=richtext,后台富文本/HTML 编辑器能改);B. 组件(平台模板或从零生成组件,后台可拖拽微调,能存成模板、能给自动化流程用)。客户没说清或说"随便/你决定"→默认 A 富文本。注意:内容是**你(AI)产出**,不要向客户索要 HTML;只需让客户选形式。【社媒与页脚】社媒入口**不要自己发明**:优先套系统模板(template_list_system→template_get_system→传 templateId),模板自带页脚社媒图标+退订;手写 HTML 或骨架时,社媒必须用 template_snippets(type=footer-social)
|
|
132
|
+
【先确认再动手】第一次给客户做邮件(模板或活动)时,先问一次要哪种形式(除非客户已说清),**只两种**:A. 富文本(默认,含 HTML 源码——简单排版或整份 HTML 都可;产物是**活动草稿** edition=richtext,后台富文本/HTML 编辑器能改);B. 组件(平台模板或从零生成组件,后台可拖拽微调,能存成模板、能给自动化流程用)。客户没说清或说"随便/你决定"→默认 A 富文本。注意:内容是**你(AI)产出**,不要向客户索要 HTML;只需让客户选形式。【社媒与页脚】社媒入口**不要自己发明**:优先套系统模板(template_list_system→template_get_system→传 templateId),模板自带页脚社媒图标+退订;手写 HTML 或骨架时,社媒必须用 template_snippets(type=footer-social) 的片段(平台图标直链),放在**最底部(退订上方)**;**常用平台要默认给齐 10 个**(instagram/facebook/tiktok/youTube/twitter/pinterest/linkedIn/snapchat/whatsapp/reddit,图标服务全部支持),客户只给了部分账号时按他给的来、href 用真实主页,没给链接就先指向 {SiteUrl} 并在交付说明里提示可替换;禁止用文字按钮充当社媒入口,也不要在正文中部放社媒区。emailDesign 的 social 字段可省略(页脚社媒由模板/骨架生成)。
|
|
133
133
|
【分页有边界】列表类接口一律带 page/page_size:默认 page_size=20,建议≤50,上限100(模板列表≤500但建议50);禁止"循环翻页拉全量"(通常只取第一页/前50条够用),先用 keyword/status/时间窗/条件收窄再取;看汇总用报表接口(order_stats/campaign_report/flow_report),不要拉明细自己算;分组成员抽样看 20~50 人即可,不要枚举全组。
|
|
134
134
|
【只读/质检(37)】活动 campaign_*、流程 flow_*、分组 group_*/tag_list、联系人 contact_get/contact_search/contact_send_status、报表 audience_growth/form_performance/domain_health/store_overview/order_stats/account_balance、表单 form_list/form_report/form_fields/form_submissions、商品 product_list/product_get、订单 order_detail、模板引用 template_usage、折扣 discount_list、扣费 balance_log、用户统计 audience_stats、报告卡片 report_cards、质检 email_audit、品牌 brand_profile。列表统一 page/page_size(≤100,默认 20);报表默认近 180 天,可传 start_date/end_date 覆盖;订单已排除 CANCELLED;余额单位为美元且是 group 级(同集团多店共享);联系人支持精确查(contact_get)与模糊搜索(contact_search:关键词≥2字符、每页≤50、结果多时改用分组)。
|
|
135
135
|
【写=只建草稿(8)】campaign_create_email/sms/abtest/smsabtest、campaign_update_content、flow_create、flow_update_content、user_group_create。一律 draft:不发送、不启用、不扣费;update 仅 draft 可改(否则 412);建分组前必须先 group_catalog 取真源(否则拒绝);活动指定人群用 communication_select=tag + tag_id。正文质量闸门:活动渲染后 ≥4200 字符、流程邮件节点 ≥3000 字符、须含 {Unsubscribe}、买家可见文案英文。
|
|
@@ -1133,7 +1133,7 @@ const DRAFT_NOTE = "⚠️本工具只创建/修改草稿,不会发送、不会
|
|
|
1133
1133
|
defineTool(
|
|
1134
1134
|
"campaign_create_email",
|
|
1135
1135
|
`创建邮件营销活动草稿。${DRAFT_NOTE}
|
|
1136
|
-
|
|
1136
|
+
正文两种写法:**富文本/HTML=html**(默认形式;简单排版或整份 HTML 源码都放这里,editor 参数可选后台默认打开富文本还是 HTML 源码编辑器)或 **组件=email_design**(结构化JSON;先 catalog_query(topic=emailDesign) 查规范,或 template_list_system 选模板后传 template_id)。二者必传其一、互斥。客户没说清→用 html(富文本)。`,
|
|
1137
1137
|
{
|
|
1138
1138
|
title: z.string().min(1).describe("活动名称"),
|
|
1139
1139
|
email_design: z
|
|
@@ -1152,6 +1152,10 @@ defineTool(
|
|
|
1152
1152
|
.enum(["promo-hero", "promo-flash", "single-spotlight", "new-arrival", "newsletter", "win-back"])
|
|
1153
1153
|
.optional()
|
|
1154
1154
|
.describe("版式骨架(不套系统模板时用;与 template_id 二选一)"),
|
|
1155
|
+
editor: z
|
|
1156
|
+
.enum(["richtext", "html"])
|
|
1157
|
+
.optional()
|
|
1158
|
+
.describe("后台默认编辑器(仅 html 正文用):richtext=富文本(默认),html=HTML 源码编辑器。客户明确要「自己改 HTML 源码」时传 html"),
|
|
1155
1159
|
subject_line: z.string().optional().describe("邮件主题(不传则按内容推导)"),
|
|
1156
1160
|
preheader: z.string().optional().describe("预览文本"),
|
|
1157
1161
|
send_name: z.string().optional().describe("发件人名称(不传用店铺名)"),
|
|
@@ -1193,6 +1197,7 @@ defineTool(
|
|
|
1193
1197
|
communicationSelect: a.communication_select,
|
|
1194
1198
|
tagId: a.tag_id,
|
|
1195
1199
|
nonSendTagId: a.non_send_tag_id,
|
|
1200
|
+
editor: a.editor,
|
|
1196
1201
|
})) if (v !== undefined) body[k] = v;
|
|
1197
1202
|
const data = await callApi("/api/v1/campaign/draft/create-html", body);
|
|
1198
1203
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
**① 邮件怎么做**(第一次做邮件时)
|
|
27
27
|
> 这封邮件想怎么做?
|
|
28
|
-
> **A. 富文本(默认)**:我直接写出成品——简单排版或整份 HTML 源码都可以(你有现成 HTML 也可以发我)。交付是**活动草稿**,后台富文本/HTML
|
|
28
|
+
> **A. 富文本(默认)**:我直接写出成品——简单排版或整份 HTML 源码都可以(你有现成 HTML 也可以发我)。交付是**活动草稿**,后台富文本/HTML 编辑器都能改(想在后台直接改源码就说一声,我按 HTML 编辑器建)
|
|
29
29
|
> **B. 组件**:用平台模板或从零生成组件,之后可在后台拖拽微调;这种能存成**模板**,也能给自动化流程用
|
|
30
30
|
|
|
31
31
|
**② 发给谁**
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
|
|
55
55
|
| 方式 | 一句话 |
|
|
56
56
|
|---|---|
|
|
57
|
-
| 富文本(默认) | 直接出成品,源码/简单排版都行;产物是**活动草稿**,后台富文本/HTML
|
|
57
|
+
| 富文本(默认) | 直接出成品,源码/简单排版都行;产物是**活动草稿**,后台富文本/HTML 编辑器改(要自己改源码 → `editor="html"`) |
|
|
58
58
|
| 组件 | 平台模板或从零生成,后台拖拽微调;能存成**模板**、能给自动化流程复用 |
|
|
59
59
|
|
|
60
60
|
---
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
| 做法 | 结果 |
|
|
33
33
|
|---|---|
|
|
34
34
|
| ✅ 套系统模板(`template_id`) | 模板自带页脚社媒图标(平台动态图服务),风格统一 |
|
|
35
|
-
| ✅ 手写 HTML 时用 `template_snippets(type="footer-social")` |
|
|
35
|
+
| ✅ 手写 HTML 时用 `template_snippets(type="footer-social")` | 拿到 10 个常用图标片段,放**最底部、退订上方** |
|
|
36
36
|
| ❌ 自己写「INSTAGRAM / FACEBOOK…」文字按钮 | 客户会认为“没用我们的模板”;位置、样式都不对 |
|
|
37
37
|
| ❌ 把社媒放在正文中部 | 与平台模板不一致,转化也差 |
|
|
38
38
|
|
|
@@ -41,7 +41,9 @@
|
|
|
41
41
|
https://link.mambasms.com/dynamicImage/{platform}/{size}/{shape}/{color}
|
|
42
42
|
# 例:/instagram/36/100/default
|
|
43
43
|
```
|
|
44
|
-
|
|
44
|
+
**默认给齐常用 10 个**(不要只放 3~4 个):`instagram` `facebook` `tiktok` `youTube` `twitter`(X) `pinterest` `linkedIn` `snapchat` `whatsapp` `reddit`。
|
|
45
|
+
图标服务还支持(按品牌需要再加):`discord` `spotify` `medium` `vimeo` `soundCloud` `line` `vk` `website` `email`。
|
|
46
|
+
链接口径:客户给了账号就用真实主页;没给就先指向 `{SiteUrl}`(店铺首页),并在交付时提示"社媒链接可替换成真实主页"。
|
|
45
47
|
|
|
46
48
|
## 3. 页头页脚片段(`template_snippets`)
|
|
47
49
|
|
|
@@ -62,7 +64,7 @@ https://link.mambasms.com/dynamicImage/{platform}/{size}/{shape}/{color}
|
|
|
62
64
|
## 5. 自检清单
|
|
63
65
|
|
|
64
66
|
- [ ] 图片返回的是 `cdn-res.mambasms.com` 地址(不是原始外链)
|
|
65
|
-
- [ ]
|
|
67
|
+
- [ ] 社媒是图标、在最底部;**常用平台给齐 10 个**(客户只给部分账号时按他给的来)
|
|
66
68
|
- [ ] 页脚有 `{Unsubscribe}`
|
|
67
69
|
- [ ] 图片有 alt,且不超过 5MB
|
|
68
70
|
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
| HTML | `html`(整份源码) | `edition=richtext` | 完全控制,后台 HTML 编辑器可改 |
|
|
17
17
|
|
|
18
18
|
> 富文本与 HTML 存储同形,只是编辑器不同。选哪种**先问客户**(见 [`ask-first.md`](ask-first.md))。
|
|
19
|
+
> 客户说"我要自己改 HTML 源码/给我 HTML 编辑器" → `campaign_create_email(html=…, editor="html")`,草稿打开就是 HTML 源码编辑器;
|
|
20
|
+
> 不传 `editor` = 富文本编辑器(默认)。已建好的草稿客户也能在后台第 1 步自己切富文本⇄HTML(内容不丢)。
|
|
19
21
|
>
|
|
20
22
|
> ⚠️ **邮件只有两种形式:富文本(默认,含 HTML)与组件**。客户要富文本/整封 HTML → `campaign_create_email(html=...)` **建活动草稿**(`edition=richtext`);
|
|
21
23
|
> `template_create` 属于**组件**(模板里嵌一个 HTML 区块),不要拿它交付富文本式邮件。客户没说清 → 默认富文本。
|
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
<table width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background-color:#1a1a1a;">
|
|
2
|
-
<tbody>
|
|
3
|
-
<tr>
|
|
4
|
-
<td align="center" style="padding:28px 24px;">
|
|
5
|
-
<table width="600" border="0" cellpadding="0" cellspacing="0" role="presentation">
|
|
6
|
-
<tbody>
|
|
7
|
-
<tr>
|
|
8
|
-
<td align="center" style="padding-bottom:16px;">
|
|
9
|
-
<a href="https://instagram.com/yourbrand" target="_blank" style="text-decoration:none;"><img src="https://link.mambasms.com/dynamicImage/instagram/
|
|
10
|
-
<a href="https://facebook.com/yourbrand" target="_blank" style="text-decoration:none;"><img src="https://link.mambasms.com/dynamicImage/facebook/
|
|
11
|
-
<a href="https://
|
|
12
|
-
<a href="https://
|
|
13
|
-
<a href="https://
|
|
14
|
-
<a href="https://
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</table>
|
|
1
|
+
<table width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background-color:#1a1a1a;">
|
|
2
|
+
<tbody>
|
|
3
|
+
<tr>
|
|
4
|
+
<td align="center" style="padding:28px 24px;">
|
|
5
|
+
<table width="600" border="0" cellpadding="0" cellspacing="0" role="presentation">
|
|
6
|
+
<tbody>
|
|
7
|
+
<tr>
|
|
8
|
+
<td align="center" style="padding-bottom:16px;">
|
|
9
|
+
<a href="https://instagram.com/yourbrand" target="_blank" style="text-decoration:none;"><img src="https://link.mambasms.com/dynamicImage/instagram/26/100/default" width="26" height="26" alt="instagram" style="display:inline-block;margin:0 6px;border:0;"></a>
|
|
10
|
+
<a href="https://facebook.com/yourbrand" target="_blank" style="text-decoration:none;"><img src="https://link.mambasms.com/dynamicImage/facebook/26/100/default" width="26" height="26" alt="facebook" style="display:inline-block;margin:0 6px;border:0;"></a>
|
|
11
|
+
<a href="https://tiktok.com/@yourbrand" target="_blank" style="text-decoration:none;"><img src="https://link.mambasms.com/dynamicImage/tiktok/26/100/default" width="26" height="26" alt="tiktok" style="display:inline-block;margin:0 6px;border:0;"></a>
|
|
12
|
+
<a href="https://youtube.com/@yourbrand" target="_blank" style="text-decoration:none;"><img src="https://link.mambasms.com/dynamicImage/youTube/26/100/default" width="26" height="26" alt="youtube" style="display:inline-block;margin:0 6px;border:0;"></a>
|
|
13
|
+
<a href="https://x.com/yourbrand" target="_blank" style="text-decoration:none;"><img src="https://link.mambasms.com/dynamicImage/twitter/26/100/default" width="26" height="26" alt="x" style="display:inline-block;margin:0 6px;border:0;"></a>
|
|
14
|
+
<a href="https://pinterest.com/yourbrand" target="_blank" style="text-decoration:none;"><img src="https://link.mambasms.com/dynamicImage/pinterest/26/100/default" width="26" height="26" alt="pinterest" style="display:inline-block;margin:0 6px;border:0;"></a>
|
|
15
|
+
<a href="https://linkedin.com/company/yourbrand" target="_blank" style="text-decoration:none;"><img src="https://link.mambasms.com/dynamicImage/linkedIn/26/100/default" width="26" height="26" alt="linkedin" style="display:inline-block;margin:0 6px;border:0;"></a>
|
|
16
|
+
<a href="https://snapchat.com/add/yourbrand" target="_blank" style="text-decoration:none;"><img src="https://link.mambasms.com/dynamicImage/snapchat/26/100/default" width="26" height="26" alt="snapchat" style="display:inline-block;margin:0 6px;border:0;"></a>
|
|
17
|
+
<a href="https://wa.me/10000000000" target="_blank" style="text-decoration:none;"><img src="https://link.mambasms.com/dynamicImage/whatsapp/26/100/default" width="26" height="26" alt="whatsapp" style="display:inline-block;margin:0 6px;border:0;"></a>
|
|
18
|
+
<a href="https://reddit.com/r/yourbrand" target="_blank" style="text-decoration:none;"><img src="https://link.mambasms.com/dynamicImage/reddit/26/100/default" width="26" height="26" alt="reddit" style="display:inline-block;margin:0 6px;border:0;"></a>
|
|
19
|
+
</td>
|
|
20
|
+
</tr>
|
|
21
|
+
<tr>
|
|
22
|
+
<td align="center" style="padding-bottom:12px;">
|
|
23
|
+
<p style="margin:0;font-family:Arial,sans-serif;font-size:12px;line-height:1.7;color:#9a9a9a;">Copyright © {SiteName} | {SiteAddress}, {SiteCity}, {SiteCountry}</p>
|
|
24
|
+
<p style="margin:0;font-family:Arial,sans-serif;font-size:12px;line-height:1.7;color:#9a9a9a;">This email was sent to {ContactEmail} because you've subscribed on our site or made a purchase.</p>
|
|
25
|
+
<p style="margin:0;font-family:Arial,sans-serif;font-size:12px;line-height:1.7;color:#9a9a9a;"><a href="{Unsubscribe}" style="color:#9a9a9a;text-decoration:underline;">Unsubscribe</a></p>
|
|
26
|
+
</td>
|
|
27
|
+
</tr>
|
|
28
|
+
</tbody>
|
|
29
|
+
</table>
|
|
30
|
+
</td>
|
|
31
|
+
</tr>
|
|
32
|
+
</tbody>
|
|
33
|
+
</table>
|