@qingflow-tech/qingflow-app-user-mcp 1.0.10 → 1.0.12

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 (89) hide show
  1. package/README.md +9 -3
  2. package/docs/local-agent-install.md +54 -3
  3. package/entry_point.py +1 -1
  4. package/npm/bin/qingflow-skills.mjs +5 -0
  5. package/npm/lib/runtime.mjs +304 -13
  6. package/npm/scripts/postinstall.mjs +1 -5
  7. package/package.json +3 -2
  8. package/pyproject.toml +1 -1
  9. package/skills/qingflow-app-builder/SKILL.md +255 -0
  10. package/skills/qingflow-app-builder/agents/openai.yaml +4 -0
  11. package/skills/qingflow-app-builder/references/create-app.md +149 -0
  12. package/skills/qingflow-app-builder/references/environments.md +63 -0
  13. package/skills/qingflow-app-builder/references/flow-actors-and-permissions.md +123 -0
  14. package/skills/qingflow-app-builder/references/gotchas.md +107 -0
  15. package/skills/qingflow-app-builder/references/match-rules.md +114 -0
  16. package/skills/qingflow-app-builder/references/public-surface-sync.md +75 -0
  17. package/skills/qingflow-app-builder/references/solution-playbooks.md +52 -0
  18. package/skills/qingflow-app-builder/references/tool-selection.md +99 -0
  19. package/skills/qingflow-app-builder/references/update-flow.md +158 -0
  20. package/skills/qingflow-app-builder/references/update-layout.md +68 -0
  21. package/skills/qingflow-app-builder/references/update-schema.md +72 -0
  22. package/skills/qingflow-app-builder/references/update-views.md +284 -0
  23. package/skills/qingflow-app-builder-code-integrations/SKILL.md +137 -0
  24. package/skills/qingflow-app-builder-code-integrations/agents/openai.yaml +4 -0
  25. package/skills/qingflow-app-builder-code-integrations/references/code-block.md +66 -0
  26. package/skills/qingflow-app-builder-code-integrations/references/q-linker.md +77 -0
  27. package/skills/qingflow-app-user/SKILL.md +12 -11
  28. package/skills/qingflow-app-user/references/data-gotchas.md +2 -2
  29. package/skills/qingflow-app-user/references/public-surface-sync.md +3 -3
  30. package/skills/qingflow-app-user/references/record-patterns.md +5 -5
  31. package/skills/qingflow-app-user/references/workflow-usage.md +4 -5
  32. package/skills/qingflow-mcp-setup/SKILL.md +113 -0
  33. package/skills/qingflow-mcp-setup/agents/openai.yaml +4 -0
  34. package/skills/qingflow-mcp-setup/references/claude-desktop.md +34 -0
  35. package/skills/qingflow-mcp-setup/references/environments.md +62 -0
  36. package/skills/qingflow-mcp-setup/references/generic-stdio.md +32 -0
  37. package/skills/qingflow-mcp-setup/scripts/check_local_server.sh +38 -0
  38. package/skills/qingflow-record-analysis/SKILL.md +6 -7
  39. package/skills/qingflow-record-analysis/manifest.yaml +10 -0
  40. package/skills/qingflow-record-delete/SKILL.md +5 -3
  41. package/skills/qingflow-record-import/SKILL.md +6 -2
  42. package/skills/qingflow-record-insert/SKILL.md +48 -4
  43. package/skills/qingflow-record-insert/manifest.yaml +6 -0
  44. package/skills/qingflow-record-update/SKILL.md +36 -24
  45. package/skills/qingflow-task-ops/SKILL.md +25 -25
  46. package/skills/qingflow-task-ops/references/environments.md +0 -1
  47. package/skills/qingflow-task-ops/references/workflow-usage.md +4 -6
  48. package/src/qingflow_mcp/__main__.py +6 -2
  49. package/src/qingflow_mcp/builder_facade/models.py +41 -2
  50. package/src/qingflow_mcp/builder_facade/service.py +2743 -423
  51. package/src/qingflow_mcp/cli/commands/app.py +3 -16
  52. package/src/qingflow_mcp/cli/commands/builder.py +30 -4
  53. package/src/qingflow_mcp/cli/commands/exports.py +2 -2
  54. package/src/qingflow_mcp/cli/commands/imports.py +1 -1
  55. package/src/qingflow_mcp/cli/commands/record.py +54 -11
  56. package/src/qingflow_mcp/cli/context.py +0 -3
  57. package/src/qingflow_mcp/cli/formatters.py +238 -8
  58. package/src/qingflow_mcp/cli/main.py +47 -3
  59. package/src/qingflow_mcp/errors.py +43 -2
  60. package/src/qingflow_mcp/public_surface.py +24 -16
  61. package/src/qingflow_mcp/response_trim.py +119 -12
  62. package/src/qingflow_mcp/server.py +17 -14
  63. package/src/qingflow_mcp/server_app_builder.py +29 -7
  64. package/src/qingflow_mcp/server_app_user.py +23 -24
  65. package/src/qingflow_mcp/solution/compiler/icon_utils.py +294 -0
  66. package/src/qingflow_mcp/solution/executor.py +112 -15
  67. package/src/qingflow_mcp/tools/ai_builder_tools.py +497 -65
  68. package/src/qingflow_mcp/tools/app_tools.py +237 -51
  69. package/src/qingflow_mcp/tools/approval_tools.py +196 -34
  70. package/src/qingflow_mcp/tools/auth_tools.py +92 -16
  71. package/src/qingflow_mcp/tools/code_block_tools.py +296 -39
  72. package/src/qingflow_mcp/tools/custom_button_tools.py +64 -10
  73. package/src/qingflow_mcp/tools/directory_tools.py +236 -72
  74. package/src/qingflow_mcp/tools/export_tools.py +230 -33
  75. package/src/qingflow_mcp/tools/file_tools.py +7 -3
  76. package/src/qingflow_mcp/tools/import_tools.py +293 -40
  77. package/src/qingflow_mcp/tools/navigation_tools.py +91 -12
  78. package/src/qingflow_mcp/tools/package_tools.py +134 -8
  79. package/src/qingflow_mcp/tools/portal_tools.py +39 -3
  80. package/src/qingflow_mcp/tools/qingbi_report_tools.py +116 -7
  81. package/src/qingflow_mcp/tools/record_tools.py +2305 -442
  82. package/src/qingflow_mcp/tools/resource_read_tools.py +191 -39
  83. package/src/qingflow_mcp/tools/role_tools.py +80 -9
  84. package/src/qingflow_mcp/tools/solution_tools.py +57 -15
  85. package/src/qingflow_mcp/tools/task_context_tools.py +569 -119
  86. package/src/qingflow_mcp/tools/task_tools.py +113 -29
  87. package/src/qingflow_mcp/tools/view_tools.py +106 -3
  88. package/src/qingflow_mcp/tools/workflow_tools.py +17 -1
  89. package/src/qingflow_mcp/tools/workspace_tools.py +71 -3
@@ -0,0 +1,77 @@
1
+ # Q-Linker Builder Notes
2
+
3
+ ## What Builder Should Configure
4
+
5
+ - `remoteLookupConfig`
6
+ - alias parsing
7
+ - target field binding
8
+ - auto trigger
9
+ - custom button text
10
+
11
+ ## Current Supported Scope
12
+
13
+ - custom mode only
14
+ - standard request fields
15
+ - alias path parsing
16
+ - target field binding to existing ordinary fields
17
+
18
+ ## Recommended Public APIs For Samples
19
+
20
+ ### Httpbin
21
+
22
+ - URL: `https://httpbin.org/get`
23
+ - Good for:
24
+ - query echo
25
+ - request URL echo
26
+
27
+ Useful paths:
28
+ - `$.args.keyword`
29
+ - `$.url`
30
+
31
+ ### Open-Meteo Geocoding
32
+
33
+ - URL: `https://geocoding-api.open-meteo.com/v1/search`
34
+ - Good for:
35
+ - place normalization
36
+ - country
37
+ - lat/lng summary
38
+
39
+ Useful paths:
40
+ - `$.results[0].name`
41
+ - `$.results[0].country`
42
+ - `$.results[0].latitude`
43
+ - `$.results[0].longitude`
44
+
45
+ ## Target Field Rules
46
+
47
+ Required:
48
+ - every `outputs[*].target_field` must point to an existing field
49
+
50
+ Prefer:
51
+ - text
52
+ - long text
53
+ - number
54
+ - amount
55
+ - date
56
+ - datetime
57
+ - single select
58
+ - multi select
59
+ - boolean
60
+
61
+ Avoid:
62
+ - q_linker
63
+ - code_block
64
+ - relation
65
+ - subtable
66
+ - attachment
67
+ - member
68
+ - department
69
+ - address
70
+
71
+ ## Safe Verification
72
+
73
+ - `app_get_fields`
74
+ - `record_insert_schema_get`
75
+ - `record_insert`
76
+
77
+ This verifies that the configuration does not break the form page, even before runtime execution is tested.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: qingflow-app-user
3
- description: Route Qingflow end-user requests to the right specialized operational skill after the MCP is already connected and authenticated. Use when the task is operational but it is not yet clear whether it is record CRUD or final analysis.
3
+ description: Route Qingflow end-user requests to the right specialized operational skill using the current Wingent Momo runtime MCP session. Use when the task is operational but it is not yet clear whether it is record CRUD or final analysis.
4
4
  metadata:
5
5
  short-description: Router for Qingflow operational skills
6
6
  ---
@@ -10,32 +10,32 @@ metadata:
10
10
  ## Overview
11
11
 
12
12
  This skill is a lightweight router for operational Qingflow work.
13
- Assumes MCP is connected, authenticated, and on the correct workspace.
13
+ In Wingent Momo runtime, trust injected MCP credentials, workspace, and route context until a business tool explicitly reports otherwise.
14
14
  Before routing, skim the shared maintenance baseline: [public-surface-sync.md](references/public-surface-sync.md).
15
15
 
16
16
  ## Default Paths
17
17
 
18
18
  Route to exactly one of these specialized paths:
19
19
 
20
- 1. Record insert
20
+ 1. Record insert
21
21
  Switch to [$qingflow-record-insert](../qingflow-record-insert/SKILL.md)
22
22
 
23
- 2. Record update
23
+ 2. Record update
24
24
  Switch to [$qingflow-record-update](../qingflow-record-update/SKILL.md)
25
25
 
26
- 3. Record delete
26
+ 3. Record delete
27
27
  Switch to [$qingflow-record-delete](../qingflow-record-delete/SKILL.md)
28
28
 
29
- 4. Record import
29
+ 4. Record import
30
30
  Switch to [$qingflow-record-import](../qingflow-record-import/SKILL.md)
31
31
 
32
- 5. Task workflow operations
32
+ 5. Task workflow operations
33
33
  Switch to [$qingflow-task-ops](../qingflow-task-ops/SKILL.md)
34
34
 
35
- 6. Analysis
35
+ 6. Analysis
36
36
  Switch to [$qingflow-record-analysis](../qingflow-record-analysis/SKILL.md)
37
37
 
38
- 7. MCP connection / auth / workspace selection
38
+ 7. Standalone MCP setup or explicit auth/workspace recovery
39
39
  Switch to [$qingflow-mcp-setup](../qingflow-mcp-setup/SKILL.md)
40
40
 
41
41
  8. App / view / workflow / chart / portal / package configuration
@@ -43,7 +43,7 @@ Route to exactly one of these specialized paths:
43
43
 
44
44
  ## Routing Rules
45
45
 
46
- - If the user does not know the target `app_key`, discover apps first with `app_list` or `app_search`, then route to the specialized skill
46
+ - If the user does not know the target `app_key`, discover apps first with `app_list` / `app list --query` over current-user visible apps, then route to the specialized skill; do not use the legacy app search path for ordinary members
47
47
  - If the app is known but the available data range is unclear, call `app_get` first and inspect `accessible_views`
48
48
  - If the task is about creating or new record entry, switch to `$qingflow-record-insert`
49
49
  - If the task is about editing an existing record directly, switch to `$qingflow-record-update`
@@ -52,13 +52,14 @@ Route to exactly one of these specialized paths:
52
52
  - If the task is about todo discovery, task context, approval actions, rollback or transfer, associated report review, or workflow log review, switch to `$qingflow-task-ops`
53
53
  - If the task is about package, app, field, layout, workflow, view, chart, portal, visibility, icon, or app base configuration, switch to `$qingflow-app-builder`
54
54
  - If the task involves member, department, or relation fields and the user only has natural names/titles, keep the same route; direct write now supports backend-native auto resolution and may return `needs_confirmation` with candidates instead of failing blind
55
+ - For member/department field ambiguity, keep the record insert/update route and use `record_member_candidates` / `record_department_candidates`; do not switch to `directory_*`, builder member search, external-contact lookup, or contact-directory management queries. App User MCP only exposes `directory_search` for member-visible keyword search, not directory tree/list management.
55
56
  - If the task involves linked visibility, upstream/downstream field dependencies, reference-driven auto fill, or formula-driven defaulting, keep the same insert/update route and read field-level `linkage` from the schema before composing payloads
56
57
  - If the task is about subtable writes, still route to the matching insert/update skill, but shape the payload as parent subtable field -> row array; do not route users toward top-level leaf selectors
57
58
  - If the task is insert-focused and readback/detail context matters, keep the same route and prefer the single-record detail readback after the write; use normalized list readback only when batch row shape is needed
58
59
  - If the user sounds like an ordinary workflow assignee rather than a system operator, prefer `$qingflow-task-ops` over direct record mutation whenever both paths could fit
59
60
  - If the task is about task discovery by natural language query, still route to `$qingflow-task-ops`; `task_list --query` now uses backend search first and only falls back to local matching when backend returns zero rows
60
61
  - If the task is about grouped distributions, ratios, rankings, trends, insights, or any final statistical conclusion, switch to `$qingflow-record-analysis`
61
- - If the MCP is not connected, authenticated, or bound to the right workspace, switch to `$qingflow-mcp-setup`
62
+ - In Wingent Momo runtime, do not route to `$qingflow-mcp-setup` as a preflight. Switch there only when a business tool explicitly reports missing auth, invalid session, or wrong/missing workspace, or when the user asks to configure a standalone MCP client.
62
63
 
63
64
  ## Shared Preconditions
64
65
 
@@ -9,12 +9,12 @@ For final statistics, grouped distributions, rankings, trends, or insight-style
9
9
  - `record_get` is for one exact record and downloads readable detail-page images into `media_assets.items[].local_path` plus attachments/documents/tables into `file_assets.items[].local_path`
10
10
  - Use `record_browse_schema_get` when field titles are uncertain instead of guessing ids
11
11
  - Do not present paged browse output as if it were a grouped or full-population conclusion
12
- - Use `record_export_direct` only when the user explicitly asks for export/download/Excel output
12
+ - Use `record_export_direct` only when the user explicitly asks for export/download/Excel output, and always pass an explicit `view_id` from `app_get.accessible_views` or the frontend URL
13
13
 
14
14
  ## Direct Writes
15
15
 
16
16
  - `record_insert` is schema-first through `record_insert_schema_get`; default to `items=[{"fields": {...}}]`
17
- - `record_update` is schema-first through `record_update_schema_get`
17
+ - `record_update` is detail-first: read `record_get`, compose the requested title-keyed `fields` map, then write directly; use `record_update_schema_get` only after update failure or ambiguity
18
18
  - `record_delete` does not need a schema-get step
19
19
  - For batch insert, `partial_success` means some rows were created; use `created_record_ids`, failed `row_number`, and `failed_fields` to repair only failed rows
20
20
  - If a direct-write tool returns `write_executed=false`, the write was blocked and not executed for that item
@@ -1,6 +1,6 @@
1
1
  # Qingflow Core Public Surface Sync
2
2
 
3
- Use this file as the maintenance baseline for the core Qingflow skills.
3
+ Use this file as the maintenance baseline for the core Qingflow skills.
4
4
  It is not a user-facing product spec. It exists to prevent skill drift.
5
5
 
6
6
  ## Current Public Defaults
@@ -12,9 +12,9 @@ It is not a user-facing product spec. It exists to prevent skill drift.
12
12
  - Standard flows:
13
13
  - analyze: `app_get -> record_browse_schema_get -> record_access -> Python`
14
14
  - browse detail: `app_get -> record_browse_schema_get -> record_list / record_get`
15
- - explicit export/download/Excel: `view_get -> record_export_*` or `record_export_direct`
15
+ - explicit export/download/Excel: `app_get -> choose view_id -> view_get -> record_export_*` or `record_export_direct`; export tools require explicit `view_id`
16
16
  - insert: `record_insert_schema_get -> record_insert(items)`
17
- - update: `record_update_schema_get -> record_update`
17
+ - update: `record_get -> record_update`; use `record_update_schema_get` only for failure diagnosis or ambiguous writable-field routing
18
18
 
19
19
  ### Tasks
20
20
 
@@ -41,13 +41,13 @@ Use `record_insert_schema_get -> record_insert(items)`.
41
41
 
42
42
  ## Update Pattern
43
43
 
44
- Use `record_update_schema_get -> record_update`.
44
+ Use `record_get -> record_update`.
45
45
 
46
46
  1. Confirm the target app and `record_id`
47
- 2. Read `writable_fields` and `payload_template`
48
- 3. Update only fields present in `writable_fields`
49
- 4. Let MCP auto-select the first matched accessible view that can execute the payload
50
- 5. Run `record_update`
47
+ 2. Read `record_get` in the same view/context the user is using when a `view_id` is known
48
+ 3. Build a field-title keyed `fields` map from `record_get.fields[]` and the user's requested changes
49
+ 4. Run `record_update` directly; let MCP auto-select the executable update route
50
+ 5. If `record_update` fails because fields/routes are ambiguous or unavailable, then use `record_update_schema_get` as a diagnostic tool
51
51
 
52
52
  ## Delete Pattern
53
53
 
@@ -14,13 +14,12 @@ Examples:
14
14
 
15
15
  Rules:
16
16
 
17
- - if the user starts from inbox, todo, workload, cc, or bottleneck language, use `task_*` first
18
- - use `task_summary` for headline counts
19
- - use `task_list` for flat browsing
20
- - use `task_facets` when worksheet or workflow-node buckets matter
17
+ - if the user starts from inbox, todo, workload, cc, or bottleneck language, use the public task tools first
18
+ - use `task_list` for headline counts and flat browsing; group locally by app or workflow node when buckets matter
19
+ - use `task_get`, `task_workflow_log_get`, and `task_associated_report_detail_get` only after locating the exact task
21
20
  - treat task counts as task-center counts, not record counts
22
21
  - switch to `record_*` only after locating the exact business record behind a task
23
22
  - identify the exact target first
24
- - for approve or reject, identify the exact `workflow_node_id` first; prefer task-center results or current audit info, then use `task_approve` or `task_reject`
23
+ - for approve or reject, identify the exact target first; prefer `task_id` from task-center results, then use `task_action_execute` with action `approve` or `reject`
25
24
  - avoid usage-side workflow actions on ambiguous records
26
25
  - summarize the final action and target task ids or record ids
@@ -0,0 +1,113 @@
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: Use injected session first; authenticate only for setup or recovery
77
+
78
+ For Wingent Momo runtime conversations, the session normally already carries the credential-derived token, workspace, and route context. Do not run `auth_use_credential`, `auth_login`, `workspace_list`, or `workspace_select` before ordinary business tools. Start with the smallest read-only business call that fits the task; if it succeeds, continue.
79
+
80
+ For a standalone local MCP client that has no injected session, use this setup order:
81
+
82
+ 1. `auth_use_credential` or `auth_login`
83
+ 2. `workspace_list`
84
+ 3. `workspace_select`
85
+ 4. Run a small read-only business tool
86
+
87
+ `auth_use_credential` gets the selected workspace from the credential context. If the user needs a different workspace after authentication, use `workspace_list` and then `workspace_select`.
88
+ 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.
89
+ `auth_use_credential` is a tool call, not a custom HTTP header. It exchanges the createClaw credential for a Qingflow token, `wsId`, and when needed `Cookie: qfVersion=...` after the session is established.
90
+ Do not run `workspace_select` on production paths unless the user explicitly asks to switch workspace or a business tool clearly reports that no workspace is selected. If `/user` does not return a version lane, the session now falls back to the workspace `systemVersion`.
91
+
92
+ ### Step 6: Troubleshoot in the right layer
93
+
94
+ - If the client cannot launch the server, check path, execute permission, and `.venv`
95
+ - If tools return `auth required`, re-run `auth_use_credential` or `auth_login`
96
+ - If tools return `workspace not selected`, call `workspace_list` and `workspace_select`
97
+ - If calls fail after a working session, assume token expiry and re-authenticate
98
+ - If the browser shows data but MCP does not, compare `request_route` against the browser environment and check whether `qf_version` should be `canary`
99
+
100
+ ## Guardrails
101
+
102
+ - Never write tokens into the skill files
103
+ - In Wingent Momo runtime, trust injected workspace context until a business tool proves otherwise; for standalone clients, confirm workspace with `auth_whoami`, `workspace_select`, or a successful read-only business call.
104
+ - When debugging, distinguish server startup issues from Qingflow auth issues
105
+ - When the user mentions production, restate the exact `base_url`, `qf_version`, and workspace before any live validation
106
+ - 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
107
+
108
+ ## Resources
109
+
110
+ - Environment switching: [references/environments.md](references/environments.md)
111
+ - Claude Desktop config: [references/claude-desktop.md](references/claude-desktop.md)
112
+ - Generic stdio config: [references/generic-stdio.md](references/generic-stdio.md)
113
+ - Local checks: [scripts/check_local_server.sh](scripts/check_local_server.sh)
@@ -0,0 +1,4 @@
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."
@@ -0,0 +1,34 @@
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 credentials in Claude Desktop config; pass the createClaw credential through `auth_use_credential` inside the chat, or use `auth_login` when credential exchange is unavailable
@@ -0,0 +1,62 @@
1
+ # Environment Switching
2
+
3
+ Use this reference before any setup, authentication, or live validation flow.
4
+
5
+ ## Step 1: Resolve the active environment
6
+
7
+ Decide explicitly whether the user is targeting:
8
+
9
+ - `test`: for smoke tests, trial setup, DSL validation, mock data, and integration debugging
10
+ - `prod`: for real business usage in the formal environment
11
+
12
+ If the user did not specify an environment, default to `prod`.
13
+
14
+ ## Test Environment
15
+
16
+ Default characteristics:
17
+
18
+ - preferred for first-time setup and local MCP validation
19
+ - mock or smoke data is acceptable when the user asks for it
20
+ - use read/write verification freely inside the intended test workspace
21
+
22
+ Known values in the current workspace:
23
+
24
+ - use an explicitly provided non-production backend
25
+ - common test workspace example: `ws_id=2`
26
+ - `qf_version`: usually unset unless the user explicitly needs a routed version
27
+
28
+ Setup behavior:
29
+
30
+ - prefer this environment for Claude Desktop or local MCP client onboarding
31
+ - for Wingent Momo runtime, use the injected session and skip auth/workspace preflight
32
+ - for standalone MCP client setup, use `auth_use_credential` or `auth_login`, then `workspace_list`, then `workspace_select`
33
+ - if the user asks to verify installation, a real read-only smoke path is acceptable
34
+
35
+ ## Production Environment
36
+
37
+ Production is the default environment when the user does not specify one. If the user explicitly says `test`, switch to the dedicated non-production backend they provide.
38
+
39
+ Expected behavior:
40
+
41
+ - default `base_url`: `https://qingflow.com/api`
42
+ - confirm the production `qf_version` explicitly when browser traffic depends on routed versions such as `canary`
43
+ - confirm the exact workspace before any live validation
44
+ - prefer read-only checks first
45
+ - avoid mock data, smoke writes, or destructive tests unless the user explicitly asks for them
46
+
47
+ Production guardrails:
48
+
49
+ - do not store credentials in skill files or examples
50
+ - do not assume the same workspace ids as test
51
+ - treat startup verification and auth verification as separate steps
52
+ - when sharing snippets, label them as `prod` and `test` clearly
53
+ - when MCP and browser results diverge, compare `request_route` with the browser route before blaming the query logic
54
+
55
+ ## Reporting Rule
56
+
57
+ When you give setup instructions, always state:
58
+
59
+ - active environment
60
+ - selected `base_url`
61
+ - selected `qf_version` when relevant
62
+ - whether the next step is read-only or write-impacting
@@ -0,0 +1,32 @@
1
+ # Generic Stdio MCP Clients
2
+
3
+ Use this for any local AI client that supports MCP over stdio.
4
+
5
+ ## Required mapping
6
+
7
+ - `command`: `<ABSOLUTE_PATH_TO_REPO>/qingflow-support/mcp-server/qingflow-mcp`
8
+ - `args`: `[]`
9
+ - `env.QINGFLOW_MCP_DEFAULT_BASE_URL`: backend base URL for the active environment
10
+
11
+ Environment examples:
12
+
13
+ - `prod` (default): `https://qingflow.com/api`
14
+ - `test`: use the explicitly provided non-production backend
15
+
16
+ Keep separate client entries or separate config snippets for `test` and `prod`.
17
+
18
+ ## Validation sequence
19
+
20
+ 1. Start the client
21
+ 2. Confirm the `qingflow` MCP server is visible
22
+ 3. In Wingent Momo runtime, skip auth/workspace preflight and run a read-only tool such as `app_list`
23
+ 4. In a standalone client without injected credentials, run `auth_use_credential` or `auth_login`
24
+ 5. Then run `workspace_list`
25
+ 6. Then run `workspace_select`
26
+ 7. Run a read-only tool such as `app_list`
27
+
28
+ ## Common failures
29
+
30
+ - Launch failure: bad `command` path or missing `.venv`
31
+ - Auth failure: invalid or expired credential/token
32
+ - Business tool failure before setup: workspace not selected
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
5
+ ROOT="${QINGFLOW_MCP_ROOT:-}"
6
+
7
+ if [[ -z "$ROOT" ]]; then
8
+ if git_root="$(git rev-parse --show-toplevel 2>/dev/null)" && [[ -d "$git_root/qingflow-support/mcp-server" ]]; then
9
+ ROOT="$git_root/qingflow-support/mcp-server"
10
+ elif [[ -d "$PWD/qingflow-support/mcp-server" ]]; then
11
+ ROOT="$PWD/qingflow-support/mcp-server"
12
+ else
13
+ repo_root="$(cd "$SCRIPT_DIR/../../../.." && pwd)"
14
+ if [[ -d "$repo_root/qingflow-support/mcp-server" ]]; then
15
+ ROOT="$repo_root/qingflow-support/mcp-server"
16
+ fi
17
+ fi
18
+ fi
19
+
20
+ if [[ -z "$ROOT" ]]; then
21
+ echo "Unable to locate qingflow-support/mcp-server. Set QINGFLOW_MCP_ROOT to the repo copy of the MCP server." >&2
22
+ exit 1
23
+ fi
24
+
25
+ ENTRY="$ROOT/qingflow-mcp"
26
+ PY="$ROOT/.venv/bin/python"
27
+
28
+ echo "ROOT=$ROOT"
29
+ test -d "$ROOT"
30
+ echo "OK root exists"
31
+
32
+ test -x "$ENTRY"
33
+ echo "OK entrypoint exists and is executable"
34
+
35
+ test -x "$PY"
36
+ echo "OK virtualenv python exists"
37
+
38
+ PYTHONPATH="$ROOT/src" "$PY" -c "import qingflow_mcp.server; print('OK import qingflow_mcp.server')"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: qingflow-record-analysis
3
- description: Analyze Qingflow record data safely after the MCP is already connected and authenticated. Use when the user wants grouped distributions, ratios, averages, rankings, trends, insights, comparisons, or any final statistical conclusion across an existing app's data. Default to schema-first record_access CSV retrieval plus local Python/pandas; do not use export tools unless the user explicitly asks for a file download.
3
+ description: Analyze Qingflow record data safely. Use when the user wants grouped distributions, ratios, averages, rankings, trends, insights, comparisons, or any final statistical conclusion across an existing app's data. Default to schema-first record_access CSV retrieval plus local Python/pandas; do not use export tools unless the user explicitly asks for a file download.
4
4
  metadata:
5
5
  short-description: Analyze Qingflow record data with record_access CSV and Python
6
6
  ---
@@ -20,7 +20,7 @@ app_get -> record_browse_schema_get(view_id=...) -> record_access -> Python/pand
20
20
  ```bash
21
21
  qingflow record --help
22
22
  qingflow record access --help
23
- qingflow record access --app-key APP_KEY --view-id VIEW_ID --columns-file columns.json --where-file where.json --order-by-file order_by.json --json
23
+ qingflow --json record access --app-key APP_KEY --view-id VIEW_ID --columns-file columns.json --where-file where.json --order-by-file order_by.json
24
24
  ```
25
25
 
26
26
  The CLI command is under the `record` command group, so the discovery path is: first inspect `qingflow record --help`, then inspect `qingflow record access --help`.
@@ -40,7 +40,7 @@ The CLI command is under the `record` command group, so the discovery path is: f
40
40
  - `record_list` is only for sample inspection after the aggregate result is understood.
41
41
  - `record_get` is only for single-record detail verification, logs, references, images, or readable attachments. Read images from `media_assets.items[].local_path`; read documents/tables from `file_assets.items[].local_path` and `extraction.text_path`.
42
42
  - `record_export_direct` is only for explicit export/download/Excel requests.
43
- - `chart_get` / QingBI is only for user-provided report URLs or chart ids.
43
+ - `chart_get` / QingBI is only for user-provided report URLs or chart ids. If it reports `CHART_BASE_INFO_UNAVAILABLE` but `chart_data_loaded=true`, treat the chart data as readable and only the metadata/base info as degraded.
44
44
 
45
45
  ## Tool Selection
46
46
 
@@ -49,7 +49,7 @@ The CLI command is under the `record` command group, so the discovery path is: f
49
49
  | Batch analysis, statistics, comparison, report | `record_access -> Python` |
50
50
  | Browse a few example rows | `record_list` |
51
51
  | Inspect one record, logs, references, images, attachments | `record_get` |
52
- | User asks to export/download/Excel | `record_export_direct` |
52
+ | User asks to export/download/Excel | `record_export_direct` with explicit `view_id` |
53
53
  | User gives report URL or chart id | `chart_get` |
54
54
  | Todo/workflow task actions | `$qingflow-task-ops` |
55
55
 
@@ -84,13 +84,12 @@ CSV columns are already readable and field-id anchored, for example `项目状
84
84
  For CLI use, write JSON argument files instead of embedding large JSON in shell text:
85
85
 
86
86
  ```bash
87
- qingflow record access \
87
+ qingflow --json record access \
88
88
  --app-key APP_KEY \
89
89
  --view-id system:all \
90
90
  --columns-file columns.json \
91
91
  --where-file where.json \
92
- --order-by-file order_by.json \
93
- --json
92
+ --order-by-file order_by.json
94
93
  ```
95
94
 
96
95
  ## Status Handling
@@ -0,0 +1,10 @@
1
+ identity: qingflow-record-analysis
2
+ type: skill
3
+ description: Analyze Qingflow record data safely. Use when the user wants grouped distributions, ratios, averages, rankings, trends, insights, comparisons, or any final statistical conclusion across an existing app's data. Default to schema-first record_access CSV retrieval plus local Python/pandas; do not use export tools unless the user explicitly asks for a file download.
4
+ tags:
5
+ - cli
6
+ - qingflow
7
+ - task-management
8
+ - data-analysis
9
+ - security
10
+ - validated
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: qingflow-record-delete
3
- description: Delete Qingflow records safely after the MCP is already connected and authenticated.
3
+ description: Delete Qingflow records safely using the current Wingent Momo runtime MCP session; recover auth/workspace only after a tool error.
4
4
  metadata:
5
5
  short-description: Qingflow record delete
6
6
  ---
@@ -21,9 +21,11 @@ metadata:
21
21
 
22
22
  1. Resolve the exact target `record_id` first
23
23
  2. Prefer reading the current state before delete when the request is high risk
24
- 3. Call `record_delete` with `record_id` or `record_ids`
24
+ 3. Choose an accessible system `view_id` from `app_get.accessible_views`; custom views can locate records but cannot be used as the delete route
25
+ 4. Call `record_delete` with `record_id` or `record_ids` and the system `view_id` so the backend uses the matching listType delete route
25
26
 
26
27
  ## Do Not
27
28
 
28
- - Do not pass any `view_*` selector
29
+ - Do not pass `custom:*` view selectors to `record_delete`; custom views can locate records, but delete currently supports only system listType routes
30
+ - Do not omit `view_id`; a delete without frontend list context is ambiguous and should return `RECORD_DELETE_VIEW_REQUIRED`
29
31
  - Do not infer the target record id from a vague title if `record_list` can disambiguate it
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: qingflow-record-import
3
- description: Explain and operate Qingflow file-based bulk import after the MCP is already connected and authenticated.
3
+ description: Explain and operate Qingflow file-based bulk import using the current Wingent Momo runtime MCP session; recover auth/workspace only after a tool error.
4
4
  metadata:
5
5
  short-description: Qingflow bulk import workflow and troubleshooting
6
6
  ---
@@ -28,4 +28,8 @@ metadata:
28
28
  3. Keep official headers unchanged
29
29
  4. Verify before start
30
30
  5. Only repair a file after explicit user authorization
31
- 6. Read back one imported sample after success
31
+ 6. After success, report the import status and tracking identifiers; read back one imported sample only when the user asks for row-level confirmation or when the import result does not already prove completion
32
+
33
+ ## Template Fallback
34
+
35
+ `record_import_template_get` may return `status: partial_success` with a locally generated applicant template when the official template endpoint is permission-restricted but applicant fields are readable. If the warning is `IMPORT_TEMPLATE_LOCAL_FALLBACK_AUTH_UNKNOWN` or `verification.import_auth_prechecked` is false, treat the result only as "template file prepared"; actual import permission is still decided by `record_import_verify` and `record_import_start`.