@muqian/xiangsu-mcp-plus 0.10.0 → 0.10.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # 更新记录
2
2
 
3
+ ## 0.10.1(2026-12-02)
4
+
5
+ - 新增 macOS 安装脚本,无需提前安装 Node.js。优先复用已有 Node.js 24+ 和 npm,缺少或版本过低时,从官网下载并校验对应 Apple Silicon / Intel 架构的 Node.js 24,安装到 MCP 自己的目录。
6
+ - 生成使用固定 Node 路径的启动器,桌面 MCP 客户端无需加载终端的 PATH;支持重复安装和指定包版本,安装失败明确退出。
7
+ - 更新中英文安装、客户端配置和升级说明;npm 包包含安装脚本,打包验收检查其是否遗漏。
8
+
3
9
  ## 0.10.0(2026-12-01)
4
10
 
5
11
  兼容像塑 macOS 9.9.1;需要 Node.js 24+。Windows 适配仍在独立分支,不包含在本版本。
package/README.md CHANGED
@@ -304,23 +304,29 @@
304
304
 
305
305
  ## 安装(macOS)
306
306
 
307
- 需要 Node.js 24+ 和已安装的像塑。安装即表示你同意下面「协议与声明」里的用途限制:只用于学习和个人制作,不得用来抄袭他人作品。
307
+ 需要已安装的像塑。**不需要提前安装 Node.js**:安装脚本会复用已有的 Node.js 24+ 和 npm;没有或版本过低时,自动从 Node.js 官网下载 Node.js 24(Apple Silicon / Intel 对应版本),校验 SHA-256 后安装到 `~/.xiangsu-mcp-plus/node/`。无需 sudo,不修改系统 Node 或 shell 配置。安装即表示你同意下面「协议与声明」里的用途限制:只用于学习和个人制作,不得用来抄袭他人作品。
308
308
 
309
- 在 MCP 客户端里注册一个 stdio 服务即可,一行:
309
+ 先安装 MCP 及运行环境(已下载源码也可直接运行 `/bin/bash install.sh`):
310
310
 
311
311
  ```bash
312
- claude mcp add -s user xiangsu -- npx -y @muqian/xiangsu-mcp-plus # Claude Code
313
- codex mcp add xiangsu -- npx -y @muqian/xiangsu-mcp-plus # Codex
312
+ curl -fsSL https://raw.githubusercontent.com/Muqian-Sun/xiangsu-mcp-plus/main/install.sh | /bin/bash
314
313
  ```
315
314
 
316
- Cursor 等用 JSON 配置的客户端:
315
+ 再注册到所用的 MCP 客户端,选一条运行:
316
+
317
+ ```bash
318
+ claude mcp add -s user xiangsu -- "$HOME/.xiangsu-mcp-plus/bin/xiangsu-mcp-plus" # Claude Code
319
+ codex mcp add xiangsu -- "$HOME/.xiangsu-mcp-plus/bin/xiangsu-mcp-plus" # Codex
320
+ ```
321
+
322
+ 安装器会打印实际启动路径。启动器固定使用安装时选定的 Node,因此从桌面客户端启动也无需加载终端的 PATH。Cursor 等用 JSON 配置的客户端(将 `/Users/你的用户名` 换成自己的用户目录,或直接复制安装器打印的路径):
317
323
 
318
324
  ```json
319
325
  {
320
326
  "mcpServers": {
321
327
  "xiangsu": {
322
- "command": "npx",
323
- "args": ["-y", "@muqian/xiangsu-mcp-plus"]
328
+ "command": "/Users/你的用户名/.xiangsu-mcp-plus/bin/xiangsu-mcp-plus",
329
+ "args": []
324
330
  }
325
331
  }
326
332
  }
@@ -330,18 +336,20 @@ Cursor 等用 JSON 配置的客户端:
330
336
 
331
337
  插件只在安装后**新打开的工程窗口**里加载;第一次装好后,已开着的窗口要保存后重开。
332
338
 
333
- Codex 默认单次工具调用 60 秒、服务启动 10 秒超时,而打开工程、提交准备、AI 妆容、AI 3D 和 AR 视频生成要等几十秒到几分钟(`ar_video_submit` 最长 20 分钟),第一次 `npx` 启动还要先下载依赖,要在 `~/.codex/config.toml` 里调大:
339
+ 打开工程、提交准备、AI 妆容、AI 3D 和 AR 视频生成要等几十秒到几分钟(`ar_video_submit` 最长 20 分钟),在 `~/.codex/config.toml` 里配置足够的超时,并填写安装器打印的启动路径:
334
340
 
335
341
  ```toml
336
342
  [mcp_servers.xiangsu]
337
- command = "npx"
338
- args = ["-y", "@muqian/xiangsu-mcp-plus"]
343
+ command = "/Users/你的用户名/.xiangsu-mcp-plus/bin/xiangsu-mcp-plus"
344
+ args = []
339
345
  startup_timeout_sec = 60
340
346
  tool_timeout_sec = 1500
341
347
  ```
342
348
 
343
349
  它已经包含官方工具,不必再单独配置官方的 `xiangsu-mcp-manager`。如果你还在用像塑自带的 `xiangsu-effect-editor` skill,它要求客户端里存在名为 `xiangsu-mcp-manager` 的服务;这种情况下保留官方配置即可,两者可以并存。
344
350
 
351
+ 已有 Node.js 24+ 和 npm 的用户也可以继续用 `npx -y @muqian/xiangsu-mcp-plus` 作为 stdio 服务命令;`npx` 本身依赖 Node,无法在缺少 Node 的机器上自动安装运行环境。
352
+
345
353
  从源码运行(开发用):
346
354
 
347
355
  ```bash
@@ -355,7 +363,7 @@ claude mcp add -s user xiangsu -- "$(which node)" "$PWD/src/server.mjs"
355
363
 
356
364
  ### 更新后怎么生效
357
365
 
358
- 版本变化见 [更新记录](CHANGELOG.md)。升级到 0.10.0 时,先停止旧版 MCP 服务,再启动新版;需要固定版本时,把 `npx` 的包参数改为 `@muqian/xiangsu-mcp-plus@0.10.0`。服务启动后自动检查并升级插件,再保存并重开需要加载新插件的工程窗口。插件清单仍为 `0.3.0`,实际升级比较的是 `install.json` 中的 npm 包版本。0.9.0 仍使用旧名 `XiangsuMcpExt`,不要同时启动;新版会清理旧名插件,保留旧状态目录。
366
+ 版本变化见 [更新记录](CHANGELOG.md)。使用安装脚本的用户,停止 MCP 服务后重新运行同一条安装命令即可升级,再启动服务;需要固定版本时,下载 `install.sh` 后运行 `/bin/bash install.sh @muqian/xiangsu-mcp-plus@0.10.1`。使用 `npx` 的用户可将包参数固定为 `@muqian/xiangsu-mcp-plus@0.10.1`。服务启动后自动检查并升级插件,再保存并重开需要加载新插件的工程窗口。插件清单仍为 `0.3.0`,实际升级比较的是 `install.json` 中的 npm 包版本。0.9.0 仍使用旧名 `XiangsuMcpExt`,不要同时启动;新版会清理旧名插件,保留旧状态目录。
359
367
 
360
368
  0.9.0 之后工具目录已调整:AI 工具按功能族合并,旧账号取数和 `ops_*` 工具下架,客户端应刷新工具列表并通过 `tool_search` / `tool_describe` 重新发现。
361
369
 
@@ -365,6 +373,7 @@ claude mcp add -s user xiangsu -- "$(which node)" "$PWD/src/server.mjs"
365
373
 
366
374
  ## 开发
367
375
 
376
+ - `node --test test/bootstrap.test.mjs`:在隔离目录模拟没有 Node、旧版 Node、可复用 Node、重复安装、两种 Mac 架构和下载失败,执行真实安装脚本及生成的启动器;不联网,不改本机运行环境。
368
377
  - `npm run check:package`:打出真实 npm 包,在隔离目录全新安装并验证 MCP 握手、工具目录与离线 PNG 渲染;从 npm 0.9.0 升级插件,验证防降级、强制重装及 npx 缓存删除后的加载。需要联网下载 npm 依赖,不会改本机像塑插件或 MCP 配置。加 `-- /absolute/artifacts-dir` 可保留产物与报告,用于实机验收。
369
378
  - `npm test`:用模拟的编辑器模块测插件逻辑;画图的测试用 `test/fixtures/` 里裁出的思源黑体子集(SIL OFL,协议在同目录),CI 机器上没有中文字体也能跑;用 jsdom 按线上结构搭的提交页测填写和送审流程;用内存传输测 MCP 工具、官方转发、工程窗口编排。
370
379
  - `node scripts/mcp-call.mjs <tool> '<json>' [...]`:新起一个服务按顺序调工具,图片写到 `<临时目录>/xs-mcp-call/` 下每次运行一个子目录(一小时后清理)。`scripts/official-call.mjs` 直调官方 MCP,图片同样放在 `xs-official-call/` 下。
@@ -408,6 +417,6 @@ claude mcp add -s user xiangsu -- "$(which node)" "$PWD/src/server.mjs"
408
417
 
409
418
  ## English
410
419
 
411
- Unofficial MCP extension for Douyin AR (像塑) on macOS. One stdio MCP server proxies every tool of the editor's official MCP (with automatic reconnects) and adds what the official server cannot do: browse/search/preview/apply official library assets, browse/search/download or open the homepage works (official projects and published effects) as full projects an agent can read and learn from (rank-board effects are looked up there by effect id, though effects whose authors did not share them on the homepage have no downloadable project; every download is registered and deleted by works_cleanup or after 24 hours), add any item of the editor's "add object" menu (toolbar makeup / reshape / AI face effects), create AI combine workflows (the photo is sent to the cloud and generated from the workflow) and apply them to the scene the way the AI effect window does, leaving node editing and preview generation to the official workflow tools, extract makeup from a reference portrait with the asset library's AI makeup panel (five face-part textures with recommended strengths, a preview on the editor's sample face) and import it as makeup layers the way the panel does, also writing the AI pupil texture the 9.8.1 panel fails to apply, run the asset library's AI 3D generation (image → static mesh, a video's human motion → an animated FBX with the standard humanoid skeleton, an orbit video → a 3D Gaussian splat) and import the results the way its panel does, run its AR video generation (a subject image or video → a matted video of the subject doing a described motion, placed as an AR plane sticker) through the panel's own task manager, list a project's makeup layers with the face part, colour and strength of each (from the layer's region and its texture's pixels when the name says nothing), set FaceWarpX brush intensity, prepare delivery (setting and uploading the icon, local and cloud effect checks, filling in the submit window — name, trigger hint, camera, inspiration, task — up to its final step, then, once confirmed, ticking the creator agreement and pressing 提交审核 to send it to review, phone preview QR codes, binding received creator tasks or inspirations), read the signed-in account's inspirations and tasks (collect inspirations, receive tasks) and the mobile app's rank boards, list the account's submitted effects with their review status and, for rejected ones, the reviewer's reason and full review timeline, use Douyin music, open/create/close project windows, and remove objects together with resources only they used. It also replaces the one-off scripts effect projects kept writing, without an editor window: icons cropped from preview frames with a caption and a list-size comparison sheet, synthesized sound effects (ported from those scripts) as MP3 through the editor's ffmpeg, outlined / gradient text and rounded panels as PNG (rendered with Skia, the editor's built-in fonts by default), your own preview models added to the editor's preview list, and render layers / camera layer masks set in a saved scene. For editor 9.8.3 it drives the asset library's new visual-effect generation and custom real-time face (UGan) training panels, the image editor's AI tools (upscale, remove, repaint, matting), and preview input the official server rejects: simulated microphone volume, pitch and keyword hits through the editor's built-in agent playthrough session, seeking, touch moves and hand-gesture videos. It works through a small editor plugin that exposes a token-protected RPC on 127.0.0.1 inside each project window. Relies on editor internals (currently verified on 9.9.1); `ext_status` reports missing internals and checks menu, makeup, asset and template operations independently. Register it as a stdio MCP server in one line, e.g. `claude mcp add -s user xiangsu -- npx -y @muqian/xiangsu-mcp-plus` or `codex mcp add xiangsu -- npx -y @muqian/xiangsu-mcp-plus` (for Codex also raise `tool_timeout_sec`, since some tools wait minutes). At startup the server installs the editor plugin when it is missing, older, or its code is gone (copying the plugin code out of the npx cache first) and leaves an equal or newer one alone; `ext_status` reports the outcome. Project windows already open load the plugin after they are reopened.
420
+ Unofficial MCP extension for Douyin AR (像塑) on macOS. One stdio MCP server proxies every tool of the editor's official MCP (with automatic reconnects) and adds what the official server cannot do: browse/search/preview/apply official library assets, browse/search/download or open the homepage works (official projects and published effects) as full projects an agent can read and learn from (rank-board effects are looked up there by effect id, though effects whose authors did not share them on the homepage have no downloadable project; every download is registered and deleted by works_cleanup or after 24 hours), add any item of the editor's "add object" menu (toolbar makeup / reshape / AI face effects), create AI combine workflows (the photo is sent to the cloud and generated from the workflow) and apply them to the scene the way the AI effect window does, leaving node editing and preview generation to the official workflow tools, extract makeup from a reference portrait with the asset library's AI makeup panel (five face-part textures with recommended strengths, a preview on the editor's sample face) and import it as makeup layers the way the panel does, also writing the AI pupil texture the 9.8.1 panel fails to apply, run the asset library's AI 3D generation (image → static mesh, a video's human motion → an animated FBX with the standard humanoid skeleton, an orbit video → a 3D Gaussian splat) and import the results the way its panel does, run its AR video generation (a subject image or video → a matted video of the subject doing a described motion, placed as an AR plane sticker) through the panel's own task manager, list a project's makeup layers with the face part, colour and strength of each (from the layer's region and its texture's pixels when the name says nothing), set FaceWarpX brush intensity, prepare delivery (setting and uploading the icon, local and cloud effect checks, filling in the submit window — name, trigger hint, camera, inspiration, task — up to its final step, then, once confirmed, ticking the creator agreement and pressing 提交审核 to send it to review, phone preview QR codes, binding received creator tasks or inspirations), read the signed-in account's inspirations and tasks (collect inspirations, receive tasks) and the mobile app's rank boards, list the account's submitted effects with their review status and, for rejected ones, the reviewer's reason and full review timeline, use Douyin music, open/create/close project windows, and remove objects together with resources only they used. It also replaces the one-off scripts effect projects kept writing, without an editor window: icons cropped from preview frames with a caption and a list-size comparison sheet, synthesized sound effects (ported from those scripts) as MP3 through the editor's ffmpeg, outlined / gradient text and rounded panels as PNG (rendered with Skia, the editor's built-in fonts by default), your own preview models added to the editor's preview list, and render layers / camera layer masks set in a saved scene. For editor 9.8.3 it drives the asset library's new visual-effect generation and custom real-time face (UGan) training panels, the image editor's AI tools (upscale, remove, repaint, matting), and preview input the official server rejects: simulated microphone volume, pitch and keyword hits through the editor's built-in agent playthrough session, seeking, touch moves and hand-gesture videos. It works through a small editor plugin that exposes a token-protected RPC on 127.0.0.1 inside each project window. Relies on editor internals (currently verified on 9.9.1); `ext_status` reports missing internals and checks menu, makeup, asset and template operations independently. Install with `curl -fsSL https://raw.githubusercontent.com/Muqian-Sun/xiangsu-mcp-plus/main/install.sh | /bin/bash`, then register the printed launcher path as a stdio MCP server. The installer reuses Node.js 24+ with npm, or downloads and verifies the official Node.js 24 macOS runtime into its own directory when needed. No separate Node installation or sudo is required. The launcher uses an absolute Node path so desktop clients do not depend on your terminal PATH. For Codex also raise `tool_timeout_sec`, since some tools wait minutes. At startup the server installs the editor plugin when it is missing, older, or its code is gone (copying the plugin code out of the npx cache first) and leaves an equal or newer one alone; `ext_status` reports the outcome. Project windows already open load the plugin after they are reopened.
412
421
 
413
422
  **For learning and personal creation only. Do not use it to copy other creators' works**: works you view, download or apply through this tool (homepage projects, ranked effects, assets other creators shared) must not be republished, submitted, used commercially or passed off as your own, as is or modified. Licensed under [MIT](LICENSE), which covers this project's own code only. Not affiliated with or endorsed by ByteDance / Douyin; all product names and trademarks belong to their owners. The repository contains no editor code or assets. Official assets and homepage works accessed through this tool belong to 像塑 or their creators and are subject to the platform's terms; use downloaded works for learning only, delete them with works_cleanup when done, and do not redistribute them.
package/install.sh ADDED
@@ -0,0 +1,92 @@
1
+ #!/bin/bash
2
+ # macOS bootstrap: runs before Node/npm are available. Keep main's invocation last so a
3
+ # partially downloaded script cannot start an installation.
4
+ set -euo pipefail
5
+
6
+ main() {
7
+ if [ "$(uname -s)" != Darwin ]; then
8
+ echo '像塑 MCP Plus 目前只支持 macOS。' >&2
9
+ exit 1
10
+ fi
11
+ local arch
12
+ case "$(uname -m)" in
13
+ arm64) arch=arm64 ;;
14
+ x86_64) arch=x64 ;;
15
+ *) echo '不支持的 Mac 处理器架构。' >&2; exit 1 ;;
16
+ esac
17
+
18
+ local state="${XIANGSU_MCP_PLUS_STATE:-$HOME/.xiangsu-mcp-plus}"
19
+ mkdir -p "$state"
20
+ state="$(cd "$state" && pwd -P)"
21
+ local work
22
+ work="$(mktemp -d "$state/.install.XXXXXX")"
23
+ trap "$(printf 'rm -rf -- %q' "$work")" EXIT
24
+
25
+ # 24 is the minimum in package.json. Prefer our previously downloaded runtime, then
26
+ # an existing Node/npm pair; a private runtime needs neither sudo nor shell config.
27
+ local node_bin="$state/node/bin" candidate
28
+ if ! runtime_works "$node_bin"; then
29
+ candidate="$(command -v node || true)"
30
+ if [ -n "$candidate" ] && runtime_works "$(dirname "$candidate")"; then
31
+ node_bin="$(cd "$(dirname "$candidate")" && pwd -P)"
32
+ else
33
+ echo '正在安装 Node.js 24…'
34
+ local archive version
35
+ curl -fsSL https://nodejs.org/dist/latest-v24.x/SHASUMS256.txt -o "$work/SHASUMS256.txt"
36
+ # Require exactly one matching official archive, then pin its version for the
37
+ # download so a new release between the two requests cannot mix versions.
38
+ if ! awk -v arch="$arch" '
39
+ $2 ~ "^node-v24\\.[0-9]+\\.[0-9]+-darwin-" arch "\\.tar\\.gz$" { print; count++ }
40
+ END { if (count != 1) exit 1 }
41
+ ' "$work/SHASUMS256.txt" > "$work/checksum.txt"; then
42
+ echo '安装失败:Node.js 官方清单中未找到唯一匹配的安装包。' >&2
43
+ exit 1
44
+ fi
45
+ read -r _ archive < "$work/checksum.txt"
46
+ version="${archive#node-}"
47
+ version="${version%-darwin-*}"
48
+ curl -fsSL "https://nodejs.org/dist/$version/$archive" -o "$work/$archive"
49
+ (cd "$work" && shasum -a 256 -c checksum.txt)
50
+ tar -xzf "$work/$archive" -C "$work"
51
+ if ! runtime_works "$work/${archive%.tar.gz}/bin"; then
52
+ echo '安装失败:下载的 Node.js / npm 无法运行或版本不满足 Node.js 24+。' >&2
53
+ exit 1
54
+ fi
55
+ rm -rf "$state/node"
56
+ mv "$work/${archive%.tar.gz}" "$state/node"
57
+ fi
58
+ fi
59
+
60
+ export PATH="$node_bin:$PATH"
61
+ local package_spec="${1:-@muqian/xiangsu-mcp-plus@latest}"
62
+ echo "正在安装 ${package_spec}…"
63
+ "$node_bin/npm" install --prefix "$state/app" --omit=dev --no-audit --no-fund "$package_spec"
64
+ local server="$state/app/node_modules/@muqian/xiangsu-mcp-plus/src/server.mjs"
65
+ if [ ! -f "$server" ]; then
66
+ echo "安装失败:未找到 MCP 服务入口 $server" >&2
67
+ exit 1
68
+ fi
69
+
70
+ mkdir -p "$state/bin"
71
+ # Bash %q handles spaces and shell metacharacters in home/runtime paths. GUI
72
+ # clients can start this absolute path without loading the user's shell profile.
73
+ {
74
+ printf '#!/bin/bash\nset -euo pipefail\n'
75
+ printf 'export XIANGSU_MCP_PLUS_STATE=%q\n' "$state"
76
+ printf 'export PATH=%q:"$PATH"\n' "$node_bin"
77
+ printf 'exec %q %q "$@"\n' "$node_bin/node" "$server"
78
+ } > "$work/launcher"
79
+ chmod +x "$work/launcher"
80
+ mv "$work/launcher" "$state/bin/xiangsu-mcp-plus"
81
+ echo "安装完成,MCP 启动路径:$state/bin/xiangsu-mcp-plus"
82
+ printf 'Claude Code: claude mcp add -s user xiangsu -- %q\n' "$state/bin/xiangsu-mcp-plus"
83
+ printf 'Codex: codex mcp add xiangsu -- %q\n' "$state/bin/xiangsu-mcp-plus"
84
+ }
85
+
86
+ runtime_works() {
87
+ [ -x "$1/node" ] && [ -x "$1/npm" ] &&
88
+ "$1/node" -e 'process.exit(Number(process.versions.node.split(".")[0]) >= 24 ? 0 : 1)' &&
89
+ PATH="$1:$PATH" "$1/npm" --version >/dev/null 2>&1
90
+ }
91
+
92
+ main "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muqian/xiangsu-mcp-plus",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "mcpName": "io.github.Muqian-Sun/xiangsu-mcp-plus",
5
5
  "type": "module",
6
6
  "description": "Unofficial macOS MCP for Douyin AR (像塑): official MCP proxy, AI capabilities and generation, live parameters, managed scenes, compilation checks, deterministic playtesting, assets, audio and delivery. Adapted to editor 9.9.1. For learning and personal creation only.",
@@ -47,6 +47,7 @@
47
47
  "files": [
48
48
  "src/",
49
49
  "editor-plugin/",
50
+ "install.sh",
50
51
  "scripts/install.mjs",
51
52
  "CHANGELOG.md",
52
53
  "server.json"
package/server.json CHANGED
@@ -7,12 +7,12 @@
7
7
  "url": "https://github.com/Muqian-Sun/xiangsu-mcp-plus",
8
8
  "source": "github"
9
9
  },
10
- "version": "0.10.0",
10
+ "version": "0.10.1",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "identifier": "@muqian/xiangsu-mcp-plus",
15
- "version": "0.10.0",
15
+ "version": "0.10.1",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  }