@wukongcrm/mcp-server 0.2.2 → 0.2.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/dist/server.js +12 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -147,7 +147,7 @@ npm pack
|
|
|
147
147
|
生成文件示例:
|
|
148
148
|
|
|
149
149
|
```text
|
|
150
|
-
wukongcrm-mcp-server-0.2.
|
|
150
|
+
wukongcrm-mcp-server-0.2.3.tgz
|
|
151
151
|
```
|
|
152
152
|
|
|
153
153
|
这个包只包含运行所需的 `dist`、`README.md` 和 `package.json`,不会携带源码、测试文件或用户 API Key。
|
|
@@ -155,7 +155,7 @@ wukongcrm-mcp-server-0.2.2.tgz
|
|
|
155
155
|
使用者拿到 `.tgz` 后安装:
|
|
156
156
|
|
|
157
157
|
```powershell
|
|
158
|
-
npm install -g .\wukongcrm-mcp-server-0.2.
|
|
158
|
+
npm install -g .\wukongcrm-mcp-server-0.2.3.tgz
|
|
159
159
|
```
|
|
160
160
|
|
|
161
161
|
安装后可以直接用命令启动:
|
package/dist/server.js
CHANGED
|
@@ -21,6 +21,16 @@ const searchFilterSchema = z.object({
|
|
|
21
21
|
values: z.array(z.unknown()).optional(),
|
|
22
22
|
groupId: z.number().optional()
|
|
23
23
|
}).passthrough();
|
|
24
|
+
const crmCreateRecordSchema = z.object({
|
|
25
|
+
module: moduleSchema,
|
|
26
|
+
entity: z.record(z.unknown()).optional().describe("CRM 实体字段;系统字段放在这里,例如 entity.customerName。"),
|
|
27
|
+
field: z.array(z.record(z.unknown())).optional().describe("CRM 自定义字段列表。"),
|
|
28
|
+
saveType: z.number().optional(),
|
|
29
|
+
fileId: idSchema.optional(),
|
|
30
|
+
aiAnalysis: z.number().optional(),
|
|
31
|
+
member: z.record(z.unknown()).optional(),
|
|
32
|
+
confirm: z.boolean().optional()
|
|
33
|
+
}).strict();
|
|
24
34
|
const crmUserSearchShape = {
|
|
25
35
|
ownerUserId: idSchema.optional(),
|
|
26
36
|
ownerUserIds: z.array(idSchema).optional(),
|
|
@@ -138,7 +148,7 @@ const toolDefinitions = [
|
|
|
138
148
|
["crm_list_oa_tasks", "查询 OA 任务列表;固定调用 /oaTask/queryTaskList。", z.object({ page: z.number().optional(), limit: z.number().optional(), type: z.number().optional(), status: z.number().optional(), priority: z.number().optional() }).passthrough()],
|
|
139
149
|
["crm_list_related_oa_tasks", "按关联业务查询 OA 任务;固定调用 /oaTask/queryTypeTaskList。", z.object({ type: z.union([z.string(), z.number()]), typeId: z.union([z.string(), z.number()]) }).passthrough()],
|
|
140
150
|
["crm_preview_write", "写入前预览和校验,不调用 72CRM 写接口。", passthroughSchema],
|
|
141
|
-
["crm_create_record", "
|
|
151
|
+
["crm_create_record", "新增线索、客户、联系人、产品、商机;系统字段放 entity,自定义字段放 field,不支持把 customerName 放在最外层;必须 confirm=true 才会写入。", crmCreateRecordSchema],
|
|
142
152
|
["crm_update_customer", "按客户 ID 或手机号/客户名唯一匹配后更新客户字段;会自动补全字段结构并写后校验,必须 confirm=true 才会写入。", z.object({ confirm: z.boolean().optional() }).passthrough()],
|
|
143
153
|
["crm_update_record_fields", "更新线索、客户、联系人、产品、商机基础字段;必须 confirm=true 才会写入。", z.object({ module: moduleSchema, id: z.union([z.string(), z.number()]), confirm: z.boolean().optional() }).passthrough()],
|
|
144
154
|
["crm_create_product", "新增 CRM 产品;固定调用 /crmProduct/add,可直接传 72CRM payload 或 entity/field,必须 confirm=true。", z.object({ confirm: z.boolean().optional() }).passthrough()],
|
|
@@ -182,7 +192,7 @@ export function createWukongMcpServer(config = {}) {
|
|
|
182
192
|
const { oauth, ...crmConfig } = config;
|
|
183
193
|
const server = new McpServer({
|
|
184
194
|
name: "wukong-mcp",
|
|
185
|
-
version: "0.2.
|
|
195
|
+
version: "0.2.3"
|
|
186
196
|
}, {
|
|
187
197
|
instructions: "先使用只读工具确认模块、记录和字段,再执行写入。所有写入必须显式传 confirm=true;不要尝试任意 URL 请求。"
|
|
188
198
|
});
|