@josephyan/qingflow-app-user-mcp 0.1.0-beta.10
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 +21 -0
- package/docs/local-agent-install.md +228 -0
- package/entry_point.py +13 -0
- package/npm/bin/qingflow-app-user-mcp.mjs +7 -0
- package/npm/lib/runtime.mjs +146 -0
- package/npm/scripts/postinstall.mjs +12 -0
- package/package.json +33 -0
- package/pyproject.toml +64 -0
- package/qingflow-app-user-mcp +15 -0
- package/src/qingflow_mcp/__init__.py +5 -0
- package/src/qingflow_mcp/__main__.py +5 -0
- package/src/qingflow_mcp/backend_client.py +336 -0
- package/src/qingflow_mcp/config.py +182 -0
- package/src/qingflow_mcp/errors.py +66 -0
- package/src/qingflow_mcp/json_types.py +18 -0
- package/src/qingflow_mcp/list_type_labels.py +52 -0
- package/src/qingflow_mcp/server.py +70 -0
- package/src/qingflow_mcp/server_app_builder.py +352 -0
- package/src/qingflow_mcp/server_app_user.py +334 -0
- package/src/qingflow_mcp/session_store.py +249 -0
- package/src/qingflow_mcp/solution/__init__.py +6 -0
- package/src/qingflow_mcp/solution/build_assembly_store.py +137 -0
- package/src/qingflow_mcp/solution/compiler/__init__.py +265 -0
- package/src/qingflow_mcp/solution/compiler/chart_compiler.py +96 -0
- package/src/qingflow_mcp/solution/compiler/form_compiler.py +456 -0
- package/src/qingflow_mcp/solution/compiler/icon_utils.py +113 -0
- package/src/qingflow_mcp/solution/compiler/navigation_compiler.py +57 -0
- package/src/qingflow_mcp/solution/compiler/package_compiler.py +19 -0
- package/src/qingflow_mcp/solution/compiler/portal_compiler.py +60 -0
- package/src/qingflow_mcp/solution/compiler/view_compiler.py +51 -0
- package/src/qingflow_mcp/solution/compiler/workflow_compiler.py +134 -0
- package/src/qingflow_mcp/solution/design_session.py +222 -0
- package/src/qingflow_mcp/solution/design_store.py +100 -0
- package/src/qingflow_mcp/solution/executor.py +2065 -0
- package/src/qingflow_mcp/solution/normalizer.py +23 -0
- package/src/qingflow_mcp/solution/run_store.py +221 -0
- package/src/qingflow_mcp/solution/spec_models.py +853 -0
- package/src/qingflow_mcp/tools/__init__.py +1 -0
- package/src/qingflow_mcp/tools/app_tools.py +406 -0
- package/src/qingflow_mcp/tools/approval_tools.py +498 -0
- package/src/qingflow_mcp/tools/auth_tools.py +514 -0
- package/src/qingflow_mcp/tools/base.py +81 -0
- package/src/qingflow_mcp/tools/directory_tools.py +476 -0
- package/src/qingflow_mcp/tools/file_tools.py +375 -0
- package/src/qingflow_mcp/tools/navigation_tools.py +177 -0
- package/src/qingflow_mcp/tools/package_tools.py +198 -0
- package/src/qingflow_mcp/tools/portal_tools.py +100 -0
- package/src/qingflow_mcp/tools/qingbi_report_tools.py +235 -0
- package/src/qingflow_mcp/tools/record_tools.py +4307 -0
- package/src/qingflow_mcp/tools/role_tools.py +94 -0
- package/src/qingflow_mcp/tools/solution_tools.py +2684 -0
- package/src/qingflow_mcp/tools/task_tools.py +692 -0
- package/src/qingflow_mcp/tools/view_tools.py +280 -0
- package/src/qingflow_mcp/tools/workflow_tools.py +238 -0
- package/src/qingflow_mcp/tools/workspace_tools.py +170 -0
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Qingflow App User MCP
|
|
2
|
+
|
|
3
|
+
Install:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @josephyan/qingflow-app-user-mcp@0.1.0-beta.10
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Run:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx -y -p @josephyan/qingflow-app-user-mcp@0.1.0-beta.10 qingflow-app-user-mcp
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Environment:
|
|
16
|
+
|
|
17
|
+
- `QINGFLOW_MCP_DEFAULT_BASE_URL`
|
|
18
|
+
- `QINGFLOW_MCP_DEFAULT_QF_VERSION`
|
|
19
|
+
- `QINGFLOW_MCP_HOME`
|
|
20
|
+
|
|
21
|
+
This package bootstraps a local Python runtime on first install and then starts the `qingflow-app-user-mcp` stdio MCP server.
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# 本地智能体安装
|
|
2
|
+
|
|
3
|
+
这个目录下现在只保留两个本地命令入口:
|
|
4
|
+
|
|
5
|
+
1. 记录/待办优先的 `qingflow-app-user-mcp`
|
|
6
|
+
2. 精简 builder 的 `qingflow-app-builder-mcp`
|
|
7
|
+
|
|
8
|
+
## npm 安装器适用场景
|
|
9
|
+
|
|
10
|
+
适合这类本地 agent / gateway:
|
|
11
|
+
|
|
12
|
+
- Claude Desktop
|
|
13
|
+
- Cline / Roo / Cursor 这类本地 MCP 客户端
|
|
14
|
+
- OpenClaw 风格的本地 agent 容器或本地 gateway
|
|
15
|
+
- 任何支持 `command + args + env` 的 stdio MCP 客户端
|
|
16
|
+
|
|
17
|
+
## 前置条件
|
|
18
|
+
|
|
19
|
+
- Node.js >= 16.16
|
|
20
|
+
- Python >= 3.11
|
|
21
|
+
- 安装过程中可以访问 PyPI
|
|
22
|
+
|
|
23
|
+
如果机器上没有默认 `python3` / `python`,可以先设置:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
export QINGFLOW_MCP_PYTHON=/path/to/python3.11
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 安装方式
|
|
30
|
+
|
|
31
|
+
### 方式 1:在源码目录预热运行环境
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
cd qingflow-support/mcp-server
|
|
35
|
+
npm install
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
这个模式适合你已经有源码 checkout,只想让当前目录具备本地 agent 可调用的运行时。
|
|
39
|
+
|
|
40
|
+
### 方式 2:全局安装到当前机器
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
cd qingflow-support/mcp-server
|
|
44
|
+
npm install -g .
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 方式 3:安装到某个本地 agent workspace
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm install /absolute/path/to/qingflow-support/mcp-server
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 方式 4:离线分发 tgz 安装包
|
|
54
|
+
|
|
55
|
+
先在源码目录打包:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
cd qingflow-support/mcp-server
|
|
59
|
+
npm run pack:npm
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
会生成:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
dist/npm/josephyan-qingflow-app-user-mcp-<version>.tgz
|
|
66
|
+
dist/npm/josephyan-qingflow-app-builder-mcp-<version>.tgz
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
然后在目标机器安装:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npm install /absolute/path/to/dist/npm/josephyan-qingflow-app-user-mcp-<version>.tgz
|
|
73
|
+
npm install /absolute/path/to/dist/npm/josephyan-qingflow-app-builder-mcp-<version>.tgz
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
安装时会自动:
|
|
77
|
+
|
|
78
|
+
1. 创建 `.npm-python/`
|
|
79
|
+
2. 在其中建立 Python 虚拟环境
|
|
80
|
+
3. 执行 `pip install .`
|
|
81
|
+
4. 在安装位置暴露 `qingflow-app-user-mcp`、`qingflow-app-builder-mcp` 命令
|
|
82
|
+
|
|
83
|
+
## 本地验证
|
|
84
|
+
|
|
85
|
+
如果你在源码目录执行了 `npm install`,可直接这样启动:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
cd qingflow-support/mcp-server
|
|
89
|
+
node ./npm/bin/qingflow-app-user-mcp.mjs
|
|
90
|
+
node ./npm/bin/qingflow-app-builder-mcp.mjs
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
如果你是全局安装:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
qingflow-app-user-mcp
|
|
97
|
+
qingflow-app-builder-mcp
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
如果你是把包安装到了某个本地 agent workspace,命令通常位于:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
/absolute/path/to/agent-workspace/node_modules/.bin/qingflow-app-user-mcp
|
|
104
|
+
/absolute/path/to/agent-workspace/node_modules/.bin/qingflow-app-builder-mcp
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
如果你是从 tgz 安装到某个空目录,命令通常位于:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
/absolute/path/to/install-dir/node_modules/.bin/qingflow-app-user-mcp
|
|
111
|
+
/absolute/path/to/install-dir/node_modules/.bin/qingflow-app-builder-mcp
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
这是 stdio MCP server,正常情况下不会输出欢迎信息,而是等待客户端连接。
|
|
115
|
+
|
|
116
|
+
## 客户端配置
|
|
117
|
+
|
|
118
|
+
### 通用 stdio MCP 客户端
|
|
119
|
+
|
|
120
|
+
如果你直接使用源码 checkout:
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"mcpServers": {
|
|
125
|
+
"qingflow": {
|
|
126
|
+
"command": "node",
|
|
127
|
+
"args": [
|
|
128
|
+
"/absolute/path/to/qingflow-support/mcp-server/npm/bin/qingflow-app-user-mcp.mjs"
|
|
129
|
+
],
|
|
130
|
+
"env": {
|
|
131
|
+
"QINGFLOW_MCP_DEFAULT_BASE_URL": "https://qingflow.com/api",
|
|
132
|
+
"QINGFLOW_MCP_HOME": "/absolute/path/to/.qingflow-mcp"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
如果你已经全局安装:
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
{
|
|
143
|
+
"mcpServers": {
|
|
144
|
+
"qingflow": {
|
|
145
|
+
"command": "qingflow-app-user-mcp",
|
|
146
|
+
"args": [],
|
|
147
|
+
"env": {
|
|
148
|
+
"QINGFLOW_MCP_DEFAULT_BASE_URL": "https://qingflow.com/api",
|
|
149
|
+
"QINGFLOW_MCP_HOME": "/absolute/path/to/.qingflow-mcp"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
如果你把包安装到了某个本地 agent workspace:
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"mcpServers": {
|
|
161
|
+
"qingflow": {
|
|
162
|
+
"command": "/absolute/path/to/agent-workspace/node_modules/.bin/qingflow-app-user-mcp",
|
|
163
|
+
"args": [],
|
|
164
|
+
"env": {
|
|
165
|
+
"QINGFLOW_MCP_DEFAULT_BASE_URL": "https://qingflow.com/api",
|
|
166
|
+
"QINGFLOW_MCP_HOME": "/absolute/path/to/.qingflow-mcp"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### 使用 npx
|
|
174
|
+
|
|
175
|
+
如果不做全局安装,也可以直接运行独立包:
|
|
176
|
+
|
|
177
|
+
```json
|
|
178
|
+
{
|
|
179
|
+
"mcpServers": {
|
|
180
|
+
"qingflow-user": {
|
|
181
|
+
"command": "npx",
|
|
182
|
+
"args": [
|
|
183
|
+
"-y",
|
|
184
|
+
"@josephyan/qingflow-app-user-mcp"
|
|
185
|
+
],
|
|
186
|
+
"env": {
|
|
187
|
+
"QINGFLOW_MCP_DEFAULT_BASE_URL": "https://qingflow.com/api"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"qingflow-builder": {
|
|
191
|
+
"command": "npx",
|
|
192
|
+
"args": [
|
|
193
|
+
"-y",
|
|
194
|
+
"@josephyan/qingflow-app-builder-mcp"
|
|
195
|
+
],
|
|
196
|
+
"env": {
|
|
197
|
+
"QINGFLOW_MCP_DEFAULT_BASE_URL": "https://qingflow.com/api"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
说明:
|
|
205
|
+
- 源码目录 `npm install` 不会把命令加到全局 PATH;这种模式请用 `node ./npm/bin/qingflow-app-user-mcp.mjs` 或 `node ./npm/bin/qingflow-app-builder-mcp.mjs`
|
|
206
|
+
- `npx` 方式适合临时安装或容器化本地 agent
|
|
207
|
+
- 全局安装方式更适合长期固定使用的本机开发环境
|
|
208
|
+
|
|
209
|
+
## 排障
|
|
210
|
+
|
|
211
|
+
如果安装失败,优先检查:
|
|
212
|
+
|
|
213
|
+
1. `node -v`
|
|
214
|
+
2. `python3 --version`
|
|
215
|
+
3. `pip` 是否能访问 PyPI
|
|
216
|
+
4. 是否设置了错误的 `QINGFLOW_MCP_PYTHON`
|
|
217
|
+
|
|
218
|
+
如果需要重装 Python 侧运行环境,可以删掉:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
rm -rf .npm-python
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
然后重新执行:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
npm install
|
|
228
|
+
```
|
package/entry_point.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
# Ensure the 'src' directory is in the Python search path
|
|
5
|
+
# PyInstaller will pick up everything in src/qingflow_mcp as the package
|
|
6
|
+
src_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "src"))
|
|
7
|
+
if src_path not in sys.path:
|
|
8
|
+
sys.path.insert(0, src_path)
|
|
9
|
+
|
|
10
|
+
from qingflow_mcp.server import main
|
|
11
|
+
|
|
12
|
+
if __name__ == "__main__":
|
|
13
|
+
main()
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const WINDOWS = process.platform === "win32";
|
|
7
|
+
|
|
8
|
+
function runChecked(command, args, options = {}) {
|
|
9
|
+
const result = spawnSync(command, args, {
|
|
10
|
+
stdio: "inherit",
|
|
11
|
+
...options,
|
|
12
|
+
});
|
|
13
|
+
if (result.error) {
|
|
14
|
+
throw result.error;
|
|
15
|
+
}
|
|
16
|
+
if (result.status !== 0) {
|
|
17
|
+
throw new Error(`Command failed: ${command} ${args.join(" ")}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function commandWorks(command, args) {
|
|
22
|
+
const result = spawnSync(command, args, {
|
|
23
|
+
stdio: "ignore",
|
|
24
|
+
});
|
|
25
|
+
return result.status === 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function getPackageRoot(metaUrl) {
|
|
29
|
+
return path.resolve(path.dirname(fileURLToPath(metaUrl)), "..", "..");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function getVenvDir(packageRoot) {
|
|
33
|
+
return path.join(packageRoot, ".npm-python");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function getVenvPython(packageRoot) {
|
|
37
|
+
return WINDOWS
|
|
38
|
+
? path.join(getVenvDir(packageRoot), "Scripts", "python.exe")
|
|
39
|
+
: path.join(getVenvDir(packageRoot), "bin", "python");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function getVenvServerCommand(packageRoot, commandName = "qingflow-mcp") {
|
|
43
|
+
return WINDOWS
|
|
44
|
+
? path.join(getVenvDir(packageRoot), "Scripts", `${commandName}.exe`)
|
|
45
|
+
: path.join(getVenvDir(packageRoot), "bin", commandName);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function getVenvPip(packageRoot) {
|
|
49
|
+
return WINDOWS
|
|
50
|
+
? path.join(getVenvDir(packageRoot), "Scripts", "pip.exe")
|
|
51
|
+
: path.join(getVenvDir(packageRoot), "bin", "pip");
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function findPython() {
|
|
55
|
+
const preferred = process.env.QINGFLOW_MCP_PYTHON?.trim();
|
|
56
|
+
const candidates = preferred
|
|
57
|
+
? [{ command: preferred, args: [], label: preferred }]
|
|
58
|
+
: WINDOWS
|
|
59
|
+
? [
|
|
60
|
+
{ command: "py", args: ["-3", "-V"], label: "py -3" },
|
|
61
|
+
{ command: "python", args: ["-V"], label: "python" },
|
|
62
|
+
{ command: "python3", args: ["-V"], label: "python3" },
|
|
63
|
+
]
|
|
64
|
+
: [
|
|
65
|
+
{ command: "python3", args: ["-V"], label: "python3" },
|
|
66
|
+
{ command: "python", args: ["-V"], label: "python" },
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
for (const candidate of candidates) {
|
|
70
|
+
if (commandWorks(candidate.command, candidate.args)) {
|
|
71
|
+
if (candidate.command === "py") {
|
|
72
|
+
return { command: "py", args: ["-3"], label: candidate.label };
|
|
73
|
+
}
|
|
74
|
+
return { command: candidate.command, args: [], label: candidate.label };
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
throw new Error(
|
|
79
|
+
"Python 3.11+ was not found. Set QINGFLOW_MCP_PYTHON to a Python 3 executable before running npm install."
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function ensurePythonEnv(packageRoot, { force = false, commandName = "qingflow-mcp" } = {}) {
|
|
84
|
+
const python = findPython();
|
|
85
|
+
const venvDir = getVenvDir(packageRoot);
|
|
86
|
+
const venvPython = getVenvPython(packageRoot);
|
|
87
|
+
const serverCommand = getVenvServerCommand(packageRoot, commandName);
|
|
88
|
+
const stampPath = path.join(venvDir, ".bootstrap.json");
|
|
89
|
+
|
|
90
|
+
if (!force && fs.existsSync(serverCommand) && fs.existsSync(stampPath)) {
|
|
91
|
+
return serverCommand;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (force && fs.existsSync(venvDir)) {
|
|
95
|
+
fs.rmSync(venvDir, { recursive: true, force: true });
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (!fs.existsSync(venvPython)) {
|
|
99
|
+
runChecked(python.command, [...python.args, "-m", "venv", venvDir], { cwd: packageRoot });
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const pip = getVenvPip(packageRoot);
|
|
103
|
+
runChecked(pip, ["install", "--disable-pip-version-check", "."], { cwd: packageRoot });
|
|
104
|
+
|
|
105
|
+
fs.writeFileSync(
|
|
106
|
+
stampPath,
|
|
107
|
+
JSON.stringify(
|
|
108
|
+
{
|
|
109
|
+
installed_at: new Date().toISOString(),
|
|
110
|
+
installer: "npm",
|
|
111
|
+
},
|
|
112
|
+
null,
|
|
113
|
+
2
|
|
114
|
+
)
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
if (!fs.existsSync(serverCommand)) {
|
|
118
|
+
throw new Error(`Bootstrap finished but ${serverCommand} was not created.`);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return serverCommand;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function spawnServer(packageRoot, args, commandName = "qingflow-mcp") {
|
|
125
|
+
const serverCommand = fs.existsSync(getVenvServerCommand(packageRoot, commandName))
|
|
126
|
+
? getVenvServerCommand(packageRoot, commandName)
|
|
127
|
+
: ensurePythonEnv(packageRoot, { commandName });
|
|
128
|
+
|
|
129
|
+
const child = spawn(serverCommand, args, {
|
|
130
|
+
stdio: "inherit",
|
|
131
|
+
env: process.env,
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
child.on("exit", (code, signal) => {
|
|
135
|
+
if (signal) {
|
|
136
|
+
process.kill(process.pid, signal);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
process.exit(code ?? 0);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
child.on("error", (error) => {
|
|
143
|
+
console.error(`[qingflow-mcp] Failed to start server: ${error.message}`);
|
|
144
|
+
process.exit(1);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ensurePythonEnv, getPackageRoot } from "../lib/runtime.mjs";
|
|
2
|
+
|
|
3
|
+
const packageRoot = getPackageRoot(import.meta.url);
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
console.log("[qingflow-mcp] Bootstrapping Python runtime...");
|
|
7
|
+
ensurePythonEnv(packageRoot, { commandName: "qingflow-app-user-mcp" });
|
|
8
|
+
console.log("[qingflow-mcp] Python runtime is ready.");
|
|
9
|
+
} catch (error) {
|
|
10
|
+
console.error(`[qingflow-mcp] postinstall failed: ${error.message}`);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@josephyan/qingflow-app-user-mcp",
|
|
3
|
+
"version": "0.1.0-beta.10",
|
|
4
|
+
"description": "Operational end-user MCP for Qingflow records, tasks, comments, and directory workflows.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"qingflow-app-user-mcp": "./npm/bin/qingflow-app-user-mcp.mjs"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"postinstall": "node ./npm/scripts/postinstall.mjs"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"README.md",
|
|
15
|
+
"pyproject.toml",
|
|
16
|
+
"entry_point.py",
|
|
17
|
+
"src/qingflow_mcp/**/*.py",
|
|
18
|
+
"src/qingflow_mcp/py.typed",
|
|
19
|
+
"qingflow-app-user-mcp",
|
|
20
|
+
"npm/",
|
|
21
|
+
"docs/local-agent-install.md"
|
|
22
|
+
],
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=16.16.0"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"mcp",
|
|
28
|
+
"qingflow",
|
|
29
|
+
"agent",
|
|
30
|
+
"stdio",
|
|
31
|
+
"app-user"
|
|
32
|
+
]
|
|
33
|
+
}
|
package/pyproject.toml
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=69", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "qingflow-mcp"
|
|
7
|
+
version = "0.1.0b10"
|
|
8
|
+
description = "User-authenticated MCP server for Qingflow"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Qingflow", email = "support@qingflow.com" }
|
|
14
|
+
]
|
|
15
|
+
keywords = ["mcp", "qingflow", "automation", "workflow"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
24
|
+
]
|
|
25
|
+
dependencies = [
|
|
26
|
+
"mcp>=1.9.4,<2.0.0",
|
|
27
|
+
"httpx>=0.27,<1.0",
|
|
28
|
+
"keyring>=25.5,<26.0",
|
|
29
|
+
"pydantic>=2.8,<3.0",
|
|
30
|
+
"pycryptodome>=3.20,<4.0",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
dev = [
|
|
35
|
+
"pytest>=8.3,<9.0",
|
|
36
|
+
"respx>=0.22,<1.0",
|
|
37
|
+
]
|
|
38
|
+
build = [
|
|
39
|
+
"pyinstaller>=6.0,<7.0",
|
|
40
|
+
"build>=1.0,<2.0",
|
|
41
|
+
"twine>=5.0,<6.0",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[project.scripts]
|
|
45
|
+
qingflow-app-user-mcp = "qingflow_mcp.server_app_user:main"
|
|
46
|
+
qingflow-app-builder-mcp = "qingflow_mcp.server_app_builder:main"
|
|
47
|
+
|
|
48
|
+
[project.urls]
|
|
49
|
+
Homepage = "https://github.com/qingflow/qingflow-mcp"
|
|
50
|
+
Documentation = "https://github.com/qingflow/qingflow-mcp#readme"
|
|
51
|
+
Repository = "https://github.com/qingflow/qingflow-mcp"
|
|
52
|
+
Issues = "https://github.com/qingflow/qingflow-mcp/issues"
|
|
53
|
+
|
|
54
|
+
[tool.setuptools.package-dir]
|
|
55
|
+
"" = "src"
|
|
56
|
+
|
|
57
|
+
[tool.setuptools.packages.find]
|
|
58
|
+
where = ["src"]
|
|
59
|
+
|
|
60
|
+
[tool.setuptools.package-data]
|
|
61
|
+
qingflow_mcp = ["py.typed"]
|
|
62
|
+
|
|
63
|
+
[tool.pytest.ini_options]
|
|
64
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
ROOT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
4
|
+
if [[ -n "${PYTHON_BIN:-}" ]]; then
|
|
5
|
+
PYTHON="${PYTHON_BIN}"
|
|
6
|
+
elif [[ -x "$ROOT_DIR/.venv/bin/python" ]]; then
|
|
7
|
+
PYTHON="$ROOT_DIR/.venv/bin/python"
|
|
8
|
+
elif command -v python3 >/dev/null 2>&1; then
|
|
9
|
+
PYTHON="$(command -v python3)"
|
|
10
|
+
else
|
|
11
|
+
echo "qingflow-app-user-mcp: python interpreter not found. Set PYTHON_BIN or create $ROOT_DIR/.venv" >&2
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
14
|
+
export PYTHONPATH="$ROOT_DIR/src${PYTHONPATH:+:$PYTHONPATH}"
|
|
15
|
+
exec "$PYTHON" -m qingflow_mcp.server_app_user "$@"
|