davinci-resolve-mcp 5.2.7 → 5.2.8
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 +18 -0
- package/README.md +1 -1
- package/README.zh-CN.md +2 -2
- package/install.py +1 -1
- package/package.json +1 -1
- package/src/granular/common.py +1 -1
- package/src/granular/project.py +6 -1
- package/src/server.py +26 -3
- package/src/utils/destructive_hook.py +17 -3
- package/src/utils/render_target.py +47 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
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 v5.2.8 — Three calls stop answering success while dropping the request
|
|
6
|
+
|
|
7
|
+
From #365, #366 and #368 by @willturner-maker.
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **`record_frame_mode` beside `clip_infos` was dropped (#365).** `media_pool` `append_to_timeline` and `create_timeline_from_clips` read the mode only from each row, so `record_frame_mode: "absolute"` passed at the top level was ignored and an absolute frame landed start-relative with `success: true`. The top-level mode now applies to every row that sets none of its own. A row's own mode still wins, and an absolute frame before the timeline start is refused, as it already was per row.
|
|
12
|
+
- **`timeline.duplicate` archived the source timeline (#366).** Version-on-mutate archived the untouched source before every duplicate, leaving `_archived_vNN` siblings that read as evidence of an edit. Duplicate stays registered, so safe mode and the audit log still apply, but it no longer archives. `_versioning.skipped_reason` is `source_timeline_unchanged`.
|
|
13
|
+
- **`render.set_settings` took a `TargetDir` that does not exist (#368).** Resolve accepts it there and refuses only at `add_job` or render start. `set_settings` and the granular `set_render_settings` now refuse it before anything is sent, with code `TARGET_DIR_NOT_FOUND`.
|
|
14
|
+
|
|
15
|
+
### Not changed
|
|
16
|
+
|
|
17
|
+
- **#367** (`get_clips_linked` ignoring `timeline_id`) does not reproduce against the compound tool: the pin switches, the item is found on the pinned timeline and the current timeline is restored. A regression test now covers it.
|
|
18
|
+
|
|
19
|
+
### Not verified here
|
|
20
|
+
|
|
21
|
+
- Offline tests only. The reports were measured on Studio 21.2.0.6; this machine runs Studio 19.1.3.7, and no live Resolve run was made for this release.
|
|
22
|
+
|
|
5
23
|
## What's New in v5.2.7 — Preset and media rows live-tested with fixtures
|
|
6
24
|
|
|
7
25
|
From #363 by @Ghoul0718. No server behaviour changes.
|
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
|
-
> 本翻译对应 v5.2.
|
|
15
|
+
> 本翻译对应 v5.2.8 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
|
|
16
16
|
|
|
17
17
|
一个 Model Context Protocol (MCP) 服务器,让 AI 助手通过官方脚本 API 控制 DaVinci Resolve Studio(达芬奇)。它提供完整的 API 覆盖,外加带护栏的工作流助手,涵盖剪辑、媒体池整理、渲染设置、审阅标记、调色、Fusion、Fairlight、项目生命周期任务、扩展开发,以及不碰源媒体的媒体分析。
|
|
18
18
|
|
package/install.py
CHANGED
|
@@ -37,7 +37,7 @@ from src.utils.update_check import (
|
|
|
37
37
|
|
|
38
38
|
# ─── Version ──────────────────────────────────────────────────────────────────
|
|
39
39
|
|
|
40
|
-
VERSION = "5.2.
|
|
40
|
+
VERSION = "5.2.8"
|
|
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
|
@@ -93,7 +93,7 @@ if not logging.getLogger().handlers:
|
|
|
93
93
|
handlers=[logging.StreamHandler()],
|
|
94
94
|
)
|
|
95
95
|
|
|
96
|
-
VERSION = "5.2.
|
|
96
|
+
VERSION = "5.2.8"
|
|
97
97
|
logger = logging.getLogger("davinci-resolve-mcp")
|
|
98
98
|
logger.info(f"Starting DaVinci Resolve MCP Server v{VERSION}")
|
|
99
99
|
logger.info(f"Detected platform: {get_platform()}")
|
package/src/granular/project.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from src.granular.common import * # noqa: F401,F403
|
|
4
4
|
from src.utils.bool_params import recognised_bool
|
|
5
5
|
from src.utils.page_lock import restoring_page
|
|
6
|
+
from src.utils.render_target import missing_target_dir, missing_target_dir_message
|
|
6
7
|
|
|
7
8
|
resolve = ResolveProxy()
|
|
8
9
|
|
|
@@ -1222,7 +1223,8 @@ def set_render_settings(settings: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
1222
1223
|
Args:
|
|
1223
1224
|
settings: Dict of render settings. All documented keys are forwarded:
|
|
1224
1225
|
SelectAllFrames (bool), MarkIn (int), MarkOut (int),
|
|
1225
|
-
TargetDir (str
|
|
1226
|
+
TargetDir (str; must be an existing directory, refused before the
|
|
1227
|
+
call otherwise), CustomName (str), UniqueFilenameStyle (0=Prefix/1=Suffix),
|
|
1226
1228
|
ExportVideo (bool), ExportAudio (bool), FormatWidth (int),
|
|
1227
1229
|
FormatHeight (int), FrameRate (float), PixelAspectRatio (float),
|
|
1228
1230
|
VideoQuality (int/str), AudioCodec (str), AudioBitDepth (int),
|
|
@@ -1243,6 +1245,9 @@ def set_render_settings(settings: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
1243
1245
|
if coerced is None:
|
|
1244
1246
|
return {"error": "UseUniqueFilenames must be a boolean (true/false)"}
|
|
1245
1247
|
settings = dict(settings, UseUniqueFilenames=coerced)
|
|
1248
|
+
missing_target = missing_target_dir(settings)
|
|
1249
|
+
if missing_target is not None:
|
|
1250
|
+
return {"error": missing_target_dir_message(missing_target)}
|
|
1246
1251
|
resolve = get_resolve()
|
|
1247
1252
|
if resolve is None:
|
|
1248
1253
|
return {"error": "Not connected to DaVinci Resolve"}
|
package/src/server.py
CHANGED
|
@@ -11,7 +11,7 @@ Usage:
|
|
|
11
11
|
python src/server.py --full # Start the 377-tool granular server instead
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
|
-
VERSION = "5.2.
|
|
14
|
+
VERSION = "5.2.8"
|
|
15
15
|
|
|
16
16
|
import base64
|
|
17
17
|
import os
|
|
@@ -64,6 +64,7 @@ from src.utils.film_cues import export_cue_sheet as _export_film_cue_sheet
|
|
|
64
64
|
from src.utils.cdl import normalize_cdl_payload
|
|
65
65
|
from src.utils.media_paths import media_exists as _media_exists
|
|
66
66
|
from src.utils.preset_files import preset_export_file as _preset_export_file
|
|
67
|
+
from src.utils.render_target import missing_target_dir_error as _missing_target_dir_error
|
|
67
68
|
from src.utils import archive_guard
|
|
68
69
|
from src.utils import subtitle_append_guard
|
|
69
70
|
from src.utils import typed_api_search
|
|
@@ -3917,6 +3918,24 @@ def _normalize_record_frame(
|
|
|
3917
3918
|
return start + rf, None
|
|
3918
3919
|
|
|
3919
3920
|
|
|
3921
|
+
def _rows_with_default_record_frame_mode(rows, p):
|
|
3922
|
+
"""Apply a top-level record_frame_mode to clip_infos rows that set none.
|
|
3923
|
+
|
|
3924
|
+
The mode used to be read only per row, so `record_frame_mode` passed beside
|
|
3925
|
+
`clip_infos` was dropped and an absolute frame landed start-relative with
|
|
3926
|
+
success (issue #365). A row's own mode still wins.
|
|
3927
|
+
"""
|
|
3928
|
+
mode = p.get("record_frame_mode", p.get("recordFrameMode"))
|
|
3929
|
+
if mode is None or not isinstance(rows, list):
|
|
3930
|
+
return rows
|
|
3931
|
+
out = []
|
|
3932
|
+
for ci in rows:
|
|
3933
|
+
if isinstance(ci, dict) and "record_frame_mode" not in ci and "recordFrameMode" not in ci:
|
|
3934
|
+
ci = {**ci, "record_frame_mode": mode}
|
|
3935
|
+
out.append(ci)
|
|
3936
|
+
return out
|
|
3937
|
+
|
|
3938
|
+
|
|
3920
3939
|
def _timeline_start_frame(tl) -> Optional[int]:
|
|
3921
3940
|
if not tl:
|
|
3922
3941
|
return None
|
|
@@ -23248,6 +23267,10 @@ def render(action: str, params: Optional[Dict[str, Any]] = None) -> Dict[str, An
|
|
|
23248
23267
|
category="invalid_input",
|
|
23249
23268
|
reason="Nothing was sent to SetRenderSettings.",
|
|
23250
23269
|
)
|
|
23270
|
+
target_refusal = _missing_target_dir_error(settings)
|
|
23271
|
+
if target_refusal:
|
|
23272
|
+
message = target_refusal.pop("message")
|
|
23273
|
+
return _err(message, **target_refusal)
|
|
23251
23274
|
result = {"success": bool(proj.SetRenderSettings(settings))}
|
|
23252
23275
|
if ignored_settings:
|
|
23253
23276
|
result["ignored_settings"] = ignored_settings
|
|
@@ -23570,7 +23593,7 @@ def media_pool(action: str, params: Optional[Dict[str, Any]] = None) -> Dict[str
|
|
|
23570
23593
|
if policy_result:
|
|
23571
23594
|
return policy_result
|
|
23572
23595
|
if p.get("clip_infos") is not None:
|
|
23573
|
-
raw = p["clip_infos"]
|
|
23596
|
+
raw = _rows_with_default_record_frame_mode(p["clip_infos"], p)
|
|
23574
23597
|
if not isinstance(raw, list):
|
|
23575
23598
|
return _err("clip_infos must be a list")
|
|
23576
23599
|
if not raw:
|
|
@@ -23677,7 +23700,7 @@ def media_pool(action: str, params: Optional[Dict[str, Any]] = None) -> Dict[str
|
|
|
23677
23700
|
"timelines_before": before_n, "timelines_after": after_n}
|
|
23678
23701
|
elif action == "append_to_timeline":
|
|
23679
23702
|
if p.get("clip_infos") is not None:
|
|
23680
|
-
raw = p["clip_infos"]
|
|
23703
|
+
raw = _rows_with_default_record_frame_mode(p["clip_infos"], p)
|
|
23681
23704
|
if not isinstance(raw, list):
|
|
23682
23705
|
return _err("clip_infos must be a list")
|
|
23683
23706
|
if not raw:
|
|
@@ -321,6 +321,17 @@ NON_TIMELINE_WRITE_TOOLS: frozenset = frozenset({
|
|
|
321
321
|
})
|
|
322
322
|
|
|
323
323
|
|
|
324
|
+
#: Registered timeline actions that leave the working timeline unchanged. They
|
|
325
|
+
#: keep every gate (safe mode, dry-run refusal, the audit log) but skip
|
|
326
|
+
#: version-on-mutate archiving. `timeline.duplicate` copies the current timeline
|
|
327
|
+
#: into a new one; archiving the untouched source before it wrote an
|
|
328
|
+
#: `_archived_vNN` sibling that read as evidence of an edit that never happened
|
|
329
|
+
#: (issue #366).
|
|
330
|
+
NON_MUTATING_TIMELINE_ACTIONS: FrozenSet[Tuple[str, str]] = frozenset({
|
|
331
|
+
("timeline", "duplicate"),
|
|
332
|
+
})
|
|
333
|
+
|
|
334
|
+
|
|
324
335
|
# ── Strict-mode allowlist ───────────────────────────────────────────────────
|
|
325
336
|
#
|
|
326
337
|
# Actions in this set REFUSE to run if the version-on-mutate archive fails. For
|
|
@@ -1282,7 +1293,10 @@ def destructive_op(tool_name: str) -> Callable[[Callable[..., Any]], Callable[..
|
|
|
1282
1293
|
recognised=risk_recognised,
|
|
1283
1294
|
)
|
|
1284
1295
|
|
|
1285
|
-
if tool_name in NON_TIMELINE_WRITE_TOOLS
|
|
1296
|
+
if (tool_name in NON_TIMELINE_WRITE_TOOLS
|
|
1297
|
+
or (tool_name, action) in NON_MUTATING_TIMELINE_ACTIONS):
|
|
1298
|
+
skipped_reason = ("not_a_timeline_mutation" if tool_name in NON_TIMELINE_WRITE_TOOLS
|
|
1299
|
+
else "source_timeline_unchanged")
|
|
1286
1300
|
result = fn(action, params, *args, **kwargs)
|
|
1287
1301
|
_audit_security_event(
|
|
1288
1302
|
operation_id=operation_id,
|
|
@@ -1291,14 +1305,14 @@ def destructive_op(tool_name: str) -> Callable[[Callable[..., Any]], Callable[..
|
|
|
1291
1305
|
risk_level=risk_level,
|
|
1292
1306
|
status="allowed",
|
|
1293
1307
|
params=params,
|
|
1294
|
-
reason=
|
|
1308
|
+
reason=skipped_reason,
|
|
1295
1309
|
recognised=risk_recognised,
|
|
1296
1310
|
)
|
|
1297
1311
|
if isinstance(result, dict):
|
|
1298
1312
|
result.setdefault("_versioning", {
|
|
1299
1313
|
"analysis_run_id": None,
|
|
1300
1314
|
"archived": False,
|
|
1301
|
-
"skipped_reason":
|
|
1315
|
+
"skipped_reason": skipped_reason,
|
|
1302
1316
|
})
|
|
1303
1317
|
return _annotate_security(
|
|
1304
1318
|
result,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Render TargetDir validation shared by the compound and granular servers.
|
|
2
|
+
|
|
3
|
+
`Project.SetRenderSettings` takes a TargetDir that does not exist and answers
|
|
4
|
+
True; the refusal only surfaces later, at `AddRenderJob` or when the job
|
|
5
|
+
starts (issue #368). The server runs on the machine Resolve renders on, so a
|
|
6
|
+
directory this process cannot see is one Resolve cannot write to either.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import os
|
|
12
|
+
from typing import Any, Dict, Optional
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def missing_target_dir(settings: Any) -> Optional[str]:
|
|
16
|
+
"""The TargetDir from `settings` when it names no existing directory, else None.
|
|
17
|
+
|
|
18
|
+
Only a non-empty string is checked; an absent key leaves the project's
|
|
19
|
+
current target alone, and other types are left to Resolve to refuse.
|
|
20
|
+
"""
|
|
21
|
+
if not isinstance(settings, dict):
|
|
22
|
+
return None
|
|
23
|
+
target = settings.get("TargetDir")
|
|
24
|
+
if not isinstance(target, str) or not target.strip():
|
|
25
|
+
return None
|
|
26
|
+
return None if os.path.isdir(target) else target
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def missing_target_dir_message(target: str) -> str:
|
|
30
|
+
return (
|
|
31
|
+
f"TargetDir does not exist: {target}. Nothing was sent to SetRenderSettings; "
|
|
32
|
+
"Resolve would accept it here and refuse only at add_job or render start."
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def missing_target_dir_error(settings: Any) -> Optional[Dict[str, Any]]:
|
|
37
|
+
"""Fields for a refusal, or None when TargetDir is absent or exists."""
|
|
38
|
+
target = missing_target_dir(settings)
|
|
39
|
+
if target is None:
|
|
40
|
+
return None
|
|
41
|
+
return {
|
|
42
|
+
"message": missing_target_dir_message(target),
|
|
43
|
+
"code": "TARGET_DIR_NOT_FOUND",
|
|
44
|
+
"category": "invalid_input",
|
|
45
|
+
"remediation": "Create the directory first, or pass an existing TargetDir.",
|
|
46
|
+
"state": {"TargetDir": target},
|
|
47
|
+
}
|