@mambasms/mcp-server 0.7.2 → 0.7.3
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/README.md +2 -2
- package/index.js +23 -4
- package/package.json +1 -1
- package/skill/mambasms-mcp/SKILL.md +2 -1
- package/skill/mambasms-mcp/examples/audiences.json +16 -0
- package/skill/mambasms-mcp/modules/audiences.md +2 -1
- package/skill/mambasms-mcp/modules/campaigns.md +14 -0
- package/skill/mambasms-mcp/references/tool-catalog.md +2 -1
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ MambaSMS 营销自动化 MCP server(stdio)。让任意支持 MCP 的 AI 工具(C
|
|
|
22
22
|
通用发现/调度(0.6.0,参考 Omnisend MCP):
|
|
23
23
|
| `mamba_guide` / `mamba_search` / `mamba_tool_schema` / `mamba_execute` | 能力总览(按主题) / 搜索操作 / 查参数 / 按名执行 |
|
|
24
24
|
|
|
25
|
-
环境变量 `MAMBA_READONLY=1` 时只注册只读工具(
|
|
25
|
+
环境变量 `MAMBA_READONLY=1` 时只注册只读工具(66→50),写操作一律拒绝。
|
|
26
26
|
|
|
27
27
|
## 技能包(Skill)
|
|
28
28
|
|
|
@@ -37,7 +37,7 @@ MambaSMS 营销自动化 MCP server(stdio)。让任意支持 MCP 的 AI 工具(C
|
|
|
37
37
|
| `modules/templates.md` | 模板三条创建路径、内容要点、改删、预览/测试/迁移 |
|
|
38
38
|
| `modules/campaigns.md` | 活动三种设计方式落到参数、邮件/短信/A-B、改稿、质检 |
|
|
39
39
|
| `modules/flows.md` | 15 个触发器、延迟/退出/频次、多节点、不发排查 |
|
|
40
|
-
| `modules/audiences.md` |
|
|
40
|
+
| `modules/audiences.md` | 建组三步、二维条件、人数与成员核对、联系人精确查+受控模糊搜索、标签清单 |
|
|
41
41
|
| `modules/forms.md` | **表单报告**:清单+转化率、单表单趋势、字段级流失、提交线索(脱敏) |
|
|
42
42
|
| `modules/reports.md` | 报表工具与口径(180天/取消单/币种)、分页限流、输出格式;含商品/订单/折扣/扣费查询 |
|
|
43
43
|
| `modules/assets-and-social.md` | 图片 url/file_path、403/429 处理、**页脚社媒图标口径** |
|
package/index.js
CHANGED
|
@@ -123,15 +123,15 @@ 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.3" },
|
|
127
127
|
{
|
|
128
|
-
instructions: `MambaSMS 营销自动化(店铺级,鉴权用 MAMBA_ACCESS_TOKEN 店铺密钥)。共
|
|
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/精细控制。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
132
|
【先确认再动手】第一次给客户做邮件(模板或活动)时,先问一次要哪种形式(除非客户已说清):A. 用平台模板(推荐,页脚自带社媒图标与退订、风格统一);B. 从零生成组件(内容由你生成,客户之后可在后台拖拽微调);C. 源码模式HTML(由你直接产出整份 HTML 源码,后台可继续改源码;客户贴现成 HTML 时也走这个)。注意:内容是**你(AI)产出**,不要向客户索要 HTML;只需让客户选形式。客户说"随便/你决定"→选 A。社媒默认用平台页脚图标(推荐),客户有指定账号/图标再按其要求。【社媒与页脚】社媒入口**不要自己发明**:优先套系统模板(template_list_system→template_get_system→传 templateId),模板自带页脚社媒图标+退订;手写 HTML 或骨架时,社媒必须用 template_snippets(type=footer-social) 的片段(平台图标直链),放在**最底部(退订上方)**;禁止用文字按钮充当社媒入口,也不要在正文中部放社媒区。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}、买家可见文案英文。
|
|
136
136
|
【通用(4)】mamba_guide 总览、mamba_search 搜索、mamba_tool_schema 查参数、mamba_execute 按名执行。MAMBA_READONLY=1 时只注册只读工具(52→35)。
|
|
137
137
|
明确不做:发送/启用/中断发送、删除活动、联系人模糊全表搜、拖拽式精修(留给后台)。
|
|
@@ -809,6 +809,20 @@ defineTool(
|
|
|
809
809
|
}
|
|
810
810
|
);
|
|
811
811
|
|
|
812
|
+
defineTool(
|
|
813
|
+
"contact_search",
|
|
814
|
+
"联系人模糊搜索(限本店):关键词≥2字符,匹配邮箱/手机/姓名/昵称/origin_id。每页最多50,按最近添加倒序;" +
|
|
815
|
+
"结果量大时改用条件分组。",
|
|
816
|
+
{
|
|
817
|
+
keyword: z.string().min(2).describe("关键词(≥2字符):邮箱片段/手机片段/姓名/昵称/originId"),
|
|
818
|
+
...PAGE_PARAMS,
|
|
819
|
+
},
|
|
820
|
+
async ({ keyword, page, page_size }) => {
|
|
821
|
+
const data = await callApi("/api/v1/insight/contact/search", { keyword, page, pageSize: page_size });
|
|
822
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
823
|
+
}
|
|
824
|
+
);
|
|
825
|
+
|
|
812
826
|
defineTool(
|
|
813
827
|
"audience_growth",
|
|
814
828
|
"受众增长趋势(按天):新增联系人/邮件订阅/短信订阅。默认30天(上限90)。",
|
|
@@ -1125,6 +1139,10 @@ defineTool(
|
|
|
1125
1139
|
tag_id: z.string().optional().describe("分组id(communication_select=tag 时用)"),
|
|
1126
1140
|
non_send_tag_id: z.string().optional().describe("排除的分组id"),
|
|
1127
1141
|
text_overrides: z.array(z.object({ node_id: z.string(), text: z.string() })).optional().describe("按节点改文案(套模板时)"),
|
|
1142
|
+
component_overrides: z
|
|
1143
|
+
.array(z.object({ node_id: z.string().min(1), settings: z.record(z.any()) }))
|
|
1144
|
+
.optional()
|
|
1145
|
+
.describe("按节点改任意字段(颜色/字号/间距/图片/链接等,等同后台属性面板)= 程序化像素级精修;nodeId 用 template_get_system 的 textNodes 或后台编辑器里的节点"),
|
|
1128
1146
|
components: z.array(z.record(z.any())).max(4).optional().describe("额外组件(倒计时等,规范查 catalog_query(topic=components))"),
|
|
1129
1147
|
blocks: z.array(z.record(z.any())).max(4).optional().describe("预置区块(block_library_query 拿 blockId)"),
|
|
1130
1148
|
discount_type: z.enum(["percentage", "fixed"]).optional().describe("折扣类型"),
|
|
@@ -1172,6 +1190,7 @@ defineTool(
|
|
|
1172
1190
|
textOverrides: a.text_overrides?.map((x) => ({ nodeId: x.node_id, text: x.text })),
|
|
1173
1191
|
components: a.components,
|
|
1174
1192
|
blocks: a.blocks,
|
|
1193
|
+
componentOverrides: a.component_overrides?.map((x) => ({ nodeId: x.node_id, settings: x.settings })),
|
|
1175
1194
|
discountType: a.discount_type,
|
|
1176
1195
|
discountValue: a.discount_value,
|
|
1177
1196
|
discountCode: a.discount_code,
|
|
@@ -1465,7 +1484,7 @@ const MCP_GUIDE = {
|
|
|
1465
1484
|
"- 联系人:contact_get(精确查,含订单聚合)/ contact_send_status",
|
|
1466
1485
|
"- 报表:audience_growth / form_performance / domain_health / store_overview / order_stats / account_balance",
|
|
1467
1486
|
"- 质检:email_audit(13 条规则+评分,deep=true 追加模型审查)/ brand_profile(品牌语气档案)",
|
|
1468
|
-
"口径:报表默认近 180 天(可传 start_date/end_date 覆盖);订单已排除 CANCELLED;余额单位美元且为 group
|
|
1487
|
+
"口径:报表默认近 180 天(可传 start_date/end_date 覆盖);订单已排除 CANCELLED;余额单位美元且为 group 级;联系人支持精确查(contact_get)与模糊搜索(contact_search:关键词≥2字符、每页≤50、结果多时改用分组)。",
|
|
1469
1488
|
].join("\n"),
|
|
1470
1489
|
drafts: [
|
|
1471
1490
|
"【写=只建草稿 8 个】campaign_create_email / _sms / _abtest / _smsabtest、campaign_update_content、flow_create、flow_update_content、user_group_create。",
|
package/package.json
CHANGED
|
@@ -69,7 +69,8 @@ description: 曼巴 MambaSMS 营销自动化 MCP(@mambasms/mcp-server)使用技
|
|
|
69
69
|
## 5. 能力边界(别承诺)
|
|
70
70
|
|
|
71
71
|
- 不发送、不启用、不中断发送、不删除活动 → 引导客户在后台操作
|
|
72
|
-
-
|
|
72
|
+
- 联系人:精确查 `contact_get` + **受控模糊搜索** `contact_search`(≥2字符/每页≤50);不做全表导出、批量导入导出
|
|
73
|
+
- 排版:**拖拽手势做不到**(前端交互),但可用 `component_overrides`/`text_overrides`/`blocks` 做**节点级精修**(改色/间距/图片/链接、插区块)
|
|
73
74
|
- 产品推荐器(猜你喜欢)区块不由 MCP 创建
|
|
74
75
|
- 预览链接是免登永久链接,含未公开信息的草稿别外发
|
|
75
76
|
|
|
@@ -43,5 +43,21 @@
|
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
45
|
"note": "分组条件里取 tag id"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "联系人模糊搜索",
|
|
49
|
+
"tool": "contact_search",
|
|
50
|
+
"args": {
|
|
51
|
+
"keyword": "@qq.com",
|
|
52
|
+
"page": 1,
|
|
53
|
+
"page_size": 2
|
|
54
|
+
},
|
|
55
|
+
"expect": {
|
|
56
|
+
"keys": [
|
|
57
|
+
"list",
|
|
58
|
+
"totalRow"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
"note": "关键词≥2字符、每页≤50"
|
|
46
62
|
}
|
|
47
63
|
]
|
|
@@ -60,9 +60,10 @@ query_content = [
|
|
|
60
60
|
| `group_members(group_id, page, page_size)` | 自动区分手动分组(`mb_tag_audience`)/ 条件分组(动态表);返回邮箱、手机、姓名、国家、订阅状态 |
|
|
61
61
|
| `group_list(page, page_size, keyword)` | 分组列表(排除平台自动分组) |
|
|
62
62
|
| `contact_get(email/phone/origin_id)` | **精确查单人**,含订阅状态与订单聚合(已排除取消单) |
|
|
63
|
+
| `contact_search(keyword, page, page_size)` | **模糊搜索**(≥2 字符,匹配邮箱/手机/姓名/昵称/originId;每页≤50);结果多时改用分组 |
|
|
63
64
|
| `contact_send_status(keyword)` | 该人收到过的邮件/短信 + 送达/打开/点击/退订 |
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
**边界**:`contact_search` 是**受控模糊搜索**(限本店、关键词≥2字符、每页≤50、按最近添加排序),不是全表导出;要圈大批人仍应建分组。批量导入导出不做。
|
|
66
67
|
|
|
67
68
|
## 6. 自检清单
|
|
68
69
|
|
|
@@ -55,6 +55,20 @@
|
|
|
55
55
|
- `ab_test_ratio`(每个变体占测试区比例)、`calculation_type`(`clickRate` / `openRate`)、`number`+`date_type` 控制时长
|
|
56
56
|
- 不需要传 `template_id`:没匹配到模板会自动兜底(通用模板 → 骨架)
|
|
57
57
|
|
|
58
|
+
## 4.5 节点级精修(不用鼠标的"像素级")
|
|
59
|
+
|
|
60
|
+
后台拖拽/属性面板能做的事,大部分可以用**节点覆盖**在调用里完成(不是拖拽手势,但效果等价):
|
|
61
|
+
|
|
62
|
+
| 想改 | 参数 | 说明 |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| 某个区块的文案 | `text_overrides: [{node_id, text}]` | 按节点 id 替换文本 |
|
|
65
|
+
| 颜色/字号/间距/图片/链接 | `component_overrides: [{node_id, settings:{字段:值}}]` | 直接覆盖节点 settings,等同属性面板;`campaign_create_email` 与 `template_create_from_design` 都支持 |
|
|
66
|
+
| 增/删整块 | `components` / `blocks` | 插入倒计时、导航、赠品、预置区块 |
|
|
67
|
+
|
|
68
|
+
- `node_id` 从哪来:`template_get_system` 返回的文案节点,或后台编辑器里节点属性
|
|
69
|
+
- `layout_skeleton` 与 overrides **互斥**(骨架是新树,没有模板节点可指定)
|
|
70
|
+
- **纯拖拽手势/自由画布**做不到(那是前端交互);需要它请在后台编辑器里改
|
|
71
|
+
|
|
58
72
|
## 5. 修改内容(只有草稿能改)
|
|
59
73
|
|
|
60
74
|
`campaign_update_content(campaigns_id, subject_line/preheader/email_design/html/message_text/variant)`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# 工具参数清单(
|
|
1
|
+
# 工具参数清单(66 个,以 `mamba_tool_schema` 为准)
|
|
2
2
|
|
|
3
3
|
> 返回入口:[`../SKILL.md`](../SKILL.md) | 按任务:`../modules/templates.md`(模板)、`../modules/campaigns.md`(活动)、`../modules/flows.md`(流程)、`../modules/audiences.md`(人群)、`../modules/reports.md`(报表)、`../modules/assets-and-social.md`(图片/社媒)
|
|
4
4
|
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
| `group_catalog` | — | `nested_path`(**单个**,多个域分多次查) |
|
|
45
45
|
| `group_members` | `group_id` | `page` `page_size` |
|
|
46
46
|
| `contact_get` | — | `email` / `phone` / `origin_id`(三选一,精确匹配) |
|
|
47
|
+
| `contact_search` | `keyword`(≥2字符) | `page` `page_size`(≤50) |
|
|
47
48
|
| `contact_send_status` | `keyword`(邮箱或手机号) | `campaigns_id` `flow_id` |
|
|
48
49
|
| `email_audit` | — | `source`(`campaigns`/`flow`) `campaigns_id` `flow_id` `node_uuid` `deep` |
|
|
49
50
|
| `brand_profile` | — | — |
|