davinci-resolve-mcp 2.210.1 → 2.212.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 +70 -0
- package/README.md +1 -1
- package/README.zh-CN.md +2 -2
- package/docs/SKILL.md +11 -3
- package/install.py +1 -1
- package/package.json +1 -1
- package/src/granular/common.py +1 -1
- package/src/server.py +1 -1
- package/src/utils/destructive_hook.py +121 -0
- package/src/utils/execution_lifecycle.py +49 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,76 @@
|
|
|
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.212.0 — graph risk follows the graph the call targets
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **Every `graph` mutation now reports the blast radius of its `source`.**
|
|
10
|
+
The graph tool resolves `source` as `"timeline"` (the DEFAULT, the
|
|
11
|
+
timeline-level node graph), `"item"` (one clip), or
|
|
12
|
+
`"color_group_pre"`/`"color_group_post"` (a group's shared graph), and every
|
|
13
|
+
mutation lands on whichever graph that names. The classifier reported all
|
|
14
|
+
five graph actions as item-scoped regardless, so `reset_all_grades` on a
|
|
15
|
+
color-group graph — which wipes the grade of every clip in the group — read
|
|
16
|
+
as one item. The radius is now derived from the call: timeline, item, or
|
|
17
|
+
project for a color group, and the reasons name the target graph.
|
|
18
|
+
|
|
19
|
+
- **`graph.set_lut` and `graph.apply_arri_cdl_lut` are HIGH on the timeline or a color-group graph, MEDIUM on one item.**
|
|
20
|
+
A plain `set_lut` call with no `source` restyles every clip on the timeline;
|
|
21
|
+
rating that MEDIUM under-stated it, while rating the item-scoped call HIGH
|
|
22
|
+
would over-block a one-clip LUT. Safe mode now blocks the broad cases
|
|
23
|
+
unless `allow_risky_operation=true`; the item case passes as before.
|
|
24
|
+
`reset_all_grades` and `apply_grade_from_drx` stay HIGH, `set_node_enabled`
|
|
25
|
+
stays LOW — only their reported scope changed.
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- Tests: safe mode blocks broad LUT writes before the handler and allows
|
|
30
|
+
item-scoped ones; the classifier's LUT split; the radius of every graph
|
|
31
|
+
action across all five source values; and a medium-band matrix pinning
|
|
32
|
+
every remaining MEDIUM destructive action as recognised, destructive, not
|
|
33
|
+
confirmation-gated, and carrying its reviewed radius.
|
|
34
|
+
|
|
35
|
+
- Adapted from PR #192 by @Rohitkanithi, which introduced the scope split
|
|
36
|
+
and its tests for the two LUT actions; landed with the radius generalised
|
|
37
|
+
to every graph action, since the same `source` governs them all.
|
|
38
|
+
|
|
39
|
+
## What's New in v2.211.0 — dry_run on an action that cannot honour it now refuses instead of executing
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- **An explicit `dry_run=true` on a destructive action with no native dry-run path is refused, not executed.**
|
|
44
|
+
102 of the 108 registered destructive actions never read the flag, so
|
|
45
|
+
`timeline_markers.add` with `dry_run=true` added a real marker and
|
|
46
|
+
`timeline.delete_track` with `dry_run=true` deleted the track — and the
|
|
47
|
+
agent guidance says to prefer `dry_run` where it exists, which cannot be
|
|
48
|
+
told from outside. The destructive-operation wrapper now returns
|
|
49
|
+
`DRY_RUN_UNAVAILABLE` (`status: dry_run_unavailable`, `dry_run: true`,
|
|
50
|
+
`simulated: false`, `executed: false`, the same static risk block as
|
|
51
|
+
`inspect_operation`, and a remediation) before any archive, state lookup,
|
|
52
|
+
or handler execution. The security audit log records it as
|
|
53
|
+
`blocked` / `dry_run_unavailable`. This is a refusal, not a synthesised
|
|
54
|
+
preview — the lifecycle pipeline's original interceptor answered
|
|
55
|
+
`success: true` for calls it never ran and was removed for it.
|
|
56
|
+
|
|
57
|
+
- **The six actions that do honour `dry_run` are an allowlist, `NATIVE_DRY_RUN_ACTIONS`.**
|
|
58
|
+
`media_pool.set_clip_marks`, `media_pool.clear_clip_marks`,
|
|
59
|
+
`media_pool.setup_multicam_timeline`, `timeline.apply_cuts`,
|
|
60
|
+
`timeline.ripple_insert`, `timeline_ai.create_subtitles`. A static drift
|
|
61
|
+
test pins the list to the handlers by following the params object into
|
|
62
|
+
helper calls; that is what excluded `edit_engine.execute_tighten` and
|
|
63
|
+
`execute_silence_ripple`, which call a dry_run-aware helper but hand it a
|
|
64
|
+
fresh dict without the flag. Add a native dry-run branch and the test says
|
|
65
|
+
to list it; list an action without one and the test refuses.
|
|
66
|
+
|
|
67
|
+
- **The refusal is keyed on registry membership, not on `is_destructive()`**, so
|
|
68
|
+
the no-archive filters (a Notes edit) cannot let a dry-run request through to
|
|
69
|
+
a handler that would execute it.
|
|
70
|
+
|
|
71
|
+
- Adapted from PR #190 by @Rohitkanithi, which introduced the refusal shape
|
|
72
|
+
as a denylist of the fourteen marker actions; landed as an allowlist so the
|
|
73
|
+
other 88 actions that ignore the flag are covered too.
|
|
74
|
+
|
|
5
75
|
## What's New in v2.210.1 — frame capture and verify_output no longer read JobStatus in English
|
|
6
76
|
|
|
7
77
|
### 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)
|
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.212.0 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
|
|
16
16
|
|
|
17
17
|
一个 Model Context Protocol (MCP) 服务器,让 AI 助手通过官方脚本 API 控制 DaVinci Resolve Studio(达芬奇)。它提供完整的 API 覆盖,外加带护栏的工作流助手,涵盖剪辑、媒体池整理、渲染设置、审阅标记、调色、Fusion、Fairlight、项目生命周期任务、扩展开发,以及不碰源媒体的媒体分析。
|
|
18
18
|
|
package/docs/SKILL.md
CHANGED
|
@@ -289,12 +289,20 @@ Example trace shape returned by `resolve_control(action="get_execution_trace")`:
|
|
|
289
289
|
availability was not determined, never that there is none; and
|
|
290
290
|
`pre_state_available` separates "no project open" from "state never read".
|
|
291
291
|
For an actual preview, use the action's own `dry_run` where it has one.
|
|
292
|
+
Where it has none, an explicit `dry_run=true` on a registered destructive
|
|
293
|
+
action is refused with `DRY_RUN_UNAVAILABLE` (`status: dry_run_unavailable`,
|
|
294
|
+
`simulated: false`, `executed: false`, plus the same static risk block)
|
|
295
|
+
before any archive, state lookup, or handler execution. Until v2.211.0 the
|
|
296
|
+
flag was silently ignored on those actions and the mutation ran; the
|
|
297
|
+
actions that do honour it are listed in `NATIVE_DRY_RUN_ACTIONS`
|
|
298
|
+
(`src/utils/destructive_hook.py`) and pinned to the handlers by a test.
|
|
292
299
|
- **`list_lifecycle_hooks()`**: Returns active execution lifecycle pipeline hooks
|
|
293
300
|
(`risk_classification`, `resolve_state_inspection`, `readback_verification`,
|
|
294
301
|
`drift_detection`, `provenance_trace`). All of them observe; none replaces a
|
|
295
|
-
tool result. `dry_run` therefore
|
|
296
|
-
|
|
297
|
-
|
|
302
|
+
tool result. `dry_run` is therefore never answered on a handler's behalf:
|
|
303
|
+
an action with a native dry-run path runs it, and every other registered
|
|
304
|
+
destructive action refuses the flag instead of either simulating or
|
|
305
|
+
executing.
|
|
298
306
|
|
|
299
307
|
Explicit correlation is also supported per-call: pass `params={"execution_id": ...}`
|
|
300
308
|
or `params={"trace_id": ...}` in any tool call to associate it with a specific trace.
|
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.212.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
|
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.212.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()}")
|
package/src/server.py
CHANGED
|
@@ -252,6 +252,104 @@ DRY_RUN_DEFAULT_TRUE_ACTIONS: frozenset = frozenset({
|
|
|
252
252
|
})
|
|
253
253
|
|
|
254
254
|
|
|
255
|
+
# ── Native dry-run allowlist ────────────────────────────────────────────────
|
|
256
|
+
#
|
|
257
|
+
# Registered destructive actions whose handler genuinely reads `dry_run` and
|
|
258
|
+
# returns a plan instead of mutating. Every OTHER registered destructive action
|
|
259
|
+
# ignores the flag: `timeline_markers.add` with `dry_run=true` added a real
|
|
260
|
+
# marker, `timeline.delete_track` with `dry_run=true` deleted the track. An
|
|
261
|
+
# agent following the guidance "prefer dry_run where it exists" cannot tell
|
|
262
|
+
# the two apart from the outside, so an explicit `dry_run=true` on a registered
|
|
263
|
+
# destructive action outside this set is REFUSED (DRY_RUN_UNAVAILABLE) before
|
|
264
|
+
# archive, state lookup, or handler execution — nothing simulated, nothing
|
|
265
|
+
# executed, and the response says so.
|
|
266
|
+
#
|
|
267
|
+
# This is deliberately a refusal and not a synthesised preview: the lifecycle
|
|
268
|
+
# pipeline's original dry-run interceptor answered `success: true` for calls
|
|
269
|
+
# it never ran and was removed for it (see
|
|
270
|
+
# execution_lifecycle.LifecyclePipeline._register_default_hooks). A dry run
|
|
271
|
+
# that always succeeds is worse than none, because it is trusted.
|
|
272
|
+
#
|
|
273
|
+
# The set is pinned by tests.test_destructive_hook against a static scan of
|
|
274
|
+
# src/server.py that follows the params object into helpers: add a native
|
|
275
|
+
# dry-run branch to a handler and the test tells you to list it here; list an
|
|
276
|
+
# action here without one and the test refuses.
|
|
277
|
+
|
|
278
|
+
NATIVE_DRY_RUN_ACTIONS: frozenset = frozenset({
|
|
279
|
+
("media_pool", "clear_clip_marks"),
|
|
280
|
+
("media_pool", "set_clip_marks"),
|
|
281
|
+
("media_pool", "setup_multicam_timeline"),
|
|
282
|
+
("timeline", "apply_cuts"),
|
|
283
|
+
("timeline", "ripple_insert"),
|
|
284
|
+
("timeline_ai", "create_subtitles"),
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
def _explicit_dry_run_requested(params: Optional[Dict[str, Any]]) -> bool:
|
|
289
|
+
if not isinstance(params, dict):
|
|
290
|
+
return False
|
|
291
|
+
if "dry_run" in params:
|
|
292
|
+
return bool(params["dry_run"])
|
|
293
|
+
if "dryRun" in params:
|
|
294
|
+
return bool(params["dryRun"])
|
|
295
|
+
return False
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
def lacks_native_dry_run(
|
|
299
|
+
tool_name: str, action: str, params: Optional[Dict[str, Any]] = None,
|
|
300
|
+
) -> bool:
|
|
301
|
+
"""True when the caller asked for a dry run this destructive action cannot honour.
|
|
302
|
+
|
|
303
|
+
Keyed on the destructive registry rather than `is_destructive()` so the
|
|
304
|
+
no-archive filters (a Notes edit, say) cannot let a dry-run request slip
|
|
305
|
+
through to a handler that would execute it for real.
|
|
306
|
+
"""
|
|
307
|
+
return (
|
|
308
|
+
_explicit_dry_run_requested(params)
|
|
309
|
+
and action in DESTRUCTIVE_ACTIONS_BY_TOOL.get(tool_name, frozenset())
|
|
310
|
+
and (tool_name, action) not in NATIVE_DRY_RUN_ACTIONS
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
def _dry_run_unavailable_response(
|
|
315
|
+
*,
|
|
316
|
+
operation_id: str,
|
|
317
|
+
tool_name: str,
|
|
318
|
+
action: str,
|
|
319
|
+
assessment: RiskAssessment,
|
|
320
|
+
) -> Dict[str, Any]:
|
|
321
|
+
return {
|
|
322
|
+
"success": False,
|
|
323
|
+
"status": "dry_run_unavailable",
|
|
324
|
+
"dry_run": True,
|
|
325
|
+
"simulated": False,
|
|
326
|
+
"executed": False,
|
|
327
|
+
"operation_id": operation_id,
|
|
328
|
+
"security": {
|
|
329
|
+
"risk_level": assessment.level.value,
|
|
330
|
+
"risk_established": assessment.recognised,
|
|
331
|
+
"safe_mode": _safe_mode_enabled(),
|
|
332
|
+
"blocked": True,
|
|
333
|
+
"policy": "destructive.dry_run_support",
|
|
334
|
+
},
|
|
335
|
+
"risk": assessment.to_dict(),
|
|
336
|
+
"error": {
|
|
337
|
+
"message": (
|
|
338
|
+
f"'{tool_name}.{action}' has no native dry-run path, so dry_run=true "
|
|
339
|
+
"cannot be honoured. Nothing was simulated and nothing was executed."
|
|
340
|
+
),
|
|
341
|
+
"code": "DRY_RUN_UNAVAILABLE",
|
|
342
|
+
"category": "dry_run_unavailable",
|
|
343
|
+
"retryable": False,
|
|
344
|
+
"remediation": (
|
|
345
|
+
"Use inspect_operation for the static risk assessment, use a "
|
|
346
|
+
"probe_*/safe_* action where one exists, or call again without "
|
|
347
|
+
"dry_run once the operation has been reviewed."
|
|
348
|
+
),
|
|
349
|
+
},
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
|
|
255
353
|
def _payload_is_plan_only(
|
|
256
354
|
tool_name: str, action: str, params: Optional[Dict[str, Any]],
|
|
257
355
|
) -> bool:
|
|
@@ -627,6 +725,29 @@ def destructive_op(tool_name: str) -> Callable[[Callable[..., Any]], Callable[..
|
|
|
627
725
|
def decorator(fn: Callable[..., Any]) -> Callable[..., Any]:
|
|
628
726
|
@functools.wraps(fn)
|
|
629
727
|
def wrapper(action: str, params: Optional[Dict[str, Any]] = None, *args, **kwargs) -> Any:
|
|
728
|
+
if lacks_native_dry_run(tool_name, action, params):
|
|
729
|
+
# An explicit dry-run request this handler would silently
|
|
730
|
+
# execute for real. Refuse before archive, state lookup, or the
|
|
731
|
+
# handler itself; see NATIVE_DRY_RUN_ACTIONS.
|
|
732
|
+
operation_id = f"op_{uuid.uuid4().hex[:12]}"
|
|
733
|
+
assessment = assess_action_risk(tool_name, action, params)
|
|
734
|
+
_audit_security_event(
|
|
735
|
+
operation_id=operation_id,
|
|
736
|
+
tool_name=tool_name,
|
|
737
|
+
action=action,
|
|
738
|
+
risk_level=assessment.level.value,
|
|
739
|
+
status="blocked",
|
|
740
|
+
params=params,
|
|
741
|
+
reason="dry_run_unavailable",
|
|
742
|
+
recognised=assessment.recognised,
|
|
743
|
+
)
|
|
744
|
+
return _dry_run_unavailable_response(
|
|
745
|
+
operation_id=operation_id,
|
|
746
|
+
tool_name=tool_name,
|
|
747
|
+
action=action,
|
|
748
|
+
assessment=assessment,
|
|
749
|
+
)
|
|
750
|
+
|
|
630
751
|
if not is_destructive(tool_name, action, params):
|
|
631
752
|
return fn(action, params, *args, **kwargs)
|
|
632
753
|
|
|
@@ -287,13 +287,42 @@ class RiskClassificationHook(LifecycleHook):
|
|
|
287
287
|
("timeline_item_color", "smart_reframe"),
|
|
288
288
|
("timeline_item_color", "create_magic_mask"),
|
|
289
289
|
("timeline_item_color", "regenerate_magic_mask"),
|
|
290
|
-
("graph", "set_lut"),
|
|
291
|
-
("graph", "apply_arri_cdl_lut"),
|
|
292
290
|
# Importing or switching the active comp changes what renders.
|
|
293
291
|
("timeline_item_fusion", "import_comp"),
|
|
294
292
|
("timeline_item_fusion", "load_comp"),
|
|
295
293
|
}
|
|
296
294
|
|
|
295
|
+
#: Raw graph LUT writes. Their level follows the graph they target (see
|
|
296
|
+
#: `_graph_scope`): MEDIUM on one item, HIGH on the timeline graph (the
|
|
297
|
+
#: tool's DEFAULT) or a color-group graph, where one call restyles every
|
|
298
|
+
#: clip on the timeline or in the group. Adapted from PR #192.
|
|
299
|
+
_GRAPH_LUT_ACTIONS: Set[Tuple[str, str]] = {
|
|
300
|
+
("graph", "set_lut"),
|
|
301
|
+
("graph", "apply_arri_cdl_lut"),
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
@staticmethod
|
|
305
|
+
def _graph_scope(params: Dict[str, Any]) -> Tuple["BlastRadius", str]:
|
|
306
|
+
"""Blast radius of a `graph` tool call, from its `source` param.
|
|
307
|
+
|
|
308
|
+
The graph tool resolves `source` as "timeline" (default) ->
|
|
309
|
+
Timeline.GetNodeGraph(), "item" -> TimelineItem.GetNodeGraph(), and
|
|
310
|
+
"color_group_pre"/"color_group_post" -> the group's pre/post clip
|
|
311
|
+
graph. Every graph mutation — LUT, DRX apply, reset, node toggle —
|
|
312
|
+
lands on whichever graph that names, so the scope is a property of
|
|
313
|
+
the call, not of the action, and a rating that says "item" for a
|
|
314
|
+
reset of a color-group graph is wrong by the size of the group.
|
|
315
|
+
"""
|
|
316
|
+
source = str(params.get("source") or "timeline")
|
|
317
|
+
if source == "item":
|
|
318
|
+
return BlastRadius.ITEM, "one timeline item's graph"
|
|
319
|
+
if source in {"color_group_pre", "color_group_post"}:
|
|
320
|
+
return (
|
|
321
|
+
BlastRadius.PROJECT,
|
|
322
|
+
f"a color group's {source} graph (every clip in the group)",
|
|
323
|
+
)
|
|
324
|
+
return BlastRadius.TIMELINE, "the timeline node graph (every clip on the timeline)"
|
|
325
|
+
|
|
297
326
|
_READ_ONLY_PREFIXES = ("get_", "list_", "query_", "probe_", "inspect_", "export_", "check_")
|
|
298
327
|
|
|
299
328
|
@classmethod
|
|
@@ -319,14 +348,31 @@ class RiskClassificationHook(LifecycleHook):
|
|
|
319
348
|
if params.get("ripple", False):
|
|
320
349
|
radius = BlastRadius.TIMELINE
|
|
321
350
|
reasons.append("Ripple mode alters downstream timeline synchronization")
|
|
351
|
+
elif tool_name == "graph":
|
|
352
|
+
radius, scope = cls._graph_scope(params)
|
|
353
|
+
reasons.append(f"Graph target: {scope}")
|
|
322
354
|
else:
|
|
323
355
|
radius = BlastRadius.ITEM
|
|
324
356
|
conf_required = True
|
|
325
357
|
reasons.append(f"Destructive timeline edit: {action}")
|
|
358
|
+
elif pair in cls._GRAPH_LUT_ACTIONS:
|
|
359
|
+
destructive = True
|
|
360
|
+
radius, scope = cls._graph_scope(params)
|
|
361
|
+
if radius is BlastRadius.ITEM:
|
|
362
|
+
level = RiskLevel.MEDIUM
|
|
363
|
+
reasons.append(f"Raw graph LUT write '{action}' is scoped to {scope}")
|
|
364
|
+
else:
|
|
365
|
+
level = RiskLevel.HIGH
|
|
366
|
+
conf_required = True
|
|
367
|
+
reasons.append(f"Raw graph LUT write '{action}' targets {scope}")
|
|
326
368
|
elif pair in cls._LOW_RISK_ACTIONS:
|
|
327
369
|
level = RiskLevel.LOW
|
|
328
370
|
destructive = True
|
|
329
|
-
|
|
371
|
+
if tool_name == "graph":
|
|
372
|
+
radius, scope = cls._graph_scope(params)
|
|
373
|
+
reasons.append(f"Graph target: {scope}")
|
|
374
|
+
else:
|
|
375
|
+
radius = BlastRadius.ITEM
|
|
330
376
|
reasons.append(f"Bounded reversible edit: {action}")
|
|
331
377
|
elif pair in cls._MEDIUM_RISK_ACTIONS:
|
|
332
378
|
level = RiskLevel.MEDIUM
|