rush-ai 0.11.2 → 0.12.1

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 CHANGED
@@ -224,6 +224,10 @@ rush-ai mcp install octopus-cli-mcp --target claude-desktop
224
224
  # 跳过交互 + JSON 输出
225
225
  rush-ai mcp install octopus-cli-mcp -y --json
226
226
 
227
+ # 传入凭证(适合需要 token 的 MCP,两种写法等价)
228
+ rush-ai mcp install bigdata-mcp-server --set refresh_token=xxx groups=basic
229
+ rush-ai mcp install bigdata-mcp-server --set refresh_token=xxx --set groups=basic
230
+
227
231
  # 安装未验证的 MCP(需明确确认)
228
232
  rush-ai mcp install some-mcp --allow-unverified
229
233
 
@@ -233,6 +237,25 @@ rush-ai mcp uninstall octopus-cli-mcp
233
237
 
234
238
  stdio MCP 写入 `claude_desktop_config.json`;http/sse MCP 写入 `configLibrary`(managed server,工具自动 allow)。安装后需重启 IDE 生效。
235
239
 
240
+ #### Node runtime / 非交互式调用
241
+
242
+ 在 Node.js 脚本或 CI 中调用时,用 `-y` 跳过交互,`--set` 传入凭证,`--json` 获取结构化输出:
243
+
244
+ ```javascript
245
+ const { execSync } = require('child_process');
246
+ const result = JSON.parse(
247
+ execSync(
248
+ 'rush-ai mcp install bigdata-mcp-server -y --set refresh_token=xxx groups=basic --target claude-desktop --json'
249
+ ).toString()
250
+ );
251
+
252
+ if (result.targets[0].status === 'ok') {
253
+ console.log('Installed to:', result.targets[0].configPath);
254
+ }
255
+ ```
256
+
257
+ 未验证的 MCP 在非交互模式下需要加 `--allow-unverified`,否则会报错退出。
258
+
236
259
  ### CI / 脚本
237
260
 
238
261
  ```bash
package/dist/index.js CHANGED
@@ -3915,15 +3915,39 @@ function registerMcpCommand(program) {
3915
3915
  ).option("-y, --yes", "Skip confirmation prompts (use defaults)").option(
3916
3916
  "--target <targets>",
3917
3917
  "Comma-separated targets: claude-desktop,claude-code (default: both)"
3918
- ).option("--allow-unverified", "Allow installing unverified MCP servers").action(async (mcpId, opts) => {
3918
+ ).option("--allow-unverified", "Allow installing unverified MCP servers").option(
3919
+ "--set <key=value...>",
3920
+ "Set credential values (e.g. --set TOKEN=xxx KEY=yyy)"
3921
+ ).action(async (mcpId, opts) => {
3919
3922
  const format = resolveFormat(program.opts());
3920
- const { runMcpInstall, printMcpInstallSummary } = await import("./install-DNSVANLM.js");
3923
+ const { runMcpInstall, printMcpInstallSummary } = await import("./install-AGHG4XKQ.js");
3924
+ let setValues;
3925
+ if (opts.set) {
3926
+ setValues = {};
3927
+ const raw = Array.isArray(opts.set) ? opts.set : [opts.set];
3928
+ for (const rawItem of raw) {
3929
+ const item = String(rawItem);
3930
+ const eqIdx = item.indexOf("=");
3931
+ if (eqIdx === -1) {
3932
+ const msg = `Invalid --set format: "${item}". Use --set KEY=VALUE`;
3933
+ if (format === "json") {
3934
+ output.log(JSON.stringify({ error: msg }, null, 2));
3935
+ } else {
3936
+ output.error(msg);
3937
+ }
3938
+ process.exitCode = 1;
3939
+ return;
3940
+ }
3941
+ setValues[item.slice(0, eqIdx)] = item.slice(eqIdx + 1);
3942
+ }
3943
+ }
3921
3944
  try {
3922
3945
  const result = await runMcpInstall({
3923
3946
  mcpId,
3924
3947
  yes: opts.yes,
3925
3948
  targetRaw: opts.target,
3926
- allowUnverified: opts.allowUnverified
3949
+ allowUnverified: opts.allowUnverified,
3950
+ setValues
3927
3951
  });
3928
3952
  const anyOk = result.targets.some((t) => t.status === "ok");
3929
3953
  const anyError = result.targets.some((t) => t.status === "error");
@@ -3957,7 +3981,7 @@ function registerMcpCommand(program) {
3957
3981
  "Comma-separated targets: claude-desktop,claude-code (default: both)"
3958
3982
  ).action(async (mcpId, opts) => {
3959
3983
  const format = resolveFormat(program.opts());
3960
- const { runMcpUninstall, printMcpUninstallSummary } = await import("./install-DNSVANLM.js");
3984
+ const { runMcpUninstall, printMcpUninstallSummary } = await import("./install-AGHG4XKQ.js");
3961
3985
  try {
3962
3986
  const result = await runMcpUninstall({
3963
3987
  mcpId,