davinci-resolve-mcp 2.180.0 → 2.181.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 CHANGED
@@ -2,6 +2,23 @@
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.181.0 — E127: DRT timelines get their real names, and compounds their kind
6
+
7
+ ### Fixed
8
+
9
+ - **`drt.parse` / `list_sequences` named a timeline after its first clip.**
10
+ A SeqContainer XML carries no timeline name — its first `<Name>` is the
11
+ first clip's — so Resolve's DRT export of a compound timeline listed
12
+ "cut_src.mp4" and "white_src.mp4" as sequences (measured on 19.1.3.7; the
13
+ export is a permanent fixture). The pool folder's `Sm2MpTimelineClip` and
14
+ `Sm2MpCompoundClip` embed the `Sm2Sequence` each container's `<Sequence>`
15
+ names; the parser now takes names and `kind` (`timeline` | `compound`) from
16
+ there, tags a media-less clip named after a compound as `compound`, and
17
+ `list_sequences` reports `kind` and `nestedIn` so a picker can demote the
18
+ compound containers (E57_IN nested in E57_OUT, nested in E57_NESTED). The
19
+ bundled media template's sequence now lists by its real name,
20
+ `MediaTemplate`, where it used to read as its clip `sample.mp4`.
21
+
5
22
  ## What's New in v2.180.0 — E126: the sequence picker knows a nested composition from a turnover
6
23
 
7
24
  ### Added
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  English | [简体中文](README.zh-CN.md)
4
4
 
5
- [![Version](https://img.shields.io/badge/version-2.180.0-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-2.181.0-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-36%20(353%20full)-blue.svg)](#server-modes)
package/README.zh-CN.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | 简体中文
4
4
 
5
- [![Version](https://img.shields.io/badge/version-2.180.0-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-2.181.0-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-36%20(353%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
- > 本翻译对应 v2.180.0 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
15
+ > 本翻译对应 v2.181.0 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
16
16
 
17
17
  一个 Model Context Protocol (MCP) 服务器,让 AI 助手通过官方脚本 API 控制 DaVinci Resolve Studio(达芬奇)。它提供完整的 API 覆盖,外加带护栏的工作流助手,涵盖剪辑、媒体池整理、渲染设置、审阅标记、调色、Fusion、Fairlight、项目生命周期任务、扩展开发,以及不碰源媒体的媒体分析。
18
18
 
@@ -313,7 +313,7 @@ equivalent, blocking full automation.
313
313
 
314
314
  - **Object:** `MediaPool`
315
315
  - **Signature:** `(filePath.xml) -> Timeline`
316
- - **Behavior:** Resolve's FCP7 XML importer HONOURS a generatoritem's `fillcolor` parameter (measured on Studio 19.1.3.7, E110): a Premiere-shaped Color Matte (effectid Color, category Matte) and a Solid Color generatoritem, both with <red>/<green>/<blue>/<alpha> 0..255 values, imported as Solid Color items and rendered Y81 U90 V240 (red) and Y41 U240 V110 (blue) — exact BT.601 limited-range values for a 640x360 timeline. EXPORT_FCP_7_XML writes the fillcolor back (same 0..255 channels). EXPORT_DRT carries the colour as a 55-byte <EffectFiltersBA> on the Sm2TiGenerator: 8-byte header (version 2, length 47), a fixed 20-byte prefix, a flag byte, then big-endian uint16 A R G B (0xffff = full) plus a pad word, then a second, black colour record; only the ARGB words differed between the red and blue captures. The default generator has an EMPTY EffectFiltersBA. The same importer does NOT carry a TRANSITION's parameters: a `Dip to Color Dissolve` transitionitem with a white and with a red `color` parameter imported as `Dip To Color Dissolve` elements whose 37-byte EffectFiltersBA were byte-identical (defaults), and the transition rendered inert (luma flat through its window, the E66 law) — the dip colour stays GUI-only on 19.1.3.7 (measured, E111). The writer emits a Solid Color's colour as the FxPlug parameter `input_1` (effectid FxPlugWrapper:C18E8B62_…), not `fillcolor` — an authored EffectFiltersBA colour came back exactly (white, 128/64/191; E112). The OTIO writer CANNOT: EXPORT_OTIO emits a Solid Color as a Clip.2 named 'Solid Color' with a NULL media_reference, metadata {"Resolve_OTIO": {}} and a parameterless Transform effect — no colour anywhere (measured E117) — so only an XML re-export witnesses a generator colour (editorial.verify_roundtrip exportedFormat → generatorColourNotInExport). Such an OTIO export DOES re-conform through drt.assemble_from_interchange (E118): the media-less generator clips walk as black legs and the clip→generator fade renders 124→16 — black, the colour having been lost by the writer. COMPOUND CLIPS: EXPORT_OTIO nests a compound as a Stack.1 inside the track (its source_range = the trim window into the compound; nested compounds nest Stacks recursively — measured E120 on a depth-2 timeline), while EXPORT_FCP_7_XML flattens the compound to a single media-less clipitem named after it (no inner content). editorial.parse_interchange flattens the OTIO Stacks into record time (fromCompound on each cut).
316
+ - **Behavior:** Resolve's FCP7 XML importer HONOURS a generatoritem's `fillcolor` parameter (measured on Studio 19.1.3.7, E110): a Premiere-shaped Color Matte (effectid Color, category Matte) and a Solid Color generatoritem, both with <red>/<green>/<blue>/<alpha> 0..255 values, imported as Solid Color items and rendered Y81 U90 V240 (red) and Y41 U240 V110 (blue) — exact BT.601 limited-range values for a 640x360 timeline. EXPORT_FCP_7_XML writes the fillcolor back (same 0..255 channels). EXPORT_DRT carries the colour as a 55-byte <EffectFiltersBA> on the Sm2TiGenerator: 8-byte header (version 2, length 47), a fixed 20-byte prefix, a flag byte, then big-endian uint16 A R G B (0xffff = full) plus a pad word, then a second, black colour record; only the ARGB words differed between the red and blue captures. The default generator has an EMPTY EffectFiltersBA. The same importer does NOT carry a TRANSITION's parameters: a `Dip to Color Dissolve` transitionitem with a white and with a red `color` parameter imported as `Dip To Color Dissolve` elements whose 37-byte EffectFiltersBA were byte-identical (defaults), and the transition rendered inert (luma flat through its window, the E66 law) — the dip colour stays GUI-only on 19.1.3.7 (measured, E111). The writer emits a Solid Color's colour as the FxPlug parameter `input_1` (effectid FxPlugWrapper:C18E8B62_…), not `fillcolor` — an authored EffectFiltersBA colour came back exactly (white, 128/64/191; E112). The OTIO writer CANNOT: EXPORT_OTIO emits a Solid Color as a Clip.2 named 'Solid Color' with a NULL media_reference, metadata {"Resolve_OTIO": {}} and a parameterless Transform effect — no colour anywhere (measured E117) — so only an XML re-export witnesses a generator colour (editorial.verify_roundtrip exportedFormat → generatorColourNotInExport). Such an OTIO export DOES re-conform through drt.assemble_from_interchange (E118): the media-less generator clips walk as black legs and the clip→generator fade renders 124→16 — black, the colour having been lost by the writer. COMPOUND CLIPS: EXPORT_OTIO nests a compound as a Stack.1 inside the track (its source_range = the trim window into the compound; nested compounds nest Stacks recursively — measured E120 on a depth-2 timeline), while EXPORT_FCP_7_XML flattens the compound to a single media-less clipitem named after it (no inner content). editorial.parse_interchange flattens the OTIO Stacks into record time (fromCompound on each cut). EXPORT_DRT of the same timeline holds THREE SeqContainers (top + one per compound); a SeqContainer XML carries NO timeline name — its first <Name> is the first clip's — while MediaPool/Master/MpFolder.xml's Sm2MpTimelineClip / Sm2MpCompoundClip embed the <Sm2Sequence DbId> the container's track-level <Sequence> names (measured E127); the compound on the parent track is a plain Sm2TiVideoClip named after it with no MediaFilePath.
317
317
  - **Workaround / current handling:** Author fade-to-white / colour mattes by placing a Solid Color generator with that blob (drp-format placeGenerator `color`, drt.assemble elements[].color) — or carry an XMEML generatoritem fillcolor through editorial.parse_interchange; the bridge authors the coloured leg.
318
318
  - **Tags:** xml, import, generator, colour, export, drt
319
319
 
package/install.py CHANGED
@@ -37,7 +37,7 @@ from src.utils.update_check import (
37
37
 
38
38
  # ─── Version ──────────────────────────────────────────────────────────────────
39
39
 
40
- VERSION = "2.180.0"
40
+ VERSION = "2.181.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "davinci-resolve-mcp",
3
- "version": "2.180.0",
3
+ "version": "2.181.0",
4
4
  "description": "NPM bootstrapper for the DaVinci Resolve MCP Server.",
5
5
  "license": "MIT",
6
6
  "author": "Samuel Gursky <samgursky@gmail.com>",
@@ -45,7 +45,21 @@ export function detectFormat(filePath, explicit) {
45
45
 
46
46
  /** Map a parseDRT() result → uniform [{id,name,eventCount,index}]. Shared with the drt tool. */
47
47
  export function summarizeDrtTimelines(parsed) {
48
- return (parsed.timelines || []).map((tl, index) => {
48
+ const tls = parsed.timelines || [];
49
+ // E127: a compound container is NESTED in every timeline/compound whose
50
+ // tracks place a clip named after it — the picker should offer the parent.
51
+ const nestedIn = new Map();
52
+ for (const tl of tls) {
53
+ for (const t of tl.videoTracks || []) {
54
+ for (const c of t.clips || []) {
55
+ if (c.compound) {
56
+ if (!nestedIn.has(c.compound)) nestedIn.set(c.compound, []);
57
+ if (!nestedIn.get(c.compound).includes(tl.name)) nestedIn.get(c.compound).push(tl.name);
58
+ }
59
+ }
60
+ }
61
+ }
62
+ return tls.map((tl, index) => {
49
63
  const vids = (tl.videoTracks || []).reduce((n, t) => n + (t.clips ? t.clips.length : 0), 0);
50
64
  const auds = (tl.audioTracks || []).reduce((n, t) => n + (t.clips ? t.clips.length : 0), 0);
51
65
  return {
@@ -53,6 +67,8 @@ export function summarizeDrtTimelines(parsed) {
53
67
  name: tl.name || `Sequence ${index + 1}`,
54
68
  eventCount: vids + auds,
55
69
  index,
70
+ ...(tl.kind ? { kind: tl.kind } : {}),
71
+ nestedIn: nestedIn.get(tl.name) || [],
56
72
  };
57
73
  });
58
74
  }
@@ -153,7 +153,7 @@ function requirePathArg(args, key, action) {
153
153
  export const drtTool = {
154
154
  name: 'drt',
155
155
  description:
156
- 'DaVinci Resolve Timeline (.drt) operations — offline, no Resolve required. Actions: assemble_from_interchange (EDL/OTIO/XML/AAF + sourceMap → IMPORTABLE RENDERING native .drt in one call; retimes AUTHOR — constant speed fwd/rev AND zero-speed freezes (EDL M2 000.0; render-proven frozen); cross-dissolves are AUTHORED when the cut abuts with handles both sides (render-verified on 19), else dropped with reason; fades AUTHOR across ALL FOUR formats (EDL BL legs, OTIO gap-adjacent Transitions, XMEML edge transitionitems, AAF filler-adjacent Transitions) and AAF overlap-consuming dissolves reconcile+author (CutPoint honored; before E93 they threw at the overlap gate) — BL legs become Solid Color generators and the fade a real clip-to-generator dissolve, luma-ramp render-verified, while Resolve\'s OWN EDL importer drops BL dissolves silently; ledger in `conform`), assemble (spec → IMPORTABLE native-schema .drt via template-spliced real structures; pass targetAppVersion e.g. \'19.1\' for pre-21 hosts), parse, list_sequences (enumerate the timelines inside a .drp/.drt → [{id,name,eventCount,index}] to drive a "which sequence?" picker), author, validate, inject_into_drp, extract_from_drp (pull one SeqContainer out as a .drt — feed the .drt to the Python davinci-resolve MCP timeline.import_timeline_checked, or use timeline.import_from_drp to do both), downgrade (stamp <ProjectVersion> down so an OLDER Resolve will import a .drt/.drp from a newer one — pass targetAppVersion like "19.1.3" or targetProjectVersion).',
156
+ 'DaVinci Resolve Timeline (.drt) operations — offline, no Resolve required. Actions: assemble_from_interchange (EDL/OTIO/XML/AAF + sourceMap → IMPORTABLE RENDERING native .drt in one call; retimes AUTHOR — constant speed fwd/rev AND zero-speed freezes (EDL M2 000.0; render-proven frozen); cross-dissolves are AUTHORED when the cut abuts with handles both sides (render-verified on 19), else dropped with reason; fades AUTHOR across ALL FOUR formats (EDL BL legs, OTIO gap-adjacent Transitions, XMEML edge transitionitems, AAF filler-adjacent Transitions) and AAF overlap-consuming dissolves reconcile+author (CutPoint honored; before E93 they threw at the overlap gate) — BL legs become Solid Color generators and the fade a real clip-to-generator dissolve, luma-ramp render-verified, while Resolve\'s OWN EDL importer drops BL dissolves silently; ledger in `conform`), assemble (spec → IMPORTABLE native-schema .drt via template-spliced real structures; pass targetAppVersion e.g. \'19.1\' for pre-21 hosts), parse, list_sequences (enumerate the timelines inside a .drp/.drt → [{id,name,eventCount,index,kind,nestedIn}] to drive a "which sequence?" picker — names and kind (timeline|compound) come from the pool folder, since a SeqContainer carries no timeline name and its first <Name> is a CLIP\'s (measured, E127); a compound container is nestedIn every timeline that places it, and a media-less clip named after a compound is tagged `compound` in parse), author, validate, inject_into_drp, extract_from_drp (pull one SeqContainer out as a .drt — feed the .drt to the Python davinci-resolve MCP timeline.import_timeline_checked, or use timeline.import_from_drp to do both), downgrade (stamp <ProjectVersion> down so an OLDER Resolve will import a .drt/.drp from a newer one — pass targetAppVersion like "19.1.3" or targetProjectVersion).',
157
157
  async handler({ action, args }) {
158
158
  if (action === 'parse') {
159
159
  const p = parseSchema.parse(requirePathArg(args, 'drtPath', 'parse'));
@@ -58,6 +58,7 @@ function extractClipsFromTrackXml(trackXml, trackType) {
58
58
  }
59
59
  clips.push({
60
60
  clipId: m[3],
61
+ name: extractScalar(inner, 'Name'),
61
62
  start,
62
63
  duration,
63
64
  mediaFilePath,
@@ -94,9 +95,44 @@ function extractTracks(seqXml, trackVecTag, trackTagBase, trackType) {
94
95
  return tracks;
95
96
  }
96
97
 
97
- function parseSeqContainer(seqXml, sequenceName) {
98
- return {
99
- name: extractScalar(seqXml, 'Name') || sequenceName,
98
+ /**
99
+ * The pool folder's own naming of every sequence (E127, measured against
100
+ * Resolve 19.1.3.7's EXPORT_DRT of a compound timeline): a SeqContainer XML
101
+ * carries NO timeline name — its first <Name> is the first CLIP's — while
102
+ * MediaPool/Master/MpFolder.xml holds an Sm2MpTimelineClip (a timeline) or
103
+ * Sm2MpCompoundClip (a compound) whose EMBEDDED <Sm2Sequence DbId=X> equals
104
+ * the container's track-level <Sequence>X</Sequence>. Map X → {name, kind}.
105
+ */
106
+ async function loadPoolSequenceNames(zip) {
107
+ const map = new Map();
108
+ const entries = [];
109
+ zip.forEach((p, e) => { if (!e.dir && /(^|\/)MpFolder[^/]*\.xml$/.test(p)) entries.push(p); });
110
+ for (const p of entries) {
111
+ const xml = await zip.file(p).async('string');
112
+ const re = /<(Sm2MpTimelineClip|Sm2MpCompoundClip) DbId="([^"]+)">([\s\S]*?)<\/\1>/g;
113
+ let m;
114
+ while ((m = re.exec(xml)) !== null) {
115
+ const body = m[3];
116
+ const name = extractScalar(body, 'Name');
117
+ const seqRe = /<Sm2Sequence DbId="([^"]+)">/g;
118
+ let sm;
119
+ while ((sm = seqRe.exec(body)) !== null) {
120
+ if (!map.has(sm[1])) map.set(sm[1], { name, kind: m[1] === 'Sm2MpCompoundClip' ? 'compound' : 'timeline' });
121
+ }
122
+ }
123
+ }
124
+ return map;
125
+ }
126
+
127
+ function parseSeqContainer(seqXml, sequenceName, poolNames = new Map()) {
128
+ const seqId = extractScalar(seqXml, 'Sequence');
129
+ const pool = seqId ? poolNames.get(seqId) : null;
130
+ const compoundNames = new Set([...poolNames.values()].filter((v) => v.kind === 'compound' && v.name).map((v) => v.name));
131
+ const parsed = {
132
+ // The pool's name for this sequence when the export carries one; the
133
+ // first <Name> in the container is a CLIP name and only a fallback.
134
+ name: (pool && pool.name) || extractScalar(seqXml, 'Name') || sequenceName,
135
+ kind: pool ? pool.kind : null,
100
136
  sequence: sequenceName,
101
137
  frameRate: extractScalar(seqXml, 'FrameRate'),
102
138
  startTimecode: extractScalar(seqXml, 'StartTC'),
@@ -107,9 +143,16 @@ function parseSeqContainer(seqXml, sequenceName) {
107
143
  if (w === null || h === null) return null;
108
144
  return `${w}x${h}`;
109
145
  })(),
110
- videoTracks: extractTracks(seqXml, 'VideoTrackVec', 'Sm2TiVideoTrack', 'video'),
146
+ videoTracks: extractTracks(seqXml, 'VideoTrackVec', 'Sm2TiVideoTrack', 'video').map((t) => ({
147
+ ...t,
148
+ // A media-less clip named after a compound in the pool IS that compound
149
+ // placed on this track (E127) — tag it so consumers do not read it as a
150
+ // missing source.
151
+ clips: (t.clips || []).map((c) => (c.mediaFilePath == null && c.name && compoundNames.has(c.name) ? { ...c, compound: c.name } : c)),
152
+ })),
111
153
  audioTracks: extractTracks(seqXml, 'AudioTrackVec', 'Sm2TiAudioTrack', 'audio'),
112
154
  };
155
+ return parsed;
113
156
  }
114
157
 
115
158
  async function loadMetadata(zip) {
@@ -146,10 +189,11 @@ async function parseDRT(drtPathOrBuffer, options = {}) {
146
189
  throw new Error('parseDRT: no SeqContainer*.xml entries found — is this a DRT/DRP?');
147
190
  }
148
191
 
192
+ const poolNames = await loadPoolSequenceNames(zip);
149
193
  const timelines = [];
150
194
  for (const p of seqEntries) {
151
195
  const xml = await zip.file(p).async('string');
152
- timelines.push(parseSeqContainer(xml, p));
196
+ timelines.push(parseSeqContainer(xml, p, poolNames));
153
197
  }
154
198
 
155
199
  const metadata = await loadMetadata(zip);
@@ -87,7 +87,7 @@ if not logging.getLogger().handlers:
87
87
  handlers=[logging.StreamHandler()],
88
88
  )
89
89
 
90
- VERSION = "2.180.0"
90
+ VERSION = "2.181.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
@@ -11,7 +11,7 @@ Usage:
11
11
  python src/server.py --full # Start the 353-tool granular server instead
12
12
  """
13
13
 
14
- VERSION = "2.180.0"
14
+ VERSION = "2.181.0"
15
15
 
16
16
  import base64
17
17
  import os
@@ -2859,7 +2859,14 @@ API_TRUTH: List[Dict[str, Any]] = [
2859
2859
  "compound to a single media-less clipitem named after it "
2860
2860
  "(no inner content). editorial.parse_interchange flattens "
2861
2861
  "the OTIO Stacks into record time (fromCompound on each "
2862
- "cut).",
2862
+ "cut). EXPORT_DRT of the same timeline holds THREE "
2863
+ "SeqContainers (top + one per compound); a SeqContainer XML "
2864
+ "carries NO timeline name — its first <Name> is the first "
2865
+ "clip's — while MediaPool/Master/MpFolder.xml's "
2866
+ "Sm2MpTimelineClip / Sm2MpCompoundClip embed the "
2867
+ "<Sm2Sequence DbId> the container's track-level <Sequence> "
2868
+ "names (measured E127); the compound on the parent track is "
2869
+ "a plain Sm2TiVideoClip named after it with no MediaFilePath.",
2863
2870
  "recommended": "Author fade-to-white / colour mattes by placing a "
2864
2871
  "Solid Color generator with that blob "
2865
2872
  "(drp-format placeGenerator `color`, drt.assemble "