qingflow-mcp 0.3.17 → 0.3.19
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 +107 -3
- package/dist/qingflow-client.js +78 -0
- package/dist/server.js +1350 -46
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
This MCP server wraps Qingflow OpenAPI for:
|
|
4
4
|
|
|
5
5
|
- `qf_apps_list`
|
|
6
|
+
- `qf_apps_info_list`
|
|
7
|
+
- `qf_app_info_get`
|
|
8
|
+
- `qf_app_packages_list`
|
|
9
|
+
- `qf_departments_list`
|
|
10
|
+
- `qf_department_users_list`
|
|
11
|
+
- `qf_users_list`
|
|
12
|
+
- `qf_user_get`
|
|
6
13
|
- `qf_form_get`
|
|
7
14
|
- `qf_field_resolve`
|
|
8
15
|
- `qf_query_plan`
|
|
@@ -13,6 +20,8 @@ This MCP server wraps Qingflow OpenAPI for:
|
|
|
13
20
|
- `qf_export_json`
|
|
14
21
|
- `qf_query` (unified read entry: list / record / summary)
|
|
15
22
|
- `qf_records_aggregate` (deterministic grouped metrics)
|
|
23
|
+
- `qf_apply_audit_records_list`
|
|
24
|
+
- `qf_apply_audit_record_get`
|
|
16
25
|
- `qf_record_create`
|
|
17
26
|
- `qf_record_update`
|
|
18
27
|
- `qf_operation_get`
|
|
@@ -108,7 +117,7 @@ npm i -g git+https://github.com/853046310/qingflow-mcp.git
|
|
|
108
117
|
Install from npm (pinned version):
|
|
109
118
|
|
|
110
119
|
```bash
|
|
111
|
-
npm i -g qingflow-mcp@0.3.
|
|
120
|
+
npm i -g qingflow-mcp@0.3.19
|
|
112
121
|
```
|
|
113
122
|
|
|
114
123
|
Or one-click installer:
|
|
@@ -148,6 +157,25 @@ MCP client config example:
|
|
|
148
157
|
3. `qf_record_create` or `qf_record_update`.
|
|
149
158
|
4. If create/update returns only `request_id`, call `qf_operation_get` to resolve async result.
|
|
150
159
|
|
|
160
|
+
Directory / org flow:
|
|
161
|
+
|
|
162
|
+
1. `qf_departments_list` to inspect department tree.
|
|
163
|
+
2. `qf_department_users_list` to inspect one department's members.
|
|
164
|
+
3. `qf_users_list` for workspace-wide pagination.
|
|
165
|
+
4. `qf_user_get` for one exact user.
|
|
166
|
+
|
|
167
|
+
Admin app flow:
|
|
168
|
+
|
|
169
|
+
1. `qf_apps_list` for lightweight visible app listing.
|
|
170
|
+
2. `qf_apps_info_list` for admin-level app detail listing.
|
|
171
|
+
3. `qf_app_info_get` for one exact app.
|
|
172
|
+
4. `qf_app_packages_list` for user-visible app packages.
|
|
173
|
+
|
|
174
|
+
Audit flow:
|
|
175
|
+
|
|
176
|
+
1. `qf_apply_audit_records_list` to inspect one record's workflow history.
|
|
177
|
+
2. `qf_apply_audit_record_get` to inspect one audit record's field modifications.
|
|
178
|
+
|
|
151
179
|
Full calling contract (Chinese):
|
|
152
180
|
|
|
153
181
|
- [MCP 调用规范](./docs/MCP_CALLING_SPEC.md)
|
|
@@ -165,14 +193,90 @@ Full calling contract (Chinese):
|
|
|
165
193
|
4. In `list` mode, `select_columns` is required.
|
|
166
194
|
5. In `list` mode, row cap defaults to 200 when `max_rows` and `max_items` are omitted.
|
|
167
195
|
6. In `record` mode, `select_columns` is required.
|
|
168
|
-
7. In `summary` mode, `select_columns` is
|
|
196
|
+
7. In `summary` mode, `select_columns` is optional and can be auto-derived from `amount_column` / `time_range` (`max_rows` defaults to 200 when omitted).
|
|
169
197
|
|
|
170
198
|
Summary mode output:
|
|
171
199
|
|
|
172
200
|
1. `summary`: aggregated stats (`total_count`, `total_amount`, `by_day`, `missing_count`).
|
|
173
|
-
2. `rows`: strict column rows (
|
|
201
|
+
2. `rows`: strict column rows (requested `select_columns`, or auto-derived preview columns when omitted).
|
|
174
202
|
3. `meta`: field mapping, filter scope, stat policy, execution limits (`output_profile=verbose` only).
|
|
175
203
|
|
|
204
|
+
## Directory / Org Tools
|
|
205
|
+
|
|
206
|
+
These tools expose department and member APIs without routing through `qf_query`:
|
|
207
|
+
|
|
208
|
+
1. `qf_departments_list`
|
|
209
|
+
- optional `dept_id`
|
|
210
|
+
- local `keyword`, `limit`, `offset`
|
|
211
|
+
- aliases: `deptId`, `department_id`, `departmentId`
|
|
212
|
+
2. `qf_department_users_list`
|
|
213
|
+
- required `dept_id`, `fetch_child`
|
|
214
|
+
- local `keyword`, `limit`, `offset`
|
|
215
|
+
- aliases: `deptId`, `department_id`, `departmentId`, `fetchChild`
|
|
216
|
+
3. `qf_users_list`
|
|
217
|
+
- required `page_num`, `page_size`
|
|
218
|
+
- aliases: `pageNum`, `pageSize`
|
|
219
|
+
4. `qf_user_get`
|
|
220
|
+
- required `user_id`
|
|
221
|
+
- alias: `userId`
|
|
222
|
+
|
|
223
|
+
CLI examples:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
qingflow-mcp cli call qf_departments_list --args '{"keyword":"销售","limit":20}'
|
|
227
|
+
|
|
228
|
+
qingflow-mcp cli call qf_department_users_list --args '{"deptId":111,"fetchChild":true}'
|
|
229
|
+
|
|
230
|
+
qingflow-mcp cli call qf_users_list --args '{"pageNum":1,"pageSize":100}'
|
|
231
|
+
|
|
232
|
+
qingflow-mcp cli call qf_user_get --args '{"userId":"u_123"}'
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Admin App Tools
|
|
236
|
+
|
|
237
|
+
These tools expose admin-facing app and package metadata without routing through `qf_query`:
|
|
238
|
+
|
|
239
|
+
1. `qf_apps_info_list`
|
|
240
|
+
- required `page_num`, `page_size`
|
|
241
|
+
- optional `app_key`
|
|
242
|
+
- aliases: `pageNum`, `pageSize`, `appKey`
|
|
243
|
+
2. `qf_app_info_get`
|
|
244
|
+
- required `app_key`
|
|
245
|
+
- alias: `appKey`
|
|
246
|
+
3. `qf_app_packages_list`
|
|
247
|
+
- required `user_id`
|
|
248
|
+
- optional `tag_id`, `keyword`, `limit`, `offset`
|
|
249
|
+
- aliases: `userId`, `tagId`
|
|
250
|
+
|
|
251
|
+
CLI examples:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
qingflow-mcp cli call qf_apps_info_list --args '{"pageNum":1,"pageSize":50}'
|
|
255
|
+
|
|
256
|
+
qingflow-mcp cli call qf_app_info_get --args '{"appKey":"app_demo"}'
|
|
257
|
+
|
|
258
|
+
qingflow-mcp cli call qf_app_packages_list --args '{"userId":"u_123","tagId":1001}'
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Audit Tools
|
|
262
|
+
|
|
263
|
+
These tools expose workflow log history as read-only MCP tools:
|
|
264
|
+
|
|
265
|
+
1. `qf_apply_audit_records_list`
|
|
266
|
+
- required `apply_id`
|
|
267
|
+
- alias: `applyId`
|
|
268
|
+
2. `qf_apply_audit_record_get`
|
|
269
|
+
- required `apply_id`, `audit_rcd_id`
|
|
270
|
+
- aliases: `applyId`, `auditRcdId`
|
|
271
|
+
|
|
272
|
+
CLI examples:
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
qingflow-mcp cli call qf_apply_audit_records_list --args '{"applyId":"50001234"}'
|
|
276
|
+
|
|
277
|
+
qingflow-mcp cli call qf_apply_audit_record_get --args '{"applyId":"50001234","auditRcdId":"1111"}'
|
|
278
|
+
```
|
|
279
|
+
|
|
176
280
|
Return shape:
|
|
177
281
|
|
|
178
282
|
1. success: structured payload `{ "ok": true, "data": ... }` (`meta` only in `output_profile=verbose`)
|
package/dist/qingflow-client.js
CHANGED
|
@@ -33,6 +33,84 @@ export class QingflowClient {
|
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
+
listAppsInfo(options) {
|
|
37
|
+
return this.request({
|
|
38
|
+
method: "GET",
|
|
39
|
+
path: "/apps",
|
|
40
|
+
options: {
|
|
41
|
+
query: {
|
|
42
|
+
appKey: options.appKey,
|
|
43
|
+
pageNum: options.pageNum,
|
|
44
|
+
pageSize: options.pageSize
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
listAppPackages(options) {
|
|
50
|
+
return this.request({
|
|
51
|
+
method: "GET",
|
|
52
|
+
path: "/tags",
|
|
53
|
+
options: {
|
|
54
|
+
query: {
|
|
55
|
+
userId: options.userId
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
listApplyAuditRecords(applyId) {
|
|
61
|
+
return this.request({
|
|
62
|
+
method: "GET",
|
|
63
|
+
path: `/apply/${encodeURIComponent(applyId)}/auditRecord`
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
getApplyAuditRecord(applyId, auditRcdId) {
|
|
67
|
+
return this.request({
|
|
68
|
+
method: "GET",
|
|
69
|
+
path: `/apply/${encodeURIComponent(applyId)}/auditRecord/${encodeURIComponent(auditRcdId)}`
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
listDepartments(options = {}) {
|
|
73
|
+
return this.request({
|
|
74
|
+
method: "GET",
|
|
75
|
+
path: "/department",
|
|
76
|
+
options: {
|
|
77
|
+
query: {
|
|
78
|
+
deptId: options.deptId !== undefined && options.deptId !== null
|
|
79
|
+
? String(options.deptId)
|
|
80
|
+
: undefined
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
listDepartmentUsers(deptId, options) {
|
|
86
|
+
return this.request({
|
|
87
|
+
method: "GET",
|
|
88
|
+
path: `/department/${encodeURIComponent(deptId)}/user`,
|
|
89
|
+
options: {
|
|
90
|
+
query: {
|
|
91
|
+
fetchChild: options.fetchChild
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
listUsers(options) {
|
|
97
|
+
return this.request({
|
|
98
|
+
method: "GET",
|
|
99
|
+
path: "/user",
|
|
100
|
+
options: {
|
|
101
|
+
query: {
|
|
102
|
+
pageNum: options.pageNum,
|
|
103
|
+
pageSize: options.pageSize
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
getUser(userId) {
|
|
109
|
+
return this.request({
|
|
110
|
+
method: "GET",
|
|
111
|
+
path: `/user/${encodeURIComponent(userId)}`
|
|
112
|
+
});
|
|
113
|
+
}
|
|
36
114
|
getForm(appKey, options = {}) {
|
|
37
115
|
return this.request({
|
|
38
116
|
method: "GET",
|