davinci-resolve-mcp 2.222.0 → 2.224.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 +93 -0
- package/README.md +4 -4
- package/README.zh-CN.md +5 -5
- package/docs/SKILL.md +5 -1
- package/docs/contributing.md +1 -1
- package/docs/install.md +2 -2
- package/docs/reference/api-coverage.md +5 -1
- package/docs/reference/api-limitations.md +1 -1
- package/docs/reference/resolve211-dctl-validation.md +31 -0
- package/docs/reference/resolve211-encryption.md +48 -0
- package/install.py +2 -2
- package/package.json +1 -1
- package/src/granular/common.py +1 -1
- package/src/granular/resolve_211.py +28 -1
- package/src/resolve_mcp_server.py +1 -1
- package/src/server.py +31 -5
- package/src/utils/api_truth.py +6 -1
- package/src/utils/destructive_hook.py +1 -0
- package/src/utils/execution_lifecycle.py +2 -1
- package/src/utils/resolve211_dctl.py +8 -0
- package/src/utils/resolve211_encryption.py +59 -0
- package/src/utils/resolve_versions.py +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,99 @@
|
|
|
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.224.0 — native Resolve 21.1 DCTL encryption
|
|
6
|
+
|
|
7
|
+
Contributed by @legionsound (#216), live-validated on Studio 21.1.0.14.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **`dctl encrypt_native`**, with the granular twin `encrypt_dctl_native`,
|
|
12
|
+
calling native 21.1 DCTL encryption. The caller supplies an existing `.dctl`
|
|
13
|
+
input, a new `.dctle` output path and an optional expiry; the wrapper reports
|
|
14
|
+
the actual final path, size and hash. Tool count 376 → 377.
|
|
15
|
+
- **A destination is never replaced.** Resolve writes into isolated staging and
|
|
16
|
+
only a verified non-empty regular file is published. The publish uses
|
|
17
|
+
`O_EXCL` creation at `0o600`, so a file that appears *during* encryption
|
|
18
|
+
cannot be clobbered, and the existence check uses `lexists` so a **dangling
|
|
19
|
+
symlink** counts as an occupied destination rather than a free one — the case
|
|
20
|
+
a plain existence test silently gets wrong. The cross-volume fallback removes
|
|
21
|
+
its own partial output if the copy fails.
|
|
22
|
+
- Source bytes are preserved, and the action neither installs nor applies the
|
|
23
|
+
shader.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Classified **LOW** risk rather than MEDIUM, with a destructive-action hook
|
|
28
|
+
entry and dry-run refusal coverage. LOW is the honest rating here: the action
|
|
29
|
+
only ever creates a new file and is incapable of overwriting one, so grouping
|
|
30
|
+
it with operations that rewrite existing work would make the rating mean
|
|
31
|
+
less. Verified: `dctl.encrypt_native` classifies LOW / destructive /
|
|
32
|
+
recognised, and is in the destructive registry.
|
|
33
|
+
- Two native boundaries handled explicitly rather than papered over: Resolve
|
|
34
|
+
appends `.dctle` itself, so a fixed staging stem prevents a doubled suffix on
|
|
35
|
+
a user-supplied name; and an empty expiry string is normalized to null,
|
|
36
|
+
because an isolated probe measured the native call returning false for `""`
|
|
37
|
+
and true for null or omission. Other expiry strings pass through untouched.
|
|
38
|
+
|
|
39
|
+
### Validation
|
|
40
|
+
|
|
41
|
+
- Full suite green: 3,478 passed, 1 skipped. Drift guards, api-parity and read/write
|
|
42
|
+
symmetry all clean with the 377 count.
|
|
43
|
+
- Live evidence is @legionsound's on Studio 21.1.0.14, through both interfaces
|
|
44
|
+
with synthetic identity code: each exported a non-empty file, reported
|
|
45
|
+
correct size and hash, preserved the source bytes, produced owner-only
|
|
46
|
+
permissions, and refused a repeat export without altering the destination.
|
|
47
|
+
Not reproduced here; this machine is Studio 19.1.3.7, below the 21.1 floor.
|
|
48
|
+
- **Not claimed**: that an encrypted shader is accepted by a render, and
|
|
49
|
+
nothing at all about cipher strength. Observed file sizes are recorded as
|
|
50
|
+
observations, not format guarantees.
|
|
51
|
+
- This PR was branched from current `main` and merged **without adaptation** —
|
|
52
|
+
the first in the 21.1 series to need none.
|
|
53
|
+
|
|
54
|
+
## What's New in v2.223.0 — native Resolve 21.1 DCTL validation
|
|
55
|
+
|
|
56
|
+
Contributed by @legionsound (#215), live-validated on Studio 21.1.0.14.
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
|
|
60
|
+
- **`dctl validate_native`**, with the granular twin `validate_dctl_native`,
|
|
61
|
+
calling Resolve 21.1's own `ValidateDCTL`. The existing `dctl validate`
|
|
62
|
+
remains the static offline checker — this is new surface beside it, not a
|
|
63
|
+
change to what that action claims. Tool count 375 → 376.
|
|
64
|
+
- **Source layout is passed through unchanged and native diagnostics are
|
|
65
|
+
returned verbatim.** That is the rule recorded in the ledger back in
|
|
66
|
+
v2.216.1, when @legionsound narrowed `ValidateDCTL` to being sensitive to
|
|
67
|
+
source layout — the same function validates multi-line and fails on one line
|
|
68
|
+
— and it is now implemented rather than merely written down: a wrapper that
|
|
69
|
+
reflowed the user's source to make validation pass would be hiding the very
|
|
70
|
+
behaviour the ledger entry exists to warn about.
|
|
71
|
+
- `None` means valid, strings mean invalid, and an **unexpected native result
|
|
72
|
+
type is an error rather than a false success** — the distinction that keeps a
|
|
73
|
+
changed API from silently reading as "your shader is fine".
|
|
74
|
+
- Version-gated and explicitly classified **read-only**: verified here as LOW /
|
|
75
|
+
non-destructive. It does not install, encrypt, apply or render a DCTL, and
|
|
76
|
+
a successful validation is not a rendered shader test.
|
|
77
|
+
|
|
78
|
+
### Validation
|
|
79
|
+
|
|
80
|
+
- Full suite green: 3,470 passed, 1 skipped. Focused contracts cover CRLF and
|
|
81
|
+
Unicode preservation, so the source that reaches Resolve is byte-for-byte
|
|
82
|
+
what the caller supplied.
|
|
83
|
+
- Live evidence is @legionsound's on Studio 21.1.0.14, checked against the
|
|
84
|
+
official Resolve MCP and both community interfaces: the multi-line identity
|
|
85
|
+
fixture validates, its one-line form reproduces the known missing-return
|
|
86
|
+
diagnostic, and invalid source returns the missing-entry-function
|
|
87
|
+
diagnostic — with both wrappers matching native results exactly. Not
|
|
88
|
+
reproduced here; this machine is Studio 19.1.3.7, below the 21.1 floor.
|
|
89
|
+
- **Not claimed**: encryption, and any statement that validation implies a
|
|
90
|
+
shader renders correctly.
|
|
91
|
+
|
|
92
|
+
### Changed
|
|
93
|
+
|
|
94
|
+
- Adapted on merge, as with #212, #213 and #214: counts resolved to **376**,
|
|
95
|
+
confirmed by the agent-rule generator, generated files regenerated rather
|
|
96
|
+
than hand-merged. No behaviour changed in the adaptation.
|
|
97
|
+
|
|
5
98
|
## What's New in v2.222.0 — native Resolve 21.1 timecode and waveform alignment
|
|
6
99
|
|
|
7
100
|
Contributed by @legionsound (#212), live-validated on Studio 21.1.0.14.
|
package/README.md
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
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
|
-
[-blue.svg)](#server-modes)
|
|
9
9
|
[-18%20tools-blueviolet.svg)](#server-modes)
|
|
10
10
|
[](docs/reference/api-coverage.md#test-results)
|
|
11
11
|
[](https://www.blackmagicdesign.com/products/davinciresolve)
|
|
@@ -133,7 +133,7 @@ The command starts a loopback-only server and opens the control panel in your br
|
|
|
133
133
|
| Mode | Entry point | Tools | Best for |
|
|
134
134
|
|------|-------------|-------|----------|
|
|
135
135
|
| Compound | `src/server.py` | 36 | Default mode for most assistants. Related Resolve operations are grouped behind action parameters to keep context usage low. |
|
|
136
|
-
| Full / granular | `src/server.py --full` or `src/resolve_mcp_server.py` |
|
|
136
|
+
| Full / granular | `src/server.py --full` or `src/resolve_mcp_server.py` | 377 | Power users who want one MCP tool per Resolve API method. |
|
|
137
137
|
|
|
138
138
|
The compound server is recommended unless you specifically need the granular one-tool-per-method surface.
|
|
139
139
|
|
|
@@ -365,7 +365,7 @@ The default server is a local stdio process launched by your MCP client; it does
|
|
|
365
365
|
|
|
366
366
|
| Metric | Value |
|
|
367
367
|
|--------|-------|
|
|
368
|
-
| MCP Tools | **36** compound / **
|
|
368
|
+
| MCP Tools | **36** compound / **377** granular (live server) |
|
|
369
369
|
| Advanced (offline) tools | **18** — .drp/.drt/.drx + DB authoring, no Resolve running |
|
|
370
370
|
| Kernel Actions | **136** guarded workflow actions across 9 compound tools |
|
|
371
371
|
| API Methods Covered | **361/361** (100%) |
|
package/README.zh-CN.md
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
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
|
-
[-blue.svg)](#服务器模式)
|
|
9
9
|
[-18%20tools-blueviolet.svg)](#服务器模式)
|
|
10
10
|
[](docs/reference/api-coverage.md#test-results)
|
|
11
11
|
[](https://www.blackmagicdesign.com/products/davinciresolve)
|
|
12
12
|
[](https://www.python.org/downloads/)
|
|
13
13
|
[](https://opensource.org/licenses/MIT)
|
|
14
14
|
|
|
15
|
-
> 本翻译对应 v2.
|
|
15
|
+
> 本翻译对应 v2.224.0 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
|
|
16
16
|
|
|
17
17
|
一个 Model Context Protocol (MCP) 服务器,让 AI 助手通过官方脚本 API 控制 DaVinci Resolve Studio(达芬奇)。它提供完整的 API 覆盖,外加带护栏的工作流助手,涵盖剪辑、媒体池整理、渲染设置、审阅标记、调色、Fusion、Fairlight、项目生命周期任务、扩展开发,以及不碰源媒体的媒体分析。
|
|
18
18
|
|
|
@@ -88,7 +88,7 @@ venv/bin/python -m src.control_panel
|
|
|
88
88
|
| 模式 | 入口 | 工具数 | 适合谁 |
|
|
89
89
|
|------|------|--------|--------|
|
|
90
90
|
| Compound(复合) | `src/server.py` | 36 | 大多数助手的默认模式。相关的 Resolve 操作按 action 参数分组,压低上下文占用。 |
|
|
91
|
-
| Full / granular(细粒度) | `src/server.py --full` 或 `src/resolve_mcp_server.py` |
|
|
91
|
+
| Full / granular(细粒度) | `src/server.py --full` 或 `src/resolve_mcp_server.py` | 377 | 想要"一个 Resolve API 方法 = 一个 MCP 工具"的重度用户。 |
|
|
92
92
|
|
|
93
93
|
除非你明确需要一方法一工具的细粒度界面,否则推荐复合模式。
|
|
94
94
|
|
|
@@ -226,7 +226,7 @@ DRX 调色写入**针对 Resolve Studio 做过实机校准**:调色参数默
|
|
|
226
226
|
|
|
227
227
|
| 指标 | 数值 |
|
|
228
228
|
|------|------|
|
|
229
|
-
| MCP 工具 | **36** 复合 / **
|
|
229
|
+
| MCP 工具 | **36** 复合 / **377** 细粒度(实时服务器) |
|
|
230
230
|
| Advanced(离线)工具 | **18**——.drp/.drt/.drx + 数据库创作,无需 Resolve 运行 |
|
|
231
231
|
| 内核 action | 9 个复合工具下 **136** 个带护栏的工作流 action |
|
|
232
232
|
| API 方法覆盖 | **361/361**(100%) |
|
package/docs/SKILL.md
CHANGED
|
@@ -345,7 +345,7 @@ to the user as verified.
|
|
|
345
345
|
| Mode | Entry point | Tool count | Use when |
|
|
346
346
|
|---|---|---|---|
|
|
347
347
|
| Compound (default) | `src/server.py` | 36 tools | Most workflows — keeps context lean |
|
|
348
|
-
| Granular (full) | `src/server.py --full` |
|
|
348
|
+
| Granular (full) | `src/server.py --full` | 377 tools | Power users needing one tool per API method |
|
|
349
349
|
|
|
350
350
|
Resolve 21.1 adds [twelve read-only discovery controls](reference/resolve211-read-controls.md)
|
|
351
351
|
for edition, presets, audio formats/codecs, normalization modes, speed, fades
|
|
@@ -2490,3 +2490,7 @@ Native timeline/clip output blanking: [21.1 controls](reference/resolve211-blank
|
|
|
2490
2490
|
Native audio normalization: [21.1 controls](reference/resolve211-normalization.md), with independently measured exported-audio evidence.
|
|
2491
2491
|
|
|
2492
2492
|
Native timecode/waveform alignment: [21.1 controls](reference/resolve211-alignment.md), including linked-item selection semantics and rendered video/audio evidence.
|
|
2493
|
+
|
|
2494
|
+
Resolve-native DCTL validation: [21.1 controls](reference/resolve211-dctl-validation.md), separate from static validation and shader rendering.
|
|
2495
|
+
|
|
2496
|
+
Native DCTL encryption: [21.1 controls](reference/resolve211-encryption.md), with explicit destination handling and export-evidence limits.
|
package/docs/contributing.md
CHANGED
|
@@ -64,7 +64,7 @@ davinci-resolve-mcp/
|
|
|
64
64
|
├── install.py # Universal installer (macOS/Windows/Linux)
|
|
65
65
|
├── src/
|
|
66
66
|
│ ├── server.py # Compound MCP server — 36 tools (default)
|
|
67
|
-
│ ├── resolve_mcp_server.py # Thin full-server entrypoint —
|
|
67
|
+
│ ├── resolve_mcp_server.py # Thin full-server entrypoint — 377 tools
|
|
68
68
|
│ ├── granular/ # Modular full-server implementation
|
|
69
69
|
│ └── utils/ # Platform detection, Resolve connection helpers
|
|
70
70
|
├── tests/ # offline suite (test_*.py) + live harnesses (live_*.py):
|
package/docs/install.md
CHANGED
|
@@ -144,7 +144,7 @@ The MCP server comes in two modes:
|
|
|
144
144
|
| Mode | File | Tools | Best For |
|
|
145
145
|
|------|------|-------|----------|
|
|
146
146
|
| **Compound** (default) | `src/server.py` | 36 | Most users — fast, clean, low context usage |
|
|
147
|
-
| **Full** | `src/resolve_mcp_server.py` |
|
|
147
|
+
| **Full** | `src/resolve_mcp_server.py` | 377 | Power users who want one tool per API method |
|
|
148
148
|
|
|
149
149
|
The compound server's `timeline_item` tool includes dedicated actions for common workflows:
|
|
150
150
|
|
|
@@ -159,7 +159,7 @@ The compound server's `timeline_item` tool includes dedicated actions for common
|
|
|
159
159
|
|
|
160
160
|
The installer uses the compound server by default. To use the full server:
|
|
161
161
|
```bash
|
|
162
|
-
python src/server.py --full # Launch full
|
|
162
|
+
python src/server.py --full # Launch full 377-tool server
|
|
163
163
|
# Or point your MCP config directly at src/resolve_mcp_server.py
|
|
164
164
|
```
|
|
165
165
|
|
|
@@ -25,7 +25,7 @@ Every non-deprecated method in the bundled legacy README is represented. This
|
|
|
25
25
|
does not claim complete coverage of the newer Resolve 21.1 typed API. The
|
|
26
26
|
default compound server exposes **36 tools** that group related operations by
|
|
27
27
|
action parameter, keeping LLM context windows lean. The full granular server
|
|
28
|
-
provides **
|
|
28
|
+
provides **377 individual tools** for power users. The legacy coverage spans
|
|
29
29
|
13 API object classes. MCP-level kernel actions are tracked separately in
|
|
30
30
|
[Kernel Action Coverage](../kernels/README.md).
|
|
31
31
|
|
|
@@ -640,3 +640,7 @@ Native timeline/clip output blanking: [21.1 controls](resolve211-blanking.md), w
|
|
|
640
640
|
Native audio normalization: [21.1 controls](resolve211-normalization.md), with independently measured exported-audio evidence.
|
|
641
641
|
|
|
642
642
|
Native timecode/waveform alignment: [21.1 controls](resolve211-alignment.md), including linked-item selection semantics and rendered video/audio evidence.
|
|
643
|
+
|
|
644
|
+
Resolve-native DCTL validation: [21.1 controls](resolve211-dctl-validation.md), separate from static validation and shader rendering.
|
|
645
|
+
|
|
646
|
+
Native DCTL encryption: [21.1 controls](resolve211-encryption.md), with explicit destination handling and export-evidence limits.
|
|
@@ -766,5 +766,5 @@ values, or automation-hostile modal prompts.
|
|
|
766
766
|
- **Object:** `Resolve`
|
|
767
767
|
- **Signature:** `(dctlSource) -> str | None (21.1+)`
|
|
768
768
|
- **Behavior:** Reported by @legionsound (issue #207) from Studio 21.1.0.14 on macOS; NOT reproduced here (no 21.1 install). The documented success result is None. A minimal identity transform written across several lines — `__DEVICE__ float3 transform(...)` with the body on its own lines — validates (None). The SAME function collapsed onto one line consistently returns 'DCTL Error: main DCTL function does not have return value.', which is false: the return statement is there. A genuinely invalid source returns 'cannot find main DCTL function.', so the validator does distinguish; it is the single-line layout it misreads. An earlier multi-line timeout did not reproduce after a Resolve restart with a 30-second limit. Nothing establishes a GPU compiler or render defect — this is the validator's parse, not the DCTL's execution. EncryptDCTL untested.
|
|
769
|
-
- **Workaround / current handling:** Any wrapper around ValidateDCTL must pass the native diagnostic through verbatim and must not reflow or rewrite the user's source to dodge it; ship the multi-line identity fixture as the known-good control. A 'no return value' error on a one-line function is this quirk, not a missing return — re-run the validation with the function laid out across lines before believing it. This server's own `dctl validate` is a static, offline check (entry point, brace balance, float suffixes) and does not call ValidateDCTL at all.
|
|
769
|
+
- **Workaround / current handling:** Any wrapper around ValidateDCTL must pass the native diagnostic through verbatim and must not reflow or rewrite the user's source to dodge it; ship the multi-line identity fixture as the known-good control. A 'no return value' error on a one-line function is this quirk, not a missing return — re-run the validation with the function laid out across lines before believing it. This server's own `dctl validate` is a static, offline check (entry point, brace balance, float suffixes) and does not call ValidateDCTL at all. The separate `dctl validate_native` and granular `validate_dctl_native` now expose the native validator without changing source or diagnostics. Both interfaces were contributor-validated against the three fixtures on Studio 21.1.0.14; see resolve211-dctl-validation.md.
|
|
770
770
|
- **Tags:** dctl, validation, unreliable-return, version-gated, reported
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Native DCTL validation in Resolve 21.1
|
|
2
|
+
|
|
3
|
+
Compound `dctl validate_native` and granular `validate_dctl_native` accept a
|
|
4
|
+
`source` string and call Resolve.ValidateDCTL. They return `valid`, `diagnostic`
|
|
5
|
+
and `checker: resolve_native`. The source is passed unchanged, including its
|
|
6
|
+
line layout. Native None means valid; a native string means invalid and is
|
|
7
|
+
returned verbatim, including whitespace. An unexpected native result type is a
|
|
8
|
+
protocol error, not a claim that the shader validated.
|
|
9
|
+
|
|
10
|
+
The existing `dctl validate` remains the static offline checker. Native validation
|
|
11
|
+
requires running Resolve 21.1 and a callable ValidateDCTL method. It does not
|
|
12
|
+
install a DCTL, encrypt it, apply a grade or render the shader. A successful
|
|
13
|
+
validation is not rendered-output evidence. The granular tool is read-only and
|
|
14
|
+
the compound action is explicitly classified as non-destructive.
|
|
15
|
+
|
|
16
|
+
## Contributor validation
|
|
17
|
+
|
|
18
|
+
Contributor-validated on macOS Studio 21.1.0.14 against the official MCP and both
|
|
19
|
+
actual community interfaces. The multiline identity fixture returns None. The
|
|
20
|
+
same function on one line returns `DCTL Error: main DCTL function does not have
|
|
21
|
+
return value.` Invalid source returns `cannot find main DCTL function.` Both
|
|
22
|
+
wrappers preserve these diagnostics exactly. The source-layout limitation is
|
|
23
|
+
already in api_truth; this wrapper exposes it honestly rather than reformatting
|
|
24
|
+
user code to hide it.
|
|
25
|
+
|
|
26
|
+
`python tests/live_resolve211_dctl.py` compares raw/native and both wrapper
|
|
27
|
+
results for all three fixtures. It neither changes projects nor installs files.
|
|
28
|
+
Unit tests also cover verbatim CRLF/Unicode source and diagnostic handling,
|
|
29
|
+
invalid inputs, missing methods, unexpected native result types, read-only risk
|
|
30
|
+
classification and preservation of the static checker route. Encryption and
|
|
31
|
+
actual GPU execution remain separate work.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Native Resolve 21.1 DCTL encryption
|
|
2
|
+
|
|
3
|
+
Compound `dctl encrypt_native` and granular `encrypt_dctl_native` accept
|
|
4
|
+
`input_path`, `output_path` and optional `expiry`. Input must be an existing .dctl;
|
|
5
|
+
output must be a new .dctle. Existing destinations, including dangling symlinks,
|
|
6
|
+
are refused. The source is never modified by the wrapper.
|
|
7
|
+
|
|
8
|
+
The native Name and OutputFolder options are derived from an isolated staging
|
|
9
|
+
file, then the completed file is published to the requested output path. This
|
|
10
|
+
avoids native filename surprises: Resolve appends .dctle even when Name already
|
|
11
|
+
ends with that suffix. Expiry null/omission means no expiry. Empty string is
|
|
12
|
+
normalized to null because native empty-string expiry returned false in the
|
|
13
|
+
contributor fixture while null succeeded. Other strings pass through as native
|
|
14
|
+
ISO 8601 expiry requests; native failure is preserved.
|
|
15
|
+
|
|
16
|
+
Resolve-facing staging uses the existing safe-directory helper. A successful
|
|
17
|
+
native return must be accompanied by a non-empty regular encrypted file. An
|
|
18
|
+
atomic no-replace hard link publishes it; filesystems without that support use
|
|
19
|
+
exclusive file creation and copy. A failed copy removes only the new partial
|
|
20
|
+
output. An output appearing during encryption is not overwritten. New files
|
|
21
|
+
use owner-only permissions where the platform supports them. The result reports
|
|
22
|
+
actual path, byte length and SHA-256, not a guessed native filename.
|
|
23
|
+
|
|
24
|
+
The method has a 21.1 floor. The dctl tool has the destructive-action hook, and
|
|
25
|
+
encrypt_native is registered/rated LOW because it only creates new output and
|
|
26
|
+
never replaces existing content. Explicit compound dry runs refuse before the
|
|
27
|
+
handler. The granular tool declares a write. No DCTL is installed or applied by
|
|
28
|
+
this operation.
|
|
29
|
+
|
|
30
|
+
## Contributor evidence and limits
|
|
31
|
+
|
|
32
|
+
Contributor-validated on macOS Studio 21.1.0.14 via official MCP probes and both
|
|
33
|
+
actual community wrappers, using a synthetic multiline identity shader. Native
|
|
34
|
+
omitted/null expiry and a future date succeeded; empty string returned false in
|
|
35
|
+
the isolated probe. Both wrappers created 2032-byte files in the tested runs,
|
|
36
|
+
returned matching file hashes/sizes, left source bytes unchanged and refused a
|
|
37
|
+
repeat export without changing the destination. These byte lengths are observed,
|
|
38
|
+
not format requirements. Ciphertext equality across separate encryptions is not
|
|
39
|
+
assumed.
|
|
40
|
+
|
|
41
|
+
Tests exercise output races, missing native output, native false, cross-volume
|
|
42
|
+
fallback, failed-copy cleanup, dangling symlinks, bad arguments and write gates.
|
|
43
|
+
This is encryption/export evidence, not shader application or rendered-image
|
|
44
|
+
acceptance, and not a security assessment of Blackmagic's encryption scheme.
|
|
45
|
+
|
|
46
|
+
`tests/live_resolve211_encryption.py SOURCE_DCTL OUTPUT_DIR` uses a synthetic
|
|
47
|
+
identity source and a fresh output directory. It does not install the results or
|
|
48
|
+
change a project. Never substitute someone else's shader without authorization.
|
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.224.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
|
|
@@ -1543,7 +1543,7 @@ def verify_resolve_connection(python_path, api_path, lib_path):
|
|
|
1543
1543
|
|
|
1544
1544
|
def print_banner():
|
|
1545
1545
|
title = f"DaVinci Resolve MCP Server — Installer v{VERSION}"
|
|
1546
|
-
subtitle = "36 compound ·
|
|
1546
|
+
subtitle = "36 compound · 377 full · 3 platforms"
|
|
1547
1547
|
print()
|
|
1548
1548
|
print(bold(" ╔══════════════════════════════════════════════════════╗"))
|
|
1549
1549
|
print(bold(f" ║{title:^54}║"))
|
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.224.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()}")
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"""Native Resolve 21.1 discovery and editing controls."""
|
|
2
|
+
from src.utils.resolve211_dctl import native_dctl_result
|
|
2
3
|
from src.utils.resolve211_alignment import auto_align
|
|
3
4
|
from src.utils.resolve211_normalization import normalize_audio
|
|
4
5
|
from src.utils.resolve211_blanking import validate_blanking
|
|
6
|
+
from src.utils.resolve211_encryption import encrypt_dctl
|
|
5
7
|
from src.utils.resolve211_multicam import create_multicam, resolve_constant, GRADES
|
|
6
8
|
from src.utils.resolve211_edits import validate_edit_options, validate_transition_options, transition_result
|
|
7
9
|
from src.granular.common import (
|
|
8
10
|
mcp, READ_ONLY_TOOL, WRITE_TOOL, DESTRUCTIVE_TOOL, get_resolve, get_current_project,
|
|
9
|
-
_get_timeline, _get_timeline_item, _find_clip_by_id, _requires_method, has_method,
|
|
11
|
+
_get_timeline, _get_timeline_item, _resolve_safe_dir, _find_clip_by_id, _requires_method, has_method,
|
|
10
12
|
)
|
|
11
13
|
|
|
12
14
|
|
|
@@ -304,3 +306,28 @@ def auto_align_timeline_clips(item_ids: list[str], options: dict | None = None)
|
|
|
304
306
|
if missing:
|
|
305
307
|
return missing
|
|
306
308
|
return auto_align(get_resolve(), timeline, item_ids, {} if options is None else options)
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
@mcp.tool(annotations=READ_ONLY_TOOL)
|
|
312
|
+
def validate_dctl_native(source: str) -> dict:
|
|
313
|
+
"""Validate shader source with Resolve 21.1. Source layout and native diagnostics are preserved; success means validation, not a rendered shader test."""
|
|
314
|
+
if not isinstance(source, str):
|
|
315
|
+
return {"error": "source must be a string"}
|
|
316
|
+
r = get_resolve()
|
|
317
|
+
if r is None:
|
|
318
|
+
return {"error": "Not connected to DaVinci Resolve"}
|
|
319
|
+
missing = _requires_method(r, "ValidateDCTL", "21.1")
|
|
320
|
+
if missing:
|
|
321
|
+
return missing
|
|
322
|
+
return native_dctl_result(r, source)
|
|
323
|
+
|
|
324
|
+
@mcp.tool(annotations=WRITE_TOOL)
|
|
325
|
+
def encrypt_dctl_native(input_path: str, output_path: str, expiry: str | None = None) -> dict:
|
|
326
|
+
"""Encrypt a .dctl to a new .dctle using Resolve 21.1. Never overwrites. Empty/null expiry means no expiry; ISO 8601 strings pass to Resolve. Source is unchanged."""
|
|
327
|
+
r = get_resolve()
|
|
328
|
+
if r is None:
|
|
329
|
+
return {"error": "Not connected to DaVinci Resolve"}
|
|
330
|
+
missing = _requires_method(r, "EncryptDCTL", "21.1")
|
|
331
|
+
if missing:
|
|
332
|
+
return missing
|
|
333
|
+
return encrypt_dctl(r, input_path, output_path, expiry, _resolve_safe_dir)
|
|
@@ -34,7 +34,7 @@ from src.utils.update_check import start_background_update_check
|
|
|
34
34
|
if __name__ == "__main__":
|
|
35
35
|
try:
|
|
36
36
|
start_background_update_check(VERSION, project_dir, logger)
|
|
37
|
-
logger.info(f"Starting DaVinci Resolve MCP Server v{VERSION} (
|
|
37
|
+
logger.info(f"Starting DaVinci Resolve MCP Server v{VERSION} (377 granular tools)")
|
|
38
38
|
run_fastmcp_stdio(mcp)
|
|
39
39
|
except KeyboardInterrupt:
|
|
40
40
|
logger.info("Server shutdown requested")
|
package/src/server.py
CHANGED
|
@@ -8,10 +8,10 @@ Each tool groups related operations via an 'action' parameter.
|
|
|
8
8
|
|
|
9
9
|
Usage:
|
|
10
10
|
python src/server.py # Start the MCP server
|
|
11
|
-
python src/server.py --full # Start the
|
|
11
|
+
python src/server.py --full # Start the 377-tool granular server instead
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
|
-
VERSION = "2.
|
|
14
|
+
VERSION = "2.224.0"
|
|
15
15
|
|
|
16
16
|
import base64
|
|
17
17
|
import os
|
|
@@ -42,9 +42,11 @@ for p in [current_dir, project_dir]:
|
|
|
42
42
|
if p not in sys.path:
|
|
43
43
|
sys.path.insert(0, p)
|
|
44
44
|
|
|
45
|
+
from src.utils.resolve211_encryption import encrypt_dctl
|
|
45
46
|
from src.utils.resolve211_multicam import create_multicam, resolve_constant, GRADES
|
|
46
47
|
from src.utils.resolve211_blanking import validate_blanking
|
|
47
48
|
from src.utils.resolve211_alignment import auto_align
|
|
49
|
+
from src.utils.resolve211_dctl import native_dctl_result
|
|
48
50
|
from src.utils.resolve211_normalization import normalize_audio
|
|
49
51
|
from src.utils.resolve211_edits import validate_edit_options, validate_transition_options, transition_result
|
|
50
52
|
|
|
@@ -31113,6 +31115,7 @@ _DCTL_VALID_CATEGORIES = ("lut", "aces_idt", "aces_odt")
|
|
|
31113
31115
|
|
|
31114
31116
|
@mcp.tool()
|
|
31115
31117
|
@_guard_missing_params
|
|
31118
|
+
@_destructive_op("dctl")
|
|
31116
31119
|
def dctl(action: str, params: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
|
|
31117
31120
|
"""Author and install DCTL files (Color page custom shaders + ACES transforms).
|
|
31118
31121
|
|
|
@@ -31141,7 +31144,9 @@ def dctl(action: str, params: Optional[Dict[str, Any]] = None) -> Dict[str, Any]
|
|
|
31141
31144
|
— ext: '.dctl' (default) or '.dctle' (encrypted)
|
|
31142
31145
|
remove(name, category?, subdir?, ext?) -> {success}
|
|
31143
31146
|
read(name, category?, subdir?, ext?) -> {source, encrypted}
|
|
31147
|
+
encrypt_native(input_path, output_path, expiry?) -> {success, path?, bytes?, sha256?} — native 21.1; never overwrites.
|
|
31144
31148
|
validate(source) -> {valid, errors, warnings, checker}
|
|
31149
|
+
validate_native(source) -> {valid, diagnostic, checker} — Resolve 21.1 validation; source and diagnostic unchanged.
|
|
31145
31150
|
template(kind, name, options?) -> {source, kind, name, suggested_category}
|
|
31146
31151
|
— kind: 'transform' | 'transform_alpha' | 'transition' | 'matrix' |
|
|
31147
31152
|
'kernel' | 'lut_apply' | 'aces_idt' | 'aces_odt'
|
|
@@ -31295,6 +31300,27 @@ def dctl(action: str, params: Optional[Dict[str, Any]] = None) -> Dict[str, Any]
|
|
|
31295
31300
|
return {"source": src, "path": target,
|
|
31296
31301
|
"encrypted": ext == ".dctle", "category": cat}
|
|
31297
31302
|
|
|
31303
|
+
if action == "validate_native":
|
|
31304
|
+
source = p.get("source")
|
|
31305
|
+
if not isinstance(source, str):
|
|
31306
|
+
return _err("validate_native requires a source string")
|
|
31307
|
+
r = get_resolve()
|
|
31308
|
+
if r is None:
|
|
31309
|
+
return _not_connected_error()
|
|
31310
|
+
missing = _requires_method(r, "ValidateDCTL", "21.1")
|
|
31311
|
+
if missing:
|
|
31312
|
+
return missing
|
|
31313
|
+
return native_dctl_result(r, source)
|
|
31314
|
+
|
|
31315
|
+
if action == "encrypt_native":
|
|
31316
|
+
r = get_resolve()
|
|
31317
|
+
if r is None:
|
|
31318
|
+
return _not_connected_error()
|
|
31319
|
+
missing = _requires_method(r, "EncryptDCTL", "21.1")
|
|
31320
|
+
if missing:
|
|
31321
|
+
return missing
|
|
31322
|
+
return encrypt_dctl(r, p.get("input_path"), p.get("output_path"), p.get("expiry"), _resolve_safe_dir)
|
|
31323
|
+
|
|
31298
31324
|
if action == "validate":
|
|
31299
31325
|
source = p.get("source")
|
|
31300
31326
|
if not isinstance(source, str):
|
|
@@ -31321,7 +31347,7 @@ def dctl(action: str, params: Optional[Dict[str, Any]] = None) -> Dict[str, Any]
|
|
|
31321
31347
|
}
|
|
31322
31348
|
|
|
31323
31349
|
return _unknown(action, ["path", "list", "install", "remove", "read",
|
|
31324
|
-
"validate", "template", "list_templates"])
|
|
31350
|
+
"encrypt_native", "validate_native", "validate", "template", "list_templates"])
|
|
31325
31351
|
|
|
31326
31352
|
|
|
31327
31353
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
@@ -32737,9 +32763,9 @@ if __name__ == "__main__":
|
|
|
32737
32763
|
start_background_update_check(VERSION, project_dir, logger, env=_setup_update_env())
|
|
32738
32764
|
_install_threaded_tool_dispatch(mcp)
|
|
32739
32765
|
|
|
32740
|
-
# Support --full flag to run the
|
|
32766
|
+
# Support --full flag to run the 377-tool granular server instead
|
|
32741
32767
|
if "--full" in sys.argv:
|
|
32742
|
-
logger.info("Starting full
|
|
32768
|
+
logger.info("Starting full 377-tool granular server...")
|
|
32743
32769
|
sys.argv = [arg for arg in sys.argv if arg != "--full"]
|
|
32744
32770
|
from src.granular import mcp as granular_mcp
|
|
32745
32771
|
|
package/src/utils/api_truth.py
CHANGED
|
@@ -3263,7 +3263,12 @@ API_TRUTH: List[Dict[str, Any]] = [
|
|
|
3263
3263
|
"across lines before believing it. This server's own "
|
|
3264
3264
|
"`dctl validate` is a static, offline check (entry point, "
|
|
3265
3265
|
"brace balance, float suffixes) and does not call "
|
|
3266
|
-
"ValidateDCTL at all."
|
|
3266
|
+
"ValidateDCTL at all. The separate `dctl validate_native` and "
|
|
3267
|
+
"granular `validate_dctl_native` now expose the native "
|
|
3268
|
+
"validator without changing source or diagnostics. Both "
|
|
3269
|
+
"interfaces were contributor-validated against the three "
|
|
3270
|
+
"fixtures on Studio 21.1.0.14; see "
|
|
3271
|
+
"resolve211-dctl-validation.md.",
|
|
3267
3272
|
"tags": ["dctl", "validation", "unreliable-return", "version-gated", "reported"],
|
|
3268
3273
|
"submit": "bug",
|
|
3269
3274
|
},
|
|
@@ -63,6 +63,7 @@ SAFE_MODE_BLOCKED_RISK_LEVELS: FrozenSet[str] = frozenset({
|
|
|
63
63
|
# replace_clip/link_*). The test_destructive_registry_drift guard asserts every
|
|
64
64
|
# string here is a real handler so this can't regress.
|
|
65
65
|
DESTRUCTIVE_ACTIONS_BY_TOOL: Dict[str, FrozenSet[str]] = {
|
|
66
|
+
"dctl": frozenset({"encrypt_native"}),
|
|
66
67
|
"media_pool": frozenset({
|
|
67
68
|
"delete_clips",
|
|
68
69
|
"delete_folders",
|
|
@@ -193,6 +193,7 @@ class RiskClassificationHook(LifecycleHook):
|
|
|
193
193
|
#: them unrecognised, i.e. it warns that the risk is unestablished for the
|
|
194
194
|
#: actions whose risk is the best established of any we dispatch.
|
|
195
195
|
_LOW_RISK_ACTIONS: Set[Tuple[str, str]] = {
|
|
196
|
+
("dctl", "encrypt_native"), # Creates a new file; never replaces existing content.
|
|
196
197
|
("timeline_markers", "add"),
|
|
197
198
|
("timeline_markers", "update_custom_data"),
|
|
198
199
|
("timeline_item_markers", "add"),
|
|
@@ -404,7 +405,7 @@ class RiskClassificationHook(LifecycleHook):
|
|
|
404
405
|
else BlastRadius.ITEM
|
|
405
406
|
)
|
|
406
407
|
reasons.append(f"Recoverable edit to existing state: {action}")
|
|
407
|
-
elif any(action.startswith(p) for p in cls._READ_ONLY_PREFIXES) or action in {"read", "status", "info"}:
|
|
408
|
+
elif any(action.startswith(p) for p in cls._READ_ONLY_PREFIXES) or action in {"read", "status", "info"} or pair == ("dctl", "validate_native"):
|
|
408
409
|
level = RiskLevel.LOW
|
|
409
410
|
destructive = False
|
|
410
411
|
radius = BlastRadius.ITEM
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"""Native DCTL diagnostics are evidence; never reformat the user's shader source."""
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def native_dctl_result(resolve, source):
|
|
5
|
+
diagnostic=resolve.ValidateDCTL(source)
|
|
6
|
+
if diagnostic is not None and not isinstance(diagnostic,str):
|
|
7
|
+
return {'error':'ValidateDCTL returned an unexpected diagnostic type'}
|
|
8
|
+
return {'valid':diagnostic is None,'diagnostic':diagnostic,'checker':'resolve_native'}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""Stage native DCTL encryption, then publish without replacing an existing file."""
|
|
2
|
+
import errno
|
|
3
|
+
import hashlib
|
|
4
|
+
import os
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
import shutil
|
|
7
|
+
import tempfile
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def encrypt_dctl(r, input_path, output_path, expiry, safe_dir):
|
|
11
|
+
if not isinstance(input_path,str) or not input_path or not isinstance(output_path,str) or not output_path:
|
|
12
|
+
return {'error':'input_path and output_path must be non-empty strings'}
|
|
13
|
+
if expiry is not None and not isinstance(expiry,str):
|
|
14
|
+
return {'error':'expiry must be an ISO 8601 string or null'}
|
|
15
|
+
source=Path(input_path).expanduser().absolute()
|
|
16
|
+
target=Path(output_path).expanduser().absolute()
|
|
17
|
+
if source.suffix.lower()!='.dctl' or not source.is_file():
|
|
18
|
+
return {'error':'input_path must name an existing .dctl file'}
|
|
19
|
+
if target.suffix.lower()!='.dctle':
|
|
20
|
+
return {'error':'output_path must end in .dctle'}
|
|
21
|
+
if os.path.lexists(target):
|
|
22
|
+
return {'error':'Output already exists; refusing to overwrite','success':False}
|
|
23
|
+
try:
|
|
24
|
+
target.parent.mkdir(parents=True,exist_ok=True)
|
|
25
|
+
staging_root=Path(safe_dir(str(target.parent.resolve())))
|
|
26
|
+
staging_root.mkdir(parents=True,exist_ok=True)
|
|
27
|
+
with tempfile.TemporaryDirectory(prefix='resolve-mcp-dctl-',dir=staging_root) as stage:
|
|
28
|
+
# Native Name is a stem: Resolve appends .dctle itself. Use a fixed
|
|
29
|
+
# staging name, so user filename characters never become native paths.
|
|
30
|
+
options={'Name':'encrypted','OutputFolder':stage,'Expiry':None if expiry=='' else expiry}
|
|
31
|
+
if not r.EncryptDCTL(str(source),options):
|
|
32
|
+
return {'success':False}
|
|
33
|
+
encrypted=Path(stage)/'encrypted.dctle'
|
|
34
|
+
if encrypted.is_symlink() or not encrypted.is_file() or encrypted.stat().st_size==0:
|
|
35
|
+
return {'success':False,'error':'Resolve reported success without a non-empty encrypted file'}
|
|
36
|
+
os.chmod(encrypted,0o600)
|
|
37
|
+
digest=hashlib.sha256(encrypted.read_bytes()).hexdigest()
|
|
38
|
+
size=encrypted.stat().st_size
|
|
39
|
+
try:
|
|
40
|
+
os.link(encrypted,target)
|
|
41
|
+
except OSError as exc:
|
|
42
|
+
if exc.errno not in (errno.EXDEV,errno.EPERM,errno.EOPNOTSUPP,errno.ENOSYS):
|
|
43
|
+
raise
|
|
44
|
+
# Cross-volume/no-hardlink filesystem: exclusive creation still
|
|
45
|
+
# prevents overwriting an existing target, including a symlink.
|
|
46
|
+
fd=os.open(target,os.O_WRONLY|os.O_CREAT|os.O_EXCL,0o600)
|
|
47
|
+
try:
|
|
48
|
+
with os.fdopen(fd,'wb') as out, encrypted.open('rb') as src:
|
|
49
|
+
shutil.copyfileobj(src,out)
|
|
50
|
+
out.flush()
|
|
51
|
+
os.fsync(out.fileno())
|
|
52
|
+
except BaseException:
|
|
53
|
+
target.unlink(missing_ok=True)
|
|
54
|
+
raise
|
|
55
|
+
return {'success':True,'path':str(target),'bytes':size,'sha256':digest}
|
|
56
|
+
except FileExistsError:
|
|
57
|
+
return {'success':False,'error':'Output appeared during encryption; refusing to overwrite'}
|
|
58
|
+
except Exception as exc:
|
|
59
|
+
return {'success':False,'error':'Encryption/export failed: '+(str(exc) or type(exc).__name__)}
|
|
@@ -226,6 +226,9 @@ _EVIDENCE_GATES: List[Dict[str, Any]] = [
|
|
|
226
226
|
|
|
227
227
|
CODE_FLOORS: Dict[str, str] = {
|
|
228
228
|
"Timeline.AutoAlignClips": "21.1",
|
|
229
|
+
"Resolve.ValidateDCTL": "21.1",
|
|
230
|
+
|
|
231
|
+
"Resolve.EncryptDCTL": "21.1",
|
|
229
232
|
"MediaPool.CreateMulticamClip": "21.1",
|
|
230
233
|
"TimelineItem.FlattenMulticam": "21.1",
|
|
231
234
|
"Timeline.SetOutputBlanking": "21.1",
|