davinci-resolve-mcp 2.203.0 → 2.204.0
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 +46 -0
- package/README.md +7 -1
- package/README.zh-CN.md +4 -2
- package/bin/davinci-resolve-advanced-mcp.mjs +49 -1
- package/bin/davinci-resolve-mcp.mjs +174 -1
- package/docs/install.md +1 -0
- package/install.py +70 -1
- package/package.json +1 -1
- package/src/granular/common.py +1 -1
- package/src/server.py +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
Release history for the DaVinci Resolve MCP Server. The latest release is summarized in the root README; older entries live here to keep the README focused.
|
|
4
4
|
|
|
5
|
+
## What's New in v2.204.0 — #179: the managed install can boot the advanced server
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **The managed install now contains the tree the advanced bin imports.**
|
|
10
|
+
`setup` registered `davinci-resolve-advanced` in every generated client
|
|
11
|
+
config, pointing at `<managed root>/bin/davinci-resolve-advanced-mcp.mjs` —
|
|
12
|
+
but the bootstrapper's sync list never copied `resolve-advanced/`, which
|
|
13
|
+
that bin imports. The process died with `ERR_MODULE_NOT_FOUND` before the
|
|
14
|
+
MCP handshake, and every client reported the same uninformative "subprocess
|
|
15
|
+
closed stdout before responding". `resolve-advanced/` is now synced, and a
|
|
16
|
+
regression test drives the real sync into a temp root rather than restating
|
|
17
|
+
the list, so dropping it again fails the suite. Reported in #179.
|
|
18
|
+
- **Its Node dependencies are installed there too.** Syncing the tree alone
|
|
19
|
+
was only half the fix: the managed root has no `node_modules`, so
|
|
20
|
+
`@modelcontextprotocol/sdk`, `zod`, `jszip`, `fzstd` and `zstd-codec` still
|
|
21
|
+
failed to resolve. `setup` now runs `npm install --omit=dev --omit=optional`
|
|
22
|
+
under the managed `resolve-advanced/` before install.py writes any config.
|
|
23
|
+
Optional native deps (`better-sqlite3`, `sharp`, `pg`) stay optional — the
|
|
24
|
+
server already reports those gaps itself through `capabilities`, and a
|
|
25
|
+
failed native build must not take the whole setup down. Verified end to
|
|
26
|
+
end: a fresh managed install now completes the MCP handshake and registers
|
|
27
|
+
all 18 advanced tools.
|
|
28
|
+
- **A config is only written for a layout that can boot.** When
|
|
29
|
+
`resolve-advanced/` or its deps are absent, `build_advanced_entry` now emits
|
|
30
|
+
an `npx -y --package davinci-resolve-mcp@<version>` command instead of a
|
|
31
|
+
managed bin path that cannot start. `resolve-advanced/package.json` is the
|
|
32
|
+
single source of truth for which deps have to be present — install.py and
|
|
33
|
+
the bin both read it rather than restating the list.
|
|
34
|
+
- **An unbootable advanced server names its own fix.** The bin preflights its
|
|
35
|
+
server tree and dependencies and exits with what is missing and how to
|
|
36
|
+
repair it, instead of an `ERR_MODULE_NOT_FOUND` stack. The diagnostic goes
|
|
37
|
+
to stderr — stdout is the JSON-RPC channel, where it would corrupt the
|
|
38
|
+
handshake rather than explain it. `--version` and `--help` keep answering
|
|
39
|
+
from a broken install, since those are what a user reaches for when the
|
|
40
|
+
server will not start.
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
|
|
44
|
+
- **`davinci-resolve-mcp sync`** — refresh the managed install and provision
|
|
45
|
+
the advanced server's Node deps without running the full interactive setup.
|
|
46
|
+
`--no-deps` syncs files only. Re-syncing preserves the provisioned
|
|
47
|
+
`node_modules`; a dev checkout's own `node_modules` is never copied into a
|
|
48
|
+
managed install, since its optional native deps are built for the
|
|
49
|
+
developer's platform and ABI.
|
|
50
|
+
|
|
5
51
|
## What's New in v2.203.0 — E151: verify_roundtrip fits a source offset from the majority
|
|
6
52
|
|
|
7
53
|
### Fixed
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English | [简体中文](README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
[](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
|
|
6
6
|
[](https://www.npmjs.com/package/davinci-resolve-mcp)
|
|
7
7
|
[](docs/reference/api-coverage.md)
|
|
8
8
|
[-blue.svg)](#server-modes)
|
|
@@ -160,6 +160,12 @@ Add it alongside the live server (both ship in one `npm install`):
|
|
|
160
160
|
need user-installed tools (ffmpeg for `audio`, `sharp`/`better-sqlite3` for some paths) — call the
|
|
161
161
|
`capabilities` tool for live status and install hints.
|
|
162
162
|
|
|
163
|
+
Unlike the Python server, this one has Node dependencies. `npx davinci-resolve-mcp setup` installs them
|
|
164
|
+
into the managed install (`npm install --omit=dev --omit=optional` under `resolve-advanced/`) and only
|
|
165
|
+
then registers the bin. If that install could not run — offline, or npm unavailable — setup registers
|
|
166
|
+
an `npx` command for the advanced server instead, so the entry it writes always boots. To repair an
|
|
167
|
+
existing install without re-running setup: `npx davinci-resolve-mcp sync`.
|
|
168
|
+
|
|
163
169
|
### Bradford Post Assistant — managed application (closed beta)
|
|
164
170
|
|
|
165
171
|
The maintainers also build **Bradford Post Assistant**, a desktop application on top of this
|
package/README.zh-CN.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 简体中文
|
|
4
4
|
|
|
5
|
-
[](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
|
|
6
6
|
[](https://www.npmjs.com/package/davinci-resolve-mcp)
|
|
7
7
|
[](docs/reference/api-coverage.md)
|
|
8
8
|
[-blue.svg)](#服务器模式)
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
[](https://www.python.org/downloads/)
|
|
13
13
|
[](https://opensource.org/licenses/MIT)
|
|
14
14
|
|
|
15
|
-
> 本翻译对应 v2.
|
|
15
|
+
> 本翻译对应 v2.204.0 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
|
|
16
16
|
|
|
17
17
|
一个 Model Context Protocol (MCP) 服务器,让 AI 助手通过官方脚本 API 控制 DaVinci Resolve Studio(达芬奇)。它提供完整的 API 覆盖,外加带护栏的工作流助手,涵盖剪辑、媒体池整理、渲染设置、审阅标记、调色、Fusion、Fairlight、项目生命周期任务、扩展开发,以及不碰源媒体的媒体分析。
|
|
18
18
|
|
|
@@ -105,6 +105,8 @@ DRX 调色写入**针对 Resolve Studio 做过实机校准**:调色参数默
|
|
|
105
105
|
|
|
106
106
|
`install.py` 会把两个配置条目都打印出来。核心是纯 JS/MIT,无必需的原生模块;少数功能需要用户自装工具(`audio` 需要 ffmpeg,部分路径需要 `sharp`/`better-sqlite3`)——调用 `capabilities` 工具可查看实时状态和安装提示。
|
|
107
107
|
|
|
108
|
+
和 Python 服务器不同,这个服务器有 Node 依赖。`npx davinci-resolve-mcp setup` 会先把依赖装进托管安装目录(在 `resolve-advanced/` 下执行 `npm install --omit=dev --omit=optional`),装好之后才注册这个可执行文件。如果安装跑不起来(离线,或者没有 npm),setup 会改为给 advanced 服务器写一条 `npx` 命令,这样写出去的配置条目总是能启动。要修复一个已有的安装而不重跑 setup:`npx davinci-resolve-mcp sync`。
|
|
109
|
+
|
|
108
110
|
### Bradford Post Assistant——托管应用(封闭测试中)
|
|
109
111
|
|
|
110
112
|
维护者还在这个开源基础之上构建了 **Bradford Post Assistant**,一款桌面应用。MCP 服务器给了 agent 一双手,Post Assistant 则是围绕这双手的工作副驾——一个面向后期制作的本地 AI 助手,客户素材永不离开工作站:
|
|
@@ -62,7 +62,55 @@ if (major < 20 || (major === 20 && minor < 9)) {
|
|
|
62
62
|
process.exit(1);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
const
|
|
65
|
+
const advancedRoot = path.resolve(packageRoot, 'resolve-advanced');
|
|
66
|
+
const serverEntry = path.join(advancedRoot, 'server', 'index.mjs');
|
|
67
|
+
|
|
68
|
+
// Preflight, for the same reason as the Node floor above: a managed install
|
|
69
|
+
// that never received resolve-advanced/ (or its deps) otherwise dies with a
|
|
70
|
+
// bare ERR_MODULE_NOT_FOUND before the MCP handshake, and the client reports
|
|
71
|
+
// only "subprocess closed stdout before responding" — a stack trace with no
|
|
72
|
+
// fix in it. Issue #179. Say what is missing and how to repair it.
|
|
73
|
+
function missingRuntimePieces() {
|
|
74
|
+
if (!fs.existsSync(serverEntry)) {
|
|
75
|
+
return { what: `the advanced server tree (${serverEntry} is missing)` };
|
|
76
|
+
}
|
|
77
|
+
let required = [];
|
|
78
|
+
try {
|
|
79
|
+
const manifest = JSON.parse(fs.readFileSync(path.join(advancedRoot, 'package.json'), 'utf8'));
|
|
80
|
+
required = Object.keys(manifest.dependencies || {});
|
|
81
|
+
} catch {
|
|
82
|
+
return { what: `resolve-advanced/package.json (cannot tell which deps are required)` };
|
|
83
|
+
}
|
|
84
|
+
const modulesDir = path.join(advancedRoot, 'node_modules');
|
|
85
|
+
const missing = required.filter(
|
|
86
|
+
(dep) => !fs.existsSync(path.join(modulesDir, ...dep.split('/'))),
|
|
87
|
+
);
|
|
88
|
+
// Deps may also be hoisted above the package (an npm/npx install puts them in
|
|
89
|
+
// a parent node_modules), so an empty local node_modules is not conclusive —
|
|
90
|
+
// only report deps the resolver genuinely cannot see.
|
|
91
|
+
const unresolvable = missing.filter((dep) => {
|
|
92
|
+
try {
|
|
93
|
+
import.meta.resolve(dep);
|
|
94
|
+
return false;
|
|
95
|
+
} catch {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
return unresolvable.length ? { what: `dependencies: ${unresolvable.join(', ')}` } : null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const gap = missingRuntimePieces();
|
|
103
|
+
if (gap) {
|
|
104
|
+
process.stderr.write(
|
|
105
|
+
`[davinci-resolve-advanced-mcp] cannot start: ${gap.what}.\n` +
|
|
106
|
+
`This install is at ${packageRoot}.\n` +
|
|
107
|
+
`Fix: run \`npx davinci-resolve-mcp setup\` to repair the managed install ` +
|
|
108
|
+
`(it syncs resolve-advanced/ and installs its Node dependencies), or run the ` +
|
|
109
|
+
`server straight from the package with ` +
|
|
110
|
+
`\`npx -y --package davinci-resolve-mcp davinci-resolve-advanced-mcp\`.\n`,
|
|
111
|
+
);
|
|
112
|
+
process.exit(1);
|
|
113
|
+
}
|
|
66
114
|
|
|
67
115
|
const { startServer } = await import(pathToFileURL(serverEntry).href);
|
|
68
116
|
await startServer();
|
|
@@ -24,6 +24,11 @@ const PY_ABI_RISK_MINOR = 13;
|
|
|
24
24
|
const SYNC_ITEMS = [
|
|
25
25
|
"bin",
|
|
26
26
|
"src",
|
|
27
|
+
// The Node 'advanced' bin resolves ../resolve-advanced/server/index.mjs
|
|
28
|
+
// relative to itself, and install.py registers that bin into every generated
|
|
29
|
+
// client config. Leaving the tree out of the sync shipped configs that
|
|
30
|
+
// pointed at a module the managed install could never contain (issue #179).
|
|
31
|
+
"resolve-advanced",
|
|
27
32
|
"docs",
|
|
28
33
|
"examples",
|
|
29
34
|
"scripts",
|
|
@@ -52,6 +57,7 @@ Usage:
|
|
|
52
57
|
davinci-resolve-mcp server [server.py options]
|
|
53
58
|
davinci-resolve-mcp control-panel [control panel options]
|
|
54
59
|
davinci-resolve-mcp batch <plan|run|status|list|resume|cancel> [options]
|
|
60
|
+
davinci-resolve-mcp sync [--no-deps]
|
|
55
61
|
davinci-resolve-mcp --version
|
|
56
62
|
davinci-resolve-mcp --help
|
|
57
63
|
|
|
@@ -61,6 +67,7 @@ Examples:
|
|
|
61
67
|
npx davinci-resolve-mcp doctor
|
|
62
68
|
npx davinci-resolve-mcp batch run /path/to/footage --depth standard
|
|
63
69
|
npx davinci-resolve-mcp batch run /path/to/footage --json > progress.log
|
|
70
|
+
npx davinci-resolve-mcp sync # refresh the managed install only
|
|
64
71
|
|
|
65
72
|
Environment:
|
|
66
73
|
DAVINCI_RESOLVE_MCP_INSTALL_ROOT Override the managed install directory.
|
|
@@ -132,6 +139,28 @@ function validateManagedRoot(root) {
|
|
|
132
139
|
}
|
|
133
140
|
}
|
|
134
141
|
|
|
142
|
+
// Top-level children of a synced item that the sync must NOT delete. The
|
|
143
|
+
// advanced server's node_modules is installed *into* the managed root by
|
|
144
|
+
// provisionAdvancedDeps and has no counterpart in the package, so a blanket
|
|
145
|
+
// clear would throw it away on every subsequent command and force a reinstall.
|
|
146
|
+
const SYNC_PRESERVE = {
|
|
147
|
+
"resolve-advanced": ["node_modules"],
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
function clearDestination(destination, preserve) {
|
|
151
|
+
if (!preserve.length || !fs.existsSync(destination)) {
|
|
152
|
+
fs.rmSync(destination, { recursive: true, force: true });
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const keep = new Set(preserve);
|
|
156
|
+
for (const entry of fs.readdirSync(destination)) {
|
|
157
|
+
if (keep.has(entry)) {
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
fs.rmSync(path.join(destination, entry), { recursive: true, force: true });
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
135
164
|
function copyItem(name, destinationRoot) {
|
|
136
165
|
const source = path.join(PACKAGE_ROOT, name);
|
|
137
166
|
if (!fs.existsSync(source)) {
|
|
@@ -139,7 +168,7 @@ function copyItem(name, destinationRoot) {
|
|
|
139
168
|
}
|
|
140
169
|
|
|
141
170
|
const destination = path.join(destinationRoot, name);
|
|
142
|
-
|
|
171
|
+
clearDestination(destination, SYNC_PRESERVE[name] || []);
|
|
143
172
|
fs.cpSync(source, destination, {
|
|
144
173
|
recursive: true,
|
|
145
174
|
errorOnExist: false,
|
|
@@ -154,6 +183,13 @@ function shouldSyncPath(sourcePath) {
|
|
|
154
183
|
if (basename === "__pycache__" || basename === ".DS_Store") {
|
|
155
184
|
return false;
|
|
156
185
|
}
|
|
186
|
+
// A dev checkout carries resolve-advanced/node_modules with optional native
|
|
187
|
+
// deps (sharp, better-sqlite3) built for the developer's platform+ABI.
|
|
188
|
+
// Copying those into a managed install is slow and ships binaries that may
|
|
189
|
+
// not load there; provisionAdvancedDeps installs them fresh instead.
|
|
190
|
+
if (basename === "node_modules") {
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
157
193
|
if (basename.endsWith(".pyc") || basename.endsWith(".pyo")) {
|
|
158
194
|
return false;
|
|
159
195
|
}
|
|
@@ -179,6 +215,124 @@ function syncManagedInstall(root) {
|
|
|
179
215
|
return root;
|
|
180
216
|
}
|
|
181
217
|
|
|
218
|
+
// ─── Advanced (Node) server runtime ─────────────────────────────────────────
|
|
219
|
+
//
|
|
220
|
+
// The advanced bin imports ../resolve-advanced/server/index.mjs, which in turn
|
|
221
|
+
// imports @modelcontextprotocol/sdk, zod, jszip, fzstd, zstd-codec and the
|
|
222
|
+
// vendored codecs. Syncing the tree is only half the fix for issue #179: the
|
|
223
|
+
// managed root has no node_modules, so the imports still fail. Node resolves
|
|
224
|
+
// them from resolve-advanced/node_modules, which resolve-advanced/package.json
|
|
225
|
+
// declares — so that manifest, not a list duplicated here, is the source of
|
|
226
|
+
// truth for what has to be present.
|
|
227
|
+
|
|
228
|
+
function advancedRoot(root) {
|
|
229
|
+
return path.join(root, "resolve-advanced");
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function advancedServerEntry(root) {
|
|
233
|
+
return path.join(advancedRoot(root), "server", "index.mjs");
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function advancedRequiredDeps(root) {
|
|
237
|
+
const manifest = path.join(advancedRoot(root), "package.json");
|
|
238
|
+
try {
|
|
239
|
+
const parsed = JSON.parse(fs.readFileSync(manifest, "utf8"));
|
|
240
|
+
return Object.keys(parsed.dependencies || {});
|
|
241
|
+
} catch {
|
|
242
|
+
return [];
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/** Can the advanced server actually boot from this root? Names what is missing. */
|
|
247
|
+
function advancedRuntimeStatus(root) {
|
|
248
|
+
const entry = advancedServerEntry(root);
|
|
249
|
+
const entryPresent = fs.existsSync(entry);
|
|
250
|
+
const modulesDir = path.join(advancedRoot(root), "node_modules");
|
|
251
|
+
const required = advancedRequiredDeps(root);
|
|
252
|
+
const missingDeps = required.filter(
|
|
253
|
+
(dep) => !fs.existsSync(path.join(modulesDir, ...dep.split("/")))
|
|
254
|
+
);
|
|
255
|
+
return {
|
|
256
|
+
entry,
|
|
257
|
+
entryPresent,
|
|
258
|
+
// No manifest to read means we cannot tell what is required; treat that as
|
|
259
|
+
// "not bootable" rather than quietly reporting a clean bill of health.
|
|
260
|
+
depsPresent: required.length > 0 && missingDeps.length === 0,
|
|
261
|
+
required,
|
|
262
|
+
missingDeps,
|
|
263
|
+
bootable: entryPresent && required.length > 0 && missingDeps.length === 0,
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function npmCommand() {
|
|
268
|
+
return process.platform === "win32" ? "npm.cmd" : "npm";
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Install the advanced server's Node deps into the managed root.
|
|
273
|
+
*
|
|
274
|
+
* Optional deps (better-sqlite3, sharp, pg, js-yaml) stay omitted on purpose:
|
|
275
|
+
* they are native or heavy, the server already reports capability-specific
|
|
276
|
+
* setup gaps when they are absent, and a failed native build must not take the
|
|
277
|
+
* whole setup down with it.
|
|
278
|
+
*
|
|
279
|
+
* stdio is inherited on stderr only — this must never write to stdout, which
|
|
280
|
+
* on the server path is a JSON-RPC channel.
|
|
281
|
+
*/
|
|
282
|
+
function provisionAdvancedDeps(root, { force = false } = {}) {
|
|
283
|
+
const before = advancedRuntimeStatus(root);
|
|
284
|
+
if (!before.entryPresent) {
|
|
285
|
+
return { ...before, ran: false, reason: "advanced server tree is not present" };
|
|
286
|
+
}
|
|
287
|
+
if (before.depsPresent && !force) {
|
|
288
|
+
return { ...before, ran: false, reason: "already provisioned" };
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const result = spawnSync(
|
|
292
|
+
npmCommand(),
|
|
293
|
+
["install", "--omit=dev", "--omit=optional", "--no-audit", "--no-fund"],
|
|
294
|
+
{ cwd: advancedRoot(root), stdio: ["ignore", "inherit", "inherit"], encoding: "utf8" }
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
const after = advancedRuntimeStatus(root);
|
|
298
|
+
return {
|
|
299
|
+
...after,
|
|
300
|
+
ran: true,
|
|
301
|
+
ok: result.status === 0 && after.bootable,
|
|
302
|
+
status: result.status,
|
|
303
|
+
error: result.error ? result.error.message : null,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function reportAdvancedRuntime(root, { provision }) {
|
|
308
|
+
const outcome = provision
|
|
309
|
+
? provisionAdvancedDeps(root)
|
|
310
|
+
: advancedRuntimeStatus(root);
|
|
311
|
+
|
|
312
|
+
if (outcome.bootable) {
|
|
313
|
+
console.log("Advanced server (Node): ready");
|
|
314
|
+
return outcome;
|
|
315
|
+
}
|
|
316
|
+
if (!outcome.entryPresent) {
|
|
317
|
+
console.log(
|
|
318
|
+
`Advanced server (Node): unavailable — ${outcome.entry} is missing. ` +
|
|
319
|
+
`The 'davinci-resolve-advanced' entry will be registered as an npx command instead.`
|
|
320
|
+
);
|
|
321
|
+
return outcome;
|
|
322
|
+
}
|
|
323
|
+
const missing = outcome.missingDeps.length
|
|
324
|
+
? outcome.missingDeps.join(", ")
|
|
325
|
+
: "its dependency manifest";
|
|
326
|
+
console.log(
|
|
327
|
+
`Advanced server (Node): not bootable — missing ${missing}. ` +
|
|
328
|
+
(outcome.error ? `npm install failed: ${outcome.error}. ` : "") +
|
|
329
|
+
`Fix: run 'npm install --omit=dev --omit=optional' in ${advancedRoot(root)}, ` +
|
|
330
|
+
`or re-run 'npx davinci-resolve-mcp setup' with a network connection. ` +
|
|
331
|
+
`Until then the 'davinci-resolve-advanced' entry falls back to an npx command.`
|
|
332
|
+
);
|
|
333
|
+
return outcome;
|
|
334
|
+
}
|
|
335
|
+
|
|
182
336
|
function parseExecutable(value) {
|
|
183
337
|
if (!value) {
|
|
184
338
|
return null;
|
|
@@ -373,6 +527,9 @@ function commandSetup(args) {
|
|
|
373
527
|
|
|
374
528
|
console.log(`DaVinci Resolve MCP managed install: ${root}`);
|
|
375
529
|
console.log(`Python: ${python.executable} (${python.major}.${python.minor}.${python.micro})`);
|
|
530
|
+
// Before install.py, not after: it inspects this layout to decide whether the
|
|
531
|
+
// 'davinci-resolve-advanced' entry can point at the managed bin.
|
|
532
|
+
reportAdvancedRuntime(root, { provision: true });
|
|
376
533
|
run(command, commandArgs, { cwd: root });
|
|
377
534
|
}
|
|
378
535
|
|
|
@@ -394,6 +551,8 @@ function commandDoctor(args) {
|
|
|
394
551
|
|
|
395
552
|
console.log(`DaVinci Resolve MCP managed install: ${root}`);
|
|
396
553
|
console.log(`Python: ${python.executable} (${python.major}.${python.minor}.${python.micro})`);
|
|
554
|
+
// Diagnose only — doctor already forces --dry-run and must not install.
|
|
555
|
+
reportAdvancedRuntime(root, { provision: false });
|
|
397
556
|
run(command, commandArgs, { cwd: root });
|
|
398
557
|
}
|
|
399
558
|
|
|
@@ -422,6 +581,16 @@ function commandBatch(args) {
|
|
|
422
581
|
run(command, commandArgs, { cwd: root });
|
|
423
582
|
}
|
|
424
583
|
|
|
584
|
+
function commandSync(args) {
|
|
585
|
+
const provision = !args.includes("--no-deps");
|
|
586
|
+
const root = syncManagedInstall(installRoot());
|
|
587
|
+
console.log(`DaVinci Resolve MCP managed install: ${root}`);
|
|
588
|
+
const outcome = reportAdvancedRuntime(root, { provision });
|
|
589
|
+
if (provision && !outcome.bootable) {
|
|
590
|
+
process.exit(1);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
|
|
425
594
|
function main() {
|
|
426
595
|
const argv = process.argv.slice(2);
|
|
427
596
|
// No args → run the MCP stdio server. Anything printed to stdout would
|
|
@@ -457,6 +626,10 @@ function main() {
|
|
|
457
626
|
commandBatch(args);
|
|
458
627
|
return;
|
|
459
628
|
}
|
|
629
|
+
if (command === "sync") {
|
|
630
|
+
commandSync(args);
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
460
633
|
|
|
461
634
|
console.error(`Unknown command: ${command}\n`);
|
|
462
635
|
console.error(usage());
|
package/docs/install.md
CHANGED
|
@@ -127,6 +127,7 @@ npx davinci-resolve-mcp setup --clients all # Configure all clients
|
|
|
127
127
|
npx davinci-resolve-mcp doctor # Dry-run environment/config check
|
|
128
128
|
npx davinci-resolve-mcp server # Launch the managed MCP server
|
|
129
129
|
npx davinci-resolve-mcp control-panel # Launch the local control panel
|
|
130
|
+
npx davinci-resolve-mcp sync # Refresh the managed install only
|
|
130
131
|
|
|
131
132
|
python install.py # Interactive mode
|
|
132
133
|
python install.py --clients all # Configure all clients
|
package/install.py
CHANGED
|
@@ -37,7 +37,7 @@ from src.utils.update_check import (
|
|
|
37
37
|
|
|
38
38
|
# ─── Version ──────────────────────────────────────────────────────────────────
|
|
39
39
|
|
|
40
|
-
VERSION = "2.
|
|
40
|
+
VERSION = "2.204.0"
|
|
41
41
|
# Only hard floor: mcp[cli] requires Python 3.10+. There is no upper bound —
|
|
42
42
|
# Resolve's scripting bridge loads into newer interpreters on recent builds
|
|
43
43
|
# (Python 3.14 verified against Resolve Studio 20.3.2). Older Resolve builds
|
|
@@ -1180,8 +1180,17 @@ def build_advanced_entry(server_path, python_path=None):
|
|
|
1180
1180
|
pyaaf2). We pin AAF_PROBE_PYTHON to the project venv's interpreter — the same
|
|
1181
1181
|
venv install.py installs pyaaf2 into — so AAF preview works out of the box
|
|
1182
1182
|
instead of depending on whatever `python3` happens to be on PATH.
|
|
1183
|
+
|
|
1184
|
+
The bin is only registered when this install can actually boot it. Pointing
|
|
1185
|
+
a client config at a bin whose module tree is absent produced issue #179:
|
|
1186
|
+
the process died with ERR_MODULE_NOT_FOUND before the MCP handshake and
|
|
1187
|
+
every client reported the same uninformative "subprocess closed stdout
|
|
1188
|
+
before responding". When the layout is incomplete we emit the npx form
|
|
1189
|
+
instead, which resolves the module and its deps from the npm cache.
|
|
1183
1190
|
"""
|
|
1184
1191
|
project_dir = Path(server_path).resolve().parents[1] # .../src/server.py -> repo root
|
|
1192
|
+
if not advanced_is_bootable(project_dir):
|
|
1193
|
+
return build_advanced_npx_entry(python_path)
|
|
1185
1194
|
advanced_bin = project_dir / "bin" / "davinci-resolve-advanced-mcp.mjs"
|
|
1186
1195
|
entry = {"command": resolve_node_command(), "args": [str(advanced_bin)]}
|
|
1187
1196
|
if python_path:
|
|
@@ -1189,6 +1198,66 @@ def build_advanced_entry(server_path, python_path=None):
|
|
|
1189
1198
|
return entry
|
|
1190
1199
|
|
|
1191
1200
|
|
|
1201
|
+
def advanced_required_deps(project_dir):
|
|
1202
|
+
"""Runtime deps the advanced server needs, read from its own manifest.
|
|
1203
|
+
|
|
1204
|
+
resolve-advanced/package.json is the single source of truth — the same file
|
|
1205
|
+
`npm install` in that directory acts on, and the same list the advanced bin
|
|
1206
|
+
preflights against. Nothing here restates it.
|
|
1207
|
+
"""
|
|
1208
|
+
manifest = Path(project_dir) / "resolve-advanced" / "package.json"
|
|
1209
|
+
try:
|
|
1210
|
+
with open(manifest, "r", encoding="utf-8") as fh:
|
|
1211
|
+
return list(json.load(fh).get("dependencies", {}).keys())
|
|
1212
|
+
except Exception:
|
|
1213
|
+
return []
|
|
1214
|
+
|
|
1215
|
+
|
|
1216
|
+
def advanced_is_bootable(project_dir):
|
|
1217
|
+
"""True when resolve-advanced/ and its Node deps are both present here."""
|
|
1218
|
+
project_dir = Path(project_dir)
|
|
1219
|
+
if not (project_dir / "resolve-advanced" / "server" / "index.mjs").is_file():
|
|
1220
|
+
return False
|
|
1221
|
+
required = advanced_required_deps(project_dir)
|
|
1222
|
+
if not required:
|
|
1223
|
+
return False
|
|
1224
|
+
# Deps live either in resolve-advanced/node_modules (what `npx
|
|
1225
|
+
# davinci-resolve-mcp setup` provisions in a managed install) or hoisted to
|
|
1226
|
+
# the package root (what a plain `npm install` of this package produces).
|
|
1227
|
+
for dep in required:
|
|
1228
|
+
local = project_dir / "resolve-advanced" / "node_modules" / dep
|
|
1229
|
+
hoisted = project_dir / "node_modules" / dep
|
|
1230
|
+
if not local.is_dir() and not hoisted.is_dir():
|
|
1231
|
+
return False
|
|
1232
|
+
return True
|
|
1233
|
+
|
|
1234
|
+
|
|
1235
|
+
def build_advanced_npx_entry(python_path=None):
|
|
1236
|
+
"""Fallback advanced entry that runs from the npm package, not this tree.
|
|
1237
|
+
|
|
1238
|
+
Slower to start (npx resolves the package first) but it always boots, which
|
|
1239
|
+
a managed-install bin path does not guarantee.
|
|
1240
|
+
"""
|
|
1241
|
+
entry = {
|
|
1242
|
+
"command": "npx",
|
|
1243
|
+
"args": ["-y", "--package", f"davinci-resolve-mcp@{package_version()}",
|
|
1244
|
+
"davinci-resolve-advanced-mcp"],
|
|
1245
|
+
}
|
|
1246
|
+
if python_path:
|
|
1247
|
+
entry["env"] = {"AAF_PROBE_PYTHON": str(python_path)}
|
|
1248
|
+
return entry
|
|
1249
|
+
|
|
1250
|
+
|
|
1251
|
+
def package_version(default="latest"):
|
|
1252
|
+
"""Version from package.json, for pinning the npx fallback."""
|
|
1253
|
+
manifest = Path(__file__).resolve().parent / "package.json"
|
|
1254
|
+
try:
|
|
1255
|
+
with open(manifest, "r", encoding="utf-8") as fh:
|
|
1256
|
+
return json.load(fh).get("version") or default
|
|
1257
|
+
except Exception:
|
|
1258
|
+
return default
|
|
1259
|
+
|
|
1260
|
+
|
|
1192
1261
|
# Node floor for the advanced server (package.json engines). Below it the
|
|
1193
1262
|
# pure-JS tools limp along while native-dep paths (better-sqlite3) die with a
|
|
1194
1263
|
# cryptic NODE_MODULE_VERSION mismatch — measured live when a client config's
|
package/package.json
CHANGED
package/src/granular/common.py
CHANGED
|
@@ -87,7 +87,7 @@ if not logging.getLogger().handlers:
|
|
|
87
87
|
handlers=[logging.StreamHandler()],
|
|
88
88
|
)
|
|
89
89
|
|
|
90
|
-
VERSION = "2.
|
|
90
|
+
VERSION = "2.204.0"
|
|
91
91
|
logger = logging.getLogger("davinci-resolve-mcp")
|
|
92
92
|
logger.info(f"Starting DaVinci Resolve MCP Server v{VERSION}")
|
|
93
93
|
logger.info(f"Detected platform: {get_platform()}")
|