davinci-resolve-mcp 5.2.10 → 5.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
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.12 — Lowercase CDL keys now reach Resolve
6
+
7
+ From #379 by @boomesh11, fixing #378 reported by @willturner-maker.
8
+
9
+ ### Fixed
10
+
11
+ - **`safe_set_cdl` dropped CDL values sent with lowercase keys.** A payload such as `{"slope": [...], "offset": [...], "power": [...], "saturation": 1.1, "node_index": 2}` kept the requested values under the lowercase keys, while the PascalCase keys Resolve reads (`NodeIndex`, `Slope`, `Offset`, `Power`, `Saturation`) were filled with identity defaults. Lowercase, snake_case and camelCase spellings now map to the PascalCase keys before validation and normalisation, so every path that sends a CDL to `SetCDL` gets the caller's values. When both spellings are given, the PascalCase key wins.
12
+
13
+ ### Not verified here
14
+
15
+ - Offline tests only; no live Resolve run was made for this release.
16
+
17
+ ## What's New in v5.2.11 — A typo'd track index no longer grows a new timeline
18
+
19
+ From a follow-up on #370 by @willturner-maker.
20
+
21
+ ### Fixed
22
+
23
+ - **`create_timeline_from_clips` built as many tracks as a row named.** Since v5.2.9 it adds the tracks its `clip_infos` rows name, so a typo such as `track_index: 99` created a timeline with 98 empty tracks and answered success. A new timeline now gets at most 32 tracks of each type for its rows. A higher index is refused with `INVALID_TRACK_INDEX` before anything is created, and the message names the route for a build that needs more: create the timeline, add tracks with `timeline` `add_track`, then `append_to_timeline`, which checks rows against the tracks that exist. Same in the granular server. Both servers' docstrings now list `track_index` and `media_type` for this form.
24
+
25
+ ### Not verified here
26
+
27
+ - Offline tests only; no live Resolve run was made for this release.
28
+
5
29
  ## What's New in v5.2.10 — Three writes are read back before they report success
6
30
 
7
31
  From #373 by @youchengyangdu-pixel, adapted on landing.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  English | [简体中文](README.zh-CN.md) | [繁體中文](README.zh-TW.md)
4
4
 
5
- [![Version](https://img.shields.io/badge/version-5.2.10-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-5.2.12-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
6
6
  [![npm](https://img.shields.io/npm/v/davinci-resolve-mcp.svg?label=npm&color=CB3837)](https://www.npmjs.com/package/davinci-resolve-mcp)
7
7
  [![API Coverage](https://img.shields.io/badge/API%20Coverage-100%25-brightgreen.svg)](docs/reference/api-coverage.md)
8
8
  [![Tools](https://img.shields.io/badge/MCP%20Tools-37%20(390%20full)-blue.svg)](#server-modes)
package/README.zh-CN.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | 简体中文 | [繁體中文](README.zh-TW.md)
4
4
 
5
- [![Version](https://img.shields.io/badge/version-5.2.10-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-5.2.12-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
6
6
  [![npm](https://img.shields.io/npm/v/davinci-resolve-mcp.svg?label=npm&color=CB3837)](https://www.npmjs.com/package/davinci-resolve-mcp)
7
7
  [![API Coverage](https://img.shields.io/badge/API%20Coverage-100%25-brightgreen.svg)](docs/reference/api-coverage.md)
8
8
  [![Tools](https://img.shields.io/badge/MCP%20Tools-37%20(390%20full)-blue.svg)](#服务器模式)
@@ -12,7 +12,7 @@
12
12
  [![Python](https://img.shields.io/badge/python-3.10+-green.svg)](https://www.python.org/downloads/)
13
13
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
14
14
 
15
- > 本翻译对应 v5.2.10 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
15
+ > 本翻译对应 v5.2.12 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
16
16
 
17
17
  一个 Model Context Protocol (MCP) 服务器,让 AI 助手通过官方脚本 API 控制 DaVinci Resolve Studio(达芬奇)。它提供完整的 API 覆盖,外加带护栏的工作流助手,涵盖剪辑、媒体池整理、渲染设置、审阅标记、调色、Fusion、Fairlight、项目生命周期任务、扩展开发,以及不碰源媒体的媒体分析。
18
18
 
package/README.zh-TW.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | [简体中文](README.zh-CN.md) | 繁體中文
4
4
 
5
- [![Version](https://img.shields.io/badge/version-5.2.10-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-5.2.12-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
6
6
  [![npm](https://img.shields.io/npm/v/davinci-resolve-mcp.svg?label=npm&color=CB3837)](https://www.npmjs.com/package/davinci-resolve-mcp)
7
7
  [![API Coverage](https://img.shields.io/badge/API%20Coverage-100%25-brightgreen.svg)](docs/reference/api-coverage.md)
8
8
  [![Tools](https://img.shields.io/badge/MCP%20Tools-37%20(390%20full)-blue.svg)](#伺服器模式)
@@ -12,7 +12,7 @@
12
12
  [![Python](https://img.shields.io/badge/python-3.10+-green.svg)](https://www.python.org/downloads/)
13
13
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
14
14
 
15
- > 本翻譯對應 v5.2.10 版 README。如與英文原版有出入,以[英文原版](README.md)為準。
15
+ > 本翻譯對應 v5.2.12 版 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.10"
40
+ VERSION = "5.2.12"
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "davinci-resolve-mcp",
3
- "version": "5.2.10",
3
+ "version": "5.2.12",
4
4
  "description": "NPM bootstrapper for the DaVinci Resolve MCP Server.",
5
5
  "license": "MIT",
6
6
  "author": "Samuel Gursky <samgursky@gmail.com>",
@@ -94,7 +94,7 @@ if not logging.getLogger().handlers:
94
94
  handlers=[logging.StreamHandler()],
95
95
  )
96
96
 
97
- VERSION = "5.2.10"
97
+ VERSION = "5.2.12"
98
98
  logger = logging.getLogger("davinci-resolve-mcp")
99
99
  logger.info(f"Starting DaVinci Resolve MCP Server v{VERSION}")
100
100
  logger.info(f"Detected platform: {get_platform()}")
@@ -1043,6 +1043,10 @@ def create_timeline_from_clips(
1043
1043
  media_pool_item_id), start_frame, end_frame, record_frame.
1044
1044
  record_frame is relative to the created timeline start frame by
1045
1045
  default; pass record_frame_mode="absolute" for raw Resolve values.
1046
+ Optional per row: track_index (1-based, default 1) and media_type
1047
+ (1 video, 2 audio). The new timeline gets the tracks the rows name,
1048
+ up to 32 of each type; a higher index is refused before anything
1049
+ is created.
1046
1050
  If both are None, uses the currently selected media pool clips.
1047
1051
  """
1048
1052
  project, mp, err = _get_mp()
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.10"
14
+ VERSION = "5.2.12"
15
15
 
16
16
  import base64
17
17
  import os
@@ -61,7 +61,7 @@ from src.utils.resolve211_edits import validate_edit_options, validate_transitio
61
61
  from src.utils.film_cues import export_cue_sheet as _export_film_cue_sheet
62
62
 
63
63
  # Platform-specific Resolve paths
64
- from src.utils.cdl import normalize_cdl_payload
64
+ from src.utils.cdl import canonicalize_cdl_keys, 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
67
  from src.utils.render_target import missing_target_dir_error as _missing_target_dir_error
@@ -23703,6 +23703,9 @@ def media_pool(action: str, params: Optional[Dict[str, Any]] = None) -> Dict[str
23703
23703
  start_frame & end_frame (or startFrame/endFrame), record_frame/recordFrame}.
23704
23704
  record_frame is relative to the created timeline start frame by default;
23705
23705
  pass record_frame_mode="absolute" for raw Resolve recordFrame values.
23706
+ Optional per row: track_index (1-based, default 1) and media_type (1 video,
23707
+ 2 audio). The new timeline gets the tracks the rows name, up to 32 of
23708
+ each type; a higher index is refused before anything is created.
23706
23709
  setup_multicam_timeline(name, clip_ids|angles, sync_mode?, include_audio?, dry_run?) -> {success}
23707
23710
  — creates a stacked multicam prep timeline: one angle per video track, optional
23708
23711
  matching audio tracks. Native multicam clip conversion remains a Resolve UI step.
@@ -30140,6 +30143,7 @@ def _validate_cdl_payload(cdl):
30140
30143
  category="invalid_input",
30141
30144
  remediation="Pass cdl as a dict with NodeIndex, Slope, Offset, Power, Saturation.",
30142
30145
  )
30146
+ cdl = canonicalize_cdl_keys(cdl)
30143
30147
  errors = []
30144
30148
  node_index = cdl.get("NodeIndex", 1)
30145
30149
  if isinstance(node_index, bool):
package/src/utils/cdl.py CHANGED
@@ -2,13 +2,35 @@
2
2
 
3
3
  from typing import Any, Dict
4
4
 
5
+ _CDL_KEY_ALIASES = {
6
+ "nodeindex": "NodeIndex",
7
+ "node_index": "NodeIndex",
8
+ "slope": "Slope",
9
+ "offset": "Offset",
10
+ "power": "Power",
11
+ "saturation": "Saturation",
12
+ }
13
+
14
+
15
+ def canonicalize_cdl_keys(cdl: Any) -> Any:
16
+ """Canonicalize lowercase/snake_case CDL keys to Resolve's PascalCase keys."""
17
+ if not isinstance(cdl, dict):
18
+ return cdl
19
+ out: Dict[str, Any] = {}
20
+ for key, value in cdl.items():
21
+ canonical = _CDL_KEY_ALIASES.get(str(key).lower(), key)
22
+ if canonical not in out or key == canonical:
23
+ out[canonical] = value
24
+ return out
25
+
5
26
 
6
27
  def normalize_cdl_payload(cdl: Any) -> Any:
7
28
  """Resolve's SetCDL expects strings like ``"1.0 1.0 1.0"`` instead of arrays."""
8
29
  if not isinstance(cdl, dict):
9
30
  return cdl
31
+ canonical_cdl = canonicalize_cdl_keys(cdl)
10
32
  out: Dict[str, Any] = {}
11
- for key, value in cdl.items():
33
+ for key, value in canonical_cdl.items():
12
34
  if isinstance(value, (list, tuple)):
13
35
  out[key] = " ".join(str(item) for item in value)
14
36
  elif isinstance(value, bool):
@@ -13,6 +13,14 @@ from typing import Any, Optional, Tuple
13
13
 
14
14
  MEDIA_TYPES = {1: "video", 2: "audio"}
15
15
 
16
+ #: Most tracks of one type a new timeline is given to satisfy its rows. A row
17
+ #: naming a higher index is far more often a typo (99 for 9) than a build
18
+ #: that needs it, and honouring it adds that many empty tracks with success
19
+ #: (reported on #370). A build that does need more creates the timeline, adds
20
+ #: tracks with timeline add_track, then appends; append_to_timeline checks
21
+ #: rows against the tracks that exist.
22
+ MAX_NEW_TIMELINE_TRACKS = 32
23
+
16
24
 
17
25
  def _as_int(value: Any) -> Optional[int]:
18
26
  """An int from an int, an integral float, or a digit string; else None."""
@@ -99,7 +107,8 @@ def needed_tracks(rows: Any) -> Tuple[Optional[dict], Optional[str]]:
99
107
 
100
108
  For building a new timeline from rows: each row's track_index (default 1)
101
109
  must be valid, and the timeline then needs that many tracks of the row's
102
- media type, or of both types when the row sets none.
110
+ media type, or of both types when the row sets none. An index above
111
+ MAX_NEW_TIMELINE_TRACKS is refused rather than growing the timeline to it.
103
112
  """
104
113
  needed = {"video": 1, "audio": 0}
105
114
  for i, ci in enumerate(rows if isinstance(rows, list) else []):
@@ -111,6 +120,13 @@ def needed_tracks(rows: Any) -> Tuple[Optional[dict], Optional[str]]:
111
120
  mt, err = coerce_media_type(ci.get("mediaType", ci.get("media_type")), i)
112
121
  if err:
113
122
  return None, err
123
+ if ti > MAX_NEW_TIMELINE_TRACKS:
124
+ return None, (
125
+ f"clip_infos[{i}] track_index {ti} would give the new timeline {ti} "
126
+ f"tracks, past the {MAX_NEW_TIMELINE_TRACKS} it adds for its rows; "
127
+ "nothing was created. If the index is intended, create the timeline, "
128
+ "add the tracks with timeline add_track, then use append_to_timeline."
129
+ )
114
130
  for track_type in ([MEDIA_TYPES[mt]] if mt else ["video", "audio"]):
115
131
  needed[track_type] = max(needed[track_type], ti)
116
132
  return needed, None