@josephyan/qingflow-app-builder-mcp 1.1.4 → 1.1.6

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.
Files changed (98) hide show
  1. package/README.md +6 -5
  2. package/docs/local-agent-install.md +57 -6
  3. package/entry_point.py +1 -1
  4. package/npm/bin/qingflow-app-builder-mcp.mjs +2 -33
  5. package/npm/bin/qingflow-skills.mjs +5 -0
  6. package/npm/lib/runtime.mjs +21 -101
  7. package/npm/scripts/postinstall.mjs +1 -10
  8. package/package.json +3 -2
  9. package/pyproject.toml +1 -1
  10. package/skills/qingflow-app-builder/SKILL.md +51 -34
  11. package/skills/qingflow-app-builder/references/complete-system-development-guide.md +123 -0
  12. package/skills/qingflow-app-builder/references/create-app.md +19 -6
  13. package/skills/qingflow-app-builder/references/environments.md +1 -1
  14. package/skills/qingflow-app-builder/references/gotchas.md +14 -6
  15. package/skills/qingflow-app-builder/references/match-rules.md +15 -0
  16. package/skills/qingflow-app-builder/references/single-app-development-guide.md +58 -0
  17. package/skills/qingflow-app-builder/references/solution-playbooks.md +10 -0
  18. package/skills/qingflow-app-builder/references/tool-selection.md +21 -22
  19. package/skills/qingflow-app-builder/references/update-flow.md +22 -38
  20. package/skills/qingflow-app-builder/references/update-schema.md +3 -0
  21. package/skills/qingflow-app-builder/references/update-views.md +34 -14
  22. package/skills/qingflow-app-builder/scripts/validate_system_build_summary.py +124 -0
  23. package/skills/qingflow-app-builder-code-integrations/SKILL.md +5 -3
  24. package/skills/qingflow-app-builder-code-integrations/references/code-block.md +1 -1
  25. package/skills/qingflow-app-builder-code-integrations/references/q-linker.md +1 -1
  26. package/src/qingflow_mcp/__init__.py +1 -1
  27. package/src/qingflow_mcp/__main__.py +6 -2
  28. package/src/qingflow_mcp/builder_facade/models.py +282 -102
  29. package/src/qingflow_mcp/builder_facade/service.py +4192 -935
  30. package/src/qingflow_mcp/cli/commands/builder.py +316 -298
  31. package/src/qingflow_mcp/cli/commands/chart.py +1 -1
  32. package/src/qingflow_mcp/cli/commands/common.py +12 -3
  33. package/src/qingflow_mcp/cli/commands/exports.py +2 -2
  34. package/src/qingflow_mcp/cli/commands/imports.py +3 -3
  35. package/src/qingflow_mcp/cli/commands/portal.py +2 -2
  36. package/src/qingflow_mcp/cli/commands/record.py +101 -27
  37. package/src/qingflow_mcp/cli/commands/task.py +28 -47
  38. package/src/qingflow_mcp/cli/commands/view.py +1 -1
  39. package/src/qingflow_mcp/cli/context.py +0 -3
  40. package/src/qingflow_mcp/cli/formatters.py +784 -16
  41. package/src/qingflow_mcp/cli/main.py +117 -33
  42. package/src/qingflow_mcp/errors.py +43 -2
  43. package/src/qingflow_mcp/public_surface.py +26 -17
  44. package/src/qingflow_mcp/response_trim.py +81 -17
  45. package/src/qingflow_mcp/server.py +14 -12
  46. package/src/qingflow_mcp/server_app_builder.py +65 -21
  47. package/src/qingflow_mcp/server_app_user.py +22 -16
  48. package/src/qingflow_mcp/session_store.py +11 -7
  49. package/src/qingflow_mcp/solution/compiler/__init__.py +3 -1
  50. package/src/qingflow_mcp/solution/compiler/workflow_compiler.py +173 -0
  51. package/src/qingflow_mcp/solution/executor.py +245 -18
  52. package/src/qingflow_mcp/tools/ai_builder_tools.py +1780 -406
  53. package/src/qingflow_mcp/tools/app_tools.py +184 -43
  54. package/src/qingflow_mcp/tools/approval_tools.py +197 -35
  55. package/src/qingflow_mcp/tools/auth_tools.py +92 -16
  56. package/src/qingflow_mcp/tools/code_block_tools.py +298 -40
  57. package/src/qingflow_mcp/tools/custom_button_tools.py +64 -10
  58. package/src/qingflow_mcp/tools/directory_tools.py +236 -72
  59. package/src/qingflow_mcp/tools/export_tools.py +244 -34
  60. package/src/qingflow_mcp/tools/feedback_tools.py +9 -0
  61. package/src/qingflow_mcp/tools/file_tools.py +9 -3
  62. package/src/qingflow_mcp/tools/import_tools.py +336 -49
  63. package/src/qingflow_mcp/tools/navigation_tools.py +91 -12
  64. package/src/qingflow_mcp/tools/package_tools.py +118 -6
  65. package/src/qingflow_mcp/tools/portal_tools.py +39 -3
  66. package/src/qingflow_mcp/tools/qingbi_report_tools.py +116 -7
  67. package/src/qingflow_mcp/tools/record_tools.py +1141 -356
  68. package/src/qingflow_mcp/tools/resource_read_tools.py +188 -39
  69. package/src/qingflow_mcp/tools/role_tools.py +80 -9
  70. package/src/qingflow_mcp/tools/solution_tools.py +59 -45
  71. package/src/qingflow_mcp/tools/task_context_tools.py +662 -158
  72. package/src/qingflow_mcp/tools/task_tools.py +113 -29
  73. package/src/qingflow_mcp/tools/view_tools.py +106 -3
  74. package/src/qingflow_mcp/tools/workflow_tools.py +48 -4
  75. package/src/qingflow_mcp/tools/workspace_tools.py +71 -3
  76. package/skills/qingflow-app-builder/references/build-complete-system.md +0 -428
  77. package/skills/qingflow-app-builder/references/build-single-app.md +0 -530
  78. package/skills/qingflow-mcp-setup/SKILL.md +0 -111
  79. package/skills/qingflow-mcp-setup/agents/openai.yaml +0 -4
  80. package/skills/qingflow-mcp-setup/references/claude-desktop.md +0 -34
  81. package/skills/qingflow-mcp-setup/references/environments.md +0 -61
  82. package/skills/qingflow-mcp-setup/references/generic-stdio.md +0 -31
  83. package/skills/qingflow-mcp-setup/scripts/check_local_server.sh +0 -38
  84. package/skills/qingflow-workflow-builder/SKILL.md +0 -96
  85. package/skills/qingflow-workflow-builder/manifest.yaml +0 -8
  86. package/skills/qingflow-workflow-builder/references/01-overview.md +0 -45
  87. package/skills/qingflow-workflow-builder/references/02-update-mode.md +0 -53
  88. package/skills/qingflow-workflow-builder/references/03-flow-patterns.md +0 -57
  89. package/skills/qingflow-workflow-builder/references/04-stage1-business-modeling.md +0 -131
  90. package/skills/qingflow-workflow-builder/references/05-stage2-members-roles.md +0 -29
  91. package/skills/qingflow-workflow-builder/references/06-stage3-build-spec.md +0 -165
  92. package/skills/qingflow-workflow-builder/references/07-stage4-validate-spec.md +0 -33
  93. package/skills/qingflow-workflow-builder/references/08-stage5-apply-verify.md +0 -51
  94. package/skills/qingflow-workflow-builder/references/09-stage6-summary.md +0 -88
  95. package/skills/qingflow-workflow-builder/references/10-node-config-reference.md +0 -93
  96. package/skills/qingflow-workflow-builder/references/11-troubleshooting.md +0 -15
  97. package/skills/qingflow-workflow-builder/scripts/diff_flow_spec.py +0 -275
  98. package/skills/qingflow-workflow-builder/scripts/validate_flow_spec.py +0 -605
@@ -1,530 +0,0 @@
1
- # Build Single App(单应用完整搭建)
2
-
3
- Use this when the user wants to set up one Qingflow app end-to-end: a rich field schema, grouped layout, approval flow, multiple view types, custom action buttons, in-app charts, associated reports on views, and sample data.
4
-
5
- **Signal phrases**: "创建一个应用"、"帮我搭一个XX管理"、"从零开始建一个XX表单"、"我需要一个管理XX的应用"
6
-
7
- For a multi-app system with cross-app relations and a portal dashboard, use [build-complete-system.md](./build-complete-system.md) instead.
8
-
9
- ---
10
-
11
- ## Execution order (never reorder)
12
-
13
- ```
14
- Phase 0 → Phase 1 → Phase 2 → Phase 3 → Phase 4 → Phase 5 → Phase 6 → Phase 7 → Phase 8 → Phase 9
15
- Package Schema Layout Flow Views Buttons Charts Assoc. Data Verify
16
- Res.
17
- ```
18
-
19
- - Phase 4 (views) must complete before Phase 7 (associated resources) — `view_key` values must be known first
20
- - Phase 6 (charts) must complete before Phase 7 (associated resources) — `chart_id`/`chart_key` values must be known first
21
- - Phase 8 (data) runs after all config phases — fields, flow, and views must be live
22
-
23
- ---
24
-
25
- ## Phase 0 — Scan workspace packages
26
-
27
- ```json
28
- {"tool_name": "package_list", "arguments": {"profile": "default"}}
29
- ```
30
-
31
- - **Package name exists in workspace** → tell the user, wait for explicit confirmation before adding the app into it
32
- - **Package name not in workspace** → create immediately, no confirmation needed:
33
-
34
- ```json
35
- {
36
- "tool_name": "package_apply",
37
- "arguments": {
38
- "profile": "default",
39
- "package_name": "合同管理",
40
- "create_if_missing": true
41
- }
42
- }
43
- ```
44
-
45
- Record the returned `package_id`. All subsequent phases use it.
46
-
47
- ---
48
-
49
- ## Phase 1 — Schema (15–20 fields)
50
-
51
- > **Read first**: [update-schema.md](./update-schema.md)
52
-
53
- ### Field type distribution
54
-
55
- | Type | Count | Examples |
56
- |------|-------|---------|
57
- | `text` | 2–3 | 名称、编号、联系人 |
58
- | `long_text` | 1–2 | 描述、摘要、备注 |
59
- | `single_select` | 2–3 | 状态、类型、优先级 |
60
- | `multi_select` | 1–2 | 标签、关联业务线 |
61
- | `date` / `datetime` | 2–3 | 签署日期、生效日期、到期日期 |
62
- | `amount` | 1–2 | 合同金额、已付金额 |
63
- | `number` | 1–2 | 期限(月)、完成率(%) |
64
- | `member` | 2 | 负责人、审核人 |
65
- | `department` | 0–1 | 所属部门 |
66
- | `phone` | 0–1 | 联系电话 |
67
- | `attachment` | 1 | 附件(`as_data_cover: true` for cover display) |
68
-
69
- ### Hard rules
70
-
71
- - Exactly one field must have `as_data_title: true`
72
- - `as_data_cover: true` requires `type: attachment`
73
- - No `relation` fields in a single-app build — use [build-complete-system.md](./build-complete-system.md) if cross-app links are needed
74
- - `single_select`/`multi_select` fields must include an `options` array
75
-
76
- ### Example — 合同管理
77
-
78
- ```json
79
- {
80
- "tool_name": "app_schema_apply",
81
- "arguments": {
82
- "profile": "default",
83
- "package_id": 1218950,
84
- "create_if_missing": true,
85
- "publish": true,
86
- "apps": [
87
- {
88
- "client_key": "contract",
89
- "app_name": "合同",
90
- "add_fields": [
91
- {"name": "合同名称", "type": "text", "required": true, "as_data_title": true},
92
- {"name": "合同编号", "type": "text"},
93
- {"name": "合同类型", "type": "single_select", "options": ["服务合同", "采购合同", "劳务合同", "保密协议", "其他"]},
94
- {"name": "合同状态", "type": "single_select", "options": ["草稿", "审批中", "已生效", "已到期", "已终止"]},
95
- {"name": "优先级", "type": "single_select", "options": ["高", "中", "低"]},
96
- {"name": "合同标签", "type": "multi_select", "options": ["重点客户", "续签", "新签", "框架协议"]},
97
- {"name": "签署日期", "type": "date"},
98
- {"name": "生效日期", "type": "date"},
99
- {"name": "到期日期", "type": "date"},
100
- {"name": "合同金额", "type": "amount"},
101
- {"name": "已付金额", "type": "amount"},
102
- {"name": "付款比例", "type": "number"},
103
- {"name": "合同期限(月)", "type": "number"},
104
- {"name": "负责人", "type": "member"},
105
- {"name": "法务审核人", "type": "member"},
106
- {"name": "所属部门", "type": "department"},
107
- {"name": "甲方联系人", "type": "text"},
108
- {"name": "甲方联系电话", "type": "phone"},
109
- {"name": "合同内容摘要", "type": "long_text"},
110
- {"name": "合同附件", "type": "attachment", "as_data_cover": true}
111
- ]
112
- }
113
- ]
114
- }
115
- }
116
- ```
117
-
118
- Record the returned `app_key`. All subsequent phases use it.
119
-
120
- ---
121
-
122
- ## Phase 2 — Layout
123
-
124
- > **Read first**: [update-layout.md](./update-layout.md)
125
-
126
- Group fields into 3–4 logical sections with 2–3 fields per row.
127
-
128
- ```json
129
- {
130
- "tool_name": "app_layout_apply",
131
- "arguments": {
132
- "profile": "default",
133
- "app_key": "APP_KEY",
134
- "mode": "merge",
135
- "publish": true,
136
- "sections": [
137
- {
138
- "title": "基础信息",
139
- "rows": [
140
- ["合同名称", "合同编号"],
141
- ["合同类型", "合同状态"],
142
- ["优先级", "合同标签"]
143
- ]
144
- },
145
- {
146
- "title": "时间与金额",
147
- "rows": [
148
- ["签署日期", "生效日期", "到期日期"],
149
- ["合同金额", "已付金额"],
150
- ["付款比例", "合同期限(月)"]
151
- ]
152
- },
153
- {
154
- "title": "责任人",
155
- "rows": [
156
- ["负责人", "法务审核人"],
157
- ["所属部门"]
158
- ]
159
- },
160
- {
161
- "title": "对方信息与附件",
162
- "rows": [
163
- ["甲方联系人", "甲方联系电话"],
164
- ["合同内容摘要"],
165
- ["合同附件"]
166
- ]
167
- }
168
- ]
169
- }
170
- }
171
- ```
172
-
173
- ---
174
-
175
- ## Phase 3 — Flow
176
-
177
- > **Read first**: [update-flow.md](./update-flow.md) and [flow-actors-and-permissions.md](./flow-actors-and-permissions.md)
178
-
179
- Search for roles first; create only if none fits:
180
-
181
- ```json
182
- {"tool_name": "role_search", "arguments": {"profile": "default", "query": "法务"}}
183
- ```
184
-
185
- ```json
186
- {
187
- "tool_name": "app_flow_apply",
188
- "arguments": {
189
- "profile": "default",
190
- "app_key": "APP_KEY",
191
- "preset": "basic_approval",
192
- "publish": true,
193
- "nodes": [
194
- {
195
- "id": "approve_1",
196
- "type": "approve",
197
- "name": "法务审核",
198
- "assignees": {"role_names": ["法务"]},
199
- "permissions": {"editable_fields": ["合同状态", "合同内容摘要"]}
200
- },
201
- {
202
- "id": "approve_2",
203
- "type": "approve",
204
- "name": "负责人确认",
205
- "assignees": {"role_names": ["部门主管"]},
206
- "permissions": {"editable_fields": ["合同状态"]}
207
- }
208
- ]
209
- }
210
- }
211
- ```
212
-
213
- ---
214
-
215
- ## Phase 4 — Views (multiple types)
216
-
217
- > **Read first**: [update-views.md](./update-views.md)
218
-
219
- Build all applicable view types in one call. All views require `query_conditions` with `enabled: true`.
220
-
221
- | Type | Build condition | Key config |
222
- |------|----------------|------------|
223
- | **table** | Always — build first | `columns` covering title/status/date/amount/member |
224
- | **board** | App has a `single_select` status or stage field | `group_by` = that field name |
225
- | **gantt** | App has 2+ date fields | `start_field` + `end_field` |
226
- | **card** | App has `attachment` with `as_data_cover: true` | Visual browsing |
227
- | **calendar** | App has a key due/expiry date field | `date_field` = that field name |
228
-
229
- ```json
230
- {
231
- "tool_name": "app_views_apply",
232
- "arguments": {
233
- "profile": "default",
234
- "app_key": "APP_KEY",
235
- "publish": true,
236
- "upsert_views": [
237
- {
238
- "name": "全部合同",
239
- "type": "table",
240
- "columns": ["合同名称", "合同编号", "合同类型", "合同状态", "合同金额", "负责人", "签署日期", "到期日期"],
241
- "query_conditions": {
242
- "enabled": true,
243
- "exact": false,
244
- "hide_before_query": false,
245
- "rows": [["合同名称", "合同类型"], ["合同状态", "负责人"], ["签署日期", "到期日期"]]
246
- }
247
- },
248
- {
249
- "name": "合同看板",
250
- "type": "board",
251
- "columns": ["合同名称", "合同类型", "合同金额", "负责人", "到期日期"],
252
- "group_by": "合同状态",
253
- "query_conditions": {
254
- "enabled": true,
255
- "exact": false,
256
- "hide_before_query": false,
257
- "rows": [["合同名称", "负责人"]]
258
- }
259
- },
260
- {
261
- "name": "合同甘特图",
262
- "type": "gantt",
263
- "columns": ["合同名称", "合同状态", "负责人", "合同金额"],
264
- "start_field": "生效日期",
265
- "end_field": "到期日期",
266
- "query_conditions": {
267
- "enabled": true,
268
- "exact": false,
269
- "hide_before_query": false,
270
- "rows": [["合同名称", "合同状态"]]
271
- }
272
- },
273
- {
274
- "name": "合同卡片",
275
- "type": "card",
276
- "columns": ["合同名称", "合同类型", "合同状态", "合同金额", "到期日期"],
277
- "query_conditions": {
278
- "enabled": true,
279
- "exact": false,
280
- "hide_before_query": false,
281
- "rows": [["合同名称", "合同状态"]]
282
- }
283
- },
284
- {
285
- "name": "到期日历",
286
- "type": "calendar",
287
- "columns": ["合同名称", "合同类型", "合同金额", "负责人"],
288
- "date_field": "到期日期",
289
- "query_conditions": {
290
- "enabled": true,
291
- "exact": false,
292
- "hide_before_query": false,
293
- "rows": [["合同名称", "合同状态"]]
294
- }
295
- }
296
- ]
297
- }
298
- }
299
- ```
300
-
301
- Record all `view_key` values before Phase 7.
302
-
303
- ---
304
-
305
- ## Phase 5 — Custom Buttons
306
-
307
- > Call `builder_tool_contract(tool="app_custom_buttons_apply")` if the exact button schema is unclear.
308
- > `app_custom_buttons_apply` publishes automatically — do **not** pass `publish`.
309
-
310
- Build 2–3 buttons. Common patterns for a single app:
311
-
312
- | Button | Trigger type | Placement | When to use |
313
- |--------|-------------|-----------|-------------|
314
- | 快捷创建子记录 | `add_data` | header, detail | When a related app exists in the same package |
315
- | 外部跳转 | `link` | header, list | Always applicable — jump to external URL or doc |
316
- | 列表行操作 | `add_data` / `link` | list | Row-level quick action in table view |
317
-
318
- **Example — link button (always applicable) + add-data button (requires a related app):**
319
-
320
- ```json
321
- {
322
- "tool_name": "app_custom_buttons_apply",
323
- "arguments": {
324
- "profile": "default",
325
- "app_key": "APP_KEY",
326
- "upsert_buttons": [
327
- {
328
- "name": "查看合同模板",
329
- "trigger_type": "link",
330
- "style": "default",
331
- "placements": ["header", "detail"],
332
- "trigger_link_config": {
333
- "url": "https://your-template-url"
334
- }
335
- },
336
- {
337
- "name": "发起变更申请",
338
- "trigger_type": "add_data",
339
- "style": "primary",
340
- "placements": ["header", "detail", "list"],
341
- "trigger_add_data_config": {
342
- "target_app_key": "CHANGE_REQUEST_APP_KEY",
343
- "field_mappings": [
344
- {"source_field": "数据ID", "target_field": "关联合同"},
345
- {"source_field": "合同名称", "target_field": "合同标题"},
346
- {"source_field": "负责人", "target_field": "申请人"}
347
- ]
348
- }
349
- }
350
- ],
351
- "view_configs": [
352
- {
353
- "view_key": "TABLE_VIEW_KEY",
354
- "mode": "merge",
355
- "buttons": ["发起变更申请", "查看合同模板"]
356
- }
357
- ]
358
- }
359
- }
360
- ```
361
-
362
- **Notes:**
363
- - `placements: ["list"]` maps to the backend row-level `INSIDE` position
364
- - `view_configs[].buttons` is required in merge mode — do not send a view config with only `view_key`
365
- - `source_field: "数据ID"` passes the current record's ID to the target relation field
366
- - If this app has no related app, skip the add-data button and use the link button only
367
- - Use raw `view_key` from `app_get.views[].view_key`; do not prefix with `custom:`
368
-
369
- ---
370
-
371
- ## Phase 6 — Charts
372
-
373
- > `app_charts_apply` is immediate-live — no publish step. Record all returned `chart_id`/`chart_key` values before Phase 7.
374
-
375
- Build 2–4 charts: 2 indicator cards + 1 distribution chart + 1 trend chart.
376
-
377
- ```json
378
- {
379
- "tool_name": "app_charts_apply",
380
- "arguments": {
381
- "profile": "default",
382
- "app_key": "APP_KEY",
383
- "upsert_charts": [
384
- {
385
- "name": "合同总金额",
386
- "chart_type": "target",
387
- "config": {
388
- "measure_field": "合同金额",
389
- "aggregate": "SUM"
390
- }
391
- },
392
- {
393
- "name": "有效合同数",
394
- "chart_type": "target",
395
- "config": {
396
- "filter": {"合同状态": ["已生效"]},
397
- "aggregate": "COUNT"
398
- }
399
- },
400
- {
401
- "name": "合同状态分布",
402
- "chart_type": "columnar",
403
- "config": {
404
- "dimension_field": "合同状态",
405
- "measure_field": "合同金额",
406
- "aggregate": "SUM"
407
- }
408
- },
409
- {
410
- "name": "月度签约趋势",
411
- "chart_type": "area",
412
- "config": {
413
- "dimension_field": "签署日期",
414
- "time_granularity": "month",
415
- "measure_field": "合同金额",
416
- "aggregate": "SUM"
417
- }
418
- }
419
- ]
420
- }
421
- }
422
- ```
423
-
424
- ---
425
-
426
- ## Phase 7 — Associated Resources
427
-
428
- Attach charts to the app's view area so users can see them inline without leaving the app.
429
-
430
- Before running `upsert_resources`, check existing resources with the dedicated read tool:
431
-
432
- ```json
433
- {"tool_name": "app_get_associated_resources", "arguments": {"profile": "default", "app_key": "APP_KEY"}}
434
- ```
435
-
436
- If the result already contains the target chart, use `patch_resources` with its `associated_item_id` instead of re-upserting.
437
-
438
- ```json
439
- {
440
- "tool_name": "app_associated_resources_apply",
441
- "arguments": {
442
- "profile": "default",
443
- "app_key": "APP_KEY",
444
- "upsert_resources": [
445
- {
446
- "client_key": "res_status_chart",
447
- "resource_type": "chart",
448
- "chart_key": "CHART_KEY_FOR_STATUS_DISTRIBUTION",
449
- "display_name": "合同状态分布"
450
- },
451
- {
452
- "client_key": "res_trend_chart",
453
- "resource_type": "chart",
454
- "chart_key": "CHART_KEY_FOR_TREND",
455
- "display_name": "月度签约趋势"
456
- }
457
- ],
458
- "view_configs": [
459
- {
460
- "view_key": "TABLE_VIEW_KEY",
461
- "associated_item_refs": ["res_status_chart", "res_trend_chart"]
462
- }
463
- ]
464
- }
465
- }
466
- ```
467
-
468
- **Notes:**
469
- - `app_associated_resources_apply` publishes automatically — do **not** pass `publish`
470
- - `client_key` is a same-call alias only; repeated `upsert_resources` without `associated_item_id` creates duplicates
471
- - On subsequent edits, use `patch_resources` with `associated_item_id` instead
472
-
473
- ---
474
-
475
- ## Phase 8 — Sample Data
476
-
477
- > **Hand off to `qingflow-record-insert` skill**. Read the record-insert skill docs before inserting.
478
-
479
- Insert **5–8 records** covering all status values and realistic amounts. Call `record_insert_schema_get` first.
480
-
481
- ```json
482
- {"tool_name": "record_insert_schema_get", "arguments": {"profile": "default", "app_key": "APP_KEY"}}
483
- ```
484
-
485
- ```json
486
- {
487
- "tool_name": "record_insert",
488
- "arguments": {
489
- "profile": "default",
490
- "app_key": "APP_KEY",
491
- "items": [
492
- {"合同名称": "上海科技服务协议", "合同编号": "HT-2024-001", "合同类型": "服务合同", "合同状态": "已生效", "合同金额": 580000, "已付金额": 290000, "负责人": "张三", "签署日期": "2024-01-15", "生效日期": "2024-02-01", "到期日期": "2025-01-31", "优先级": "高", "合同期限(月)": 12},
493
- {"合同名称": "北京采购框架合同", "合同编号": "HT-2024-002", "合同类型": "采购合同", "合同状态": "审批中", "合同金额": 1200000, "已付金额": 0, "负责人": "李四", "签署日期": "2024-03-10", "生效日期": "2024-04-01", "到期日期": "2025-03-31", "优先级": "高", "合同期限(月)": 12},
494
- {"合同名称": "广州运维服务合同", "合同编号": "HT-2024-003", "合同类型": "服务合同", "合同状态": "已生效", "合同金额": 240000, "已付金额": 120000, "负责人": "王五", "签署日期": "2024-02-20", "生效日期": "2024-03-01", "到期日期": "2024-12-31", "优先级": "中", "合同期限(月)": 10},
495
- {"合同名称": "深圳保密协议", "合同编号": "HT-2024-004", "合同类型": "保密协议", "合同状态": "已生效", "合同金额": 0, "已付金额": 0, "负责人": "张三", "签署日期": "2024-04-05", "生效日期": "2024-04-05", "到期日期": "2027-04-04", "优先级": "中", "合同期限(月)": 36},
496
- {"合同名称": "杭州合作开发合同", "合同编号": "HT-2024-005", "合同类型": "服务合同", "合同状态": "草稿", "合同金额": 850000, "已付金额": 0, "负责人": "李四", "签署日期": "2024-05-01", "生效日期": "2024-06-01", "到期日期": "2025-05-31", "优先级": "高", "合同期限(月)": 12},
497
- {"合同名称": "成都劳务外包合同", "合同编号": "HT-2023-006", "合同类型": "劳务合同", "合同状态": "已到期", "合同金额": 360000, "已付金额": 360000, "负责人": "王五", "签署日期": "2023-01-01", "生效日期": "2023-01-01", "到期日期": "2023-12-31", "优先级": "低", "合同期限(月)": 12}
498
- ]
499
- }
500
- }
501
- ```
502
-
503
- Member and department fields accept natural language values — do not look up IDs manually.
504
-
505
- ---
506
-
507
- ## Phase 9 — Publish Verify
508
-
509
- ```json
510
- {"tool_name": "app_publish_verify", "arguments": {"profile": "default", "app_key": "APP_KEY"}}
511
- ```
512
-
513
- Confirm `publish_status` is live and `unplaced_fields` is empty. If `unplaced_fields` is non-empty, run `app_layout_apply` to place them before reporting completion.
514
-
515
- ---
516
-
517
- ## Common failures
518
-
519
- | Error | Phase | Fix |
520
- |-------|-------|-----|
521
- | `VALIDATION_ERROR` on select field | 1 | `single_select`/`multi_select` must include `options` array |
522
- | `UNKNOWN_LAYOUT_FIELD` | 2 | Re-read with `app_get_fields`; field name in `rows` must match exactly |
523
- | `FLOW_ASSIGNEE_REQUIRED` | 3 | Run `role_search` first; every approve/fill node must have at least one assignee |
524
- | View `partial_success` | 4 | Check `verification.view_query_conditions_verified`; read `views_diff.failed` |
525
- | `calendar` view rejected | 4 | Build calendar only when a date field exists; verify field type |
526
- | Button `view_configs` blocked | 5 | `buttons` array is required in merge mode; do not send a view config with only `view_key` |
527
- | Button add-data fails — no related app | 5 | Skip add-data button; use link button only |
528
- | Chart config rejected | 6 | Call `builder_tool_contract(tool="app_charts_apply")` for exact field/aggregate schema |
529
- | Associated resource duplicate | 7 | Check `app_get.associated_resources` first; use `patch_resources` with `associated_item_id` if already exists |
530
- | `unplaced_fields` non-empty on verify | 9 | Run `app_layout_apply` to place the missing fields, then re-verify |
@@ -1,111 +0,0 @@
1
- ---
2
- name: qingflow-mcp-setup
3
- description: Install, connect, authenticate, and troubleshoot the Qingflow MCP server in local AI clients such as Claude Desktop or any stdio-compatible MCP client. Use when the user wants to configure the MCP, verify local startup, log in with token/password, select a workspace, or fix connection/authentication issues.
4
- metadata:
5
- short-description: Install and connect the Qingflow MCP locally
6
- ---
7
-
8
- # Qingflow MCP Setup
9
-
10
- ## Overview
11
-
12
- This skill sets up the local Qingflow MCP server, connects it to a local AI client, and verifies authentication and workspace selection. Use it for installation, client configuration, token login, and connection troubleshooting.
13
-
14
- ## Workflow
15
-
16
- Follow these steps in order.
17
-
18
- `feedback_submit` is also available as a cross-cutting helper when setup or MCP capability gaps still block the user after reasonable troubleshooting. It does not require Qingflow login or workspace selection, and should be called only after explicit user confirmation.
19
-
20
- Before configuration or live calls, identify the target environment explicitly as `test` or `prod`, then read [references/environments.md](references/environments.md). If the user did not specify one, default to `prod`.
21
-
22
- ### Step 1: Verify the local project path
23
-
24
- Resolve the repository root first. In this repo, the MCP server should live at:
25
-
26
- - `<repo_root>/qingflow-support/mcp-server`
27
-
28
- Key entrypoint:
29
-
30
- - `<repo_root>/qingflow-support/mcp-server/qingflow-mcp`
31
-
32
- If the path differs, stop and update all client config snippets before proceeding.
33
- If the skill is installed under `$CODEX_HOME/skills` instead of the repo-local `.codex/skills`, set `QINGFLOW_MCP_ROOT=<repo_root>/qingflow-support/mcp-server` before running `scripts/check_local_server.sh`.
34
-
35
- ### Step 2: Install local dependencies
36
-
37
- Run:
38
-
39
- ```bash
40
- cd <repo_root>/qingflow-support/mcp-server
41
- python3 -m venv .venv
42
- ./.venv/bin/pip install -e '.[dev]'
43
- ```
44
-
45
- Use `scripts/check_local_server.sh` to verify the entrypoint and virtualenv. The script will first try `QINGFLOW_MCP_ROOT`, then the current git repo, then a repo-local `.codex/skills` layout.
46
-
47
- ### Step 3: Configure the local AI client
48
-
49
- For any stdio-compatible MCP client, map these values:
50
-
51
- - `command`: `<repo_root>/qingflow-support/mcp-server/qingflow-mcp`
52
- - `args`: `[]`
53
- - `env.QINGFLOW_MCP_DEFAULT_BASE_URL`: the target backend URL for the active environment
54
- - `env.QINGFLOW_MCP_DEFAULT_QF_VERSION`: set this when the environment must route to a specific version such as `canary`
55
-
56
- Client-specific snippets:
57
-
58
- - Claude Desktop: read [references/claude-desktop.md](references/claude-desktop.md)
59
- - Generic stdio MCP clients: read [references/generic-stdio.md](references/generic-stdio.md)
60
-
61
- When both test and production are in play, keep separate config snippets or clearly labeled `env` blocks so the user can switch without ambiguity.
62
-
63
- ### Step 4: Validate startup
64
-
65
- The server is a stdio MCP process. A direct terminal launch may print nothing and wait for a client. That is normal.
66
-
67
- Manual startup command:
68
-
69
- ```bash
70
- cd <repo_root>/qingflow-support/mcp-server
71
- ./qingflow-mcp
72
- ```
73
-
74
- Prefer validating through the client after config is added.
75
-
76
- ### Step 5: Authenticate and select workspace
77
-
78
- Recommended order inside the client:
79
-
80
- 1. `auth_use_token` or `auth_login`
81
- 2. `workspace_list`
82
- 3. `workspace_select`
83
- 4. Only then use business tools
84
-
85
- If the user already knows the target workspace, prefer `auth_use_token(..., ws_id=<id>)`.
86
- After auth, prefer one read-only tool call that returns `request_route` so you can confirm the live `base_url` and `qf_version` before proceeding.
87
- `auth_use_token` is a tool call, not a custom HTTP header. The runtime injects `token`, `wsId`, and when needed `Cookie: qfVersion=...` after the session is established.
88
- Do not skip `workspace_select` on production paths. If `/user` does not return a version lane, the session now falls back to the workspace `systemVersion`.
89
-
90
- ### Step 6: Troubleshoot in the right layer
91
-
92
- - If the client cannot launch the server, check path, execute permission, and `.venv`
93
- - If tools return `auth required`, re-run `auth_use_token` or `auth_login`
94
- - If tools return `workspace not selected`, call `workspace_list` and `workspace_select`
95
- - If calls fail after a working session, assume token expiry and re-authenticate
96
- - If the browser shows data but MCP does not, compare `request_route` against the browser environment and check whether `qf_version` should be `canary`
97
-
98
- ## Guardrails
99
-
100
- - Never write tokens into the skill files
101
- - Never assume a workspace is selected until `auth_whoami` or `workspace_select` confirms it
102
- - When debugging, distinguish server startup issues from Qingflow auth issues
103
- - When the user mentions production, restate the exact `base_url`, `qf_version`, and workspace before any live validation
104
- - If setup is complete but the current MCP capability is still unsupported or the user's need still cannot be satisfied, summarize the gap, ask whether to submit feedback, and call `feedback_submit` only after explicit user confirmation
105
-
106
- ## Resources
107
-
108
- - Environment switching: [references/environments.md](references/environments.md)
109
- - Claude Desktop config: [references/claude-desktop.md](references/claude-desktop.md)
110
- - Generic stdio config: [references/generic-stdio.md](references/generic-stdio.md)
111
- - Local checks: [scripts/check_local_server.sh](scripts/check_local_server.sh)
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "Qingflow MCP Setup"
3
- short_description: "Install and connect the Qingflow MCP locally"
4
- default_prompt: "Use $qingflow-mcp-setup to install and connect the Qingflow MCP in a local AI client, and to verify the active base_url, qf_version, auth state, and workspace selection."
@@ -1,34 +0,0 @@
1
- # Claude Desktop
2
-
3
- Use this when the user wants to install Qingflow MCP in Claude Desktop.
4
-
5
- ## Config snippet
6
-
7
- ```json
8
- {
9
- "mcpServers": {
10
- "qingflow": {
11
- "command": "<ABSOLUTE_PATH_TO_REPO>/qingflow-support/mcp-server/qingflow-mcp",
12
- "args": [],
13
- "env": {
14
- "QINGFLOW_MCP_DEFAULT_BASE_URL": "<QINGFLOW_BASE_URL>"
15
- }
16
- }
17
- }
18
- }
19
- ```
20
-
21
- ## Environment examples
22
-
23
- - `prod` (default): set `QINGFLOW_MCP_DEFAULT_BASE_URL` to `https://qingflow.com/api`
24
- - `test`: if needed, set `QINGFLOW_MCP_DEFAULT_BASE_URL` to the explicitly provided non-production backend
25
-
26
- Keep separate snippets for `test` and `prod` so switching environments does not require editing values in-place under pressure.
27
-
28
- ## Notes
29
-
30
- - After updating the config, restart Claude Desktop
31
- - Replace `<ABSOLUTE_PATH_TO_REPO>` with the real checkout path on the current machine
32
- - If the server path changes, update the `command` field
33
- - The server is local stdio MCP, so no remote URL is required
34
- - Do not store Qingflow token in Claude Desktop config; pass it through `auth_use_token` inside the chat