davinci-resolve-mcp 2.23.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.
Files changed (92) hide show
  1. package/AGENTS.md +85 -0
  2. package/CHANGELOG.md +802 -0
  3. package/CLAUDE.md +15 -0
  4. package/LICENSE +21 -0
  5. package/README.md +159 -0
  6. package/SECURITY.md +53 -0
  7. package/bin/davinci-resolve-mcp.mjs +376 -0
  8. package/docs/README.md +56 -0
  9. package/docs/SKILL.md +1145 -0
  10. package/docs/authoring/fuse-dctl-authoring.md +242 -0
  11. package/docs/authoring/script-plugin-authoring.md +195 -0
  12. package/docs/contributing.md +82 -0
  13. package/docs/guides/color-decision-guide.md +387 -0
  14. package/docs/guides/editorial-decision-guide.md +136 -0
  15. package/docs/guides/media-analysis-guide.md +615 -0
  16. package/docs/guides/multicam-setup-guide.md +138 -0
  17. package/docs/install.md +198 -0
  18. package/docs/integrations/workflow-integrations.md +120 -0
  19. package/docs/kernels/README.md +28 -0
  20. package/docs/kernels/audio-fairlight-kernel.md +86 -0
  21. package/docs/kernels/color-grade-kernel.md +103 -0
  22. package/docs/kernels/extension-authoring-kernel.md +101 -0
  23. package/docs/kernels/fusion-composition-kernel.md +91 -0
  24. package/docs/kernels/media-pool-ingest-kernel.md +147 -0
  25. package/docs/kernels/project-lifecycle-kernel.md +120 -0
  26. package/docs/kernels/render-deliver-kernel.md +92 -0
  27. package/docs/kernels/review-annotation-kernel.md +110 -0
  28. package/docs/kernels/timeline-conform-interchange-kernel.md +99 -0
  29. package/docs/kernels/timeline-edit-kernel.md +189 -0
  30. package/docs/notes/codec-plugin-notes.md +136 -0
  31. package/docs/notes/dctl-notes.md +234 -0
  32. package/docs/notes/fusion-template-notes.md +136 -0
  33. package/docs/notes/lut-notes.md +136 -0
  34. package/docs/notes/openfx-notes.md +120 -0
  35. package/docs/process/release-process.md +152 -0
  36. package/docs/reference/api-coverage.md +488 -0
  37. package/docs/reference/resolve_scripting_api.txt +1012 -0
  38. package/examples/README.md +53 -0
  39. package/examples/markers/README.md +81 -0
  40. package/examples/media/README.md +94 -0
  41. package/examples/timeline/README.md +98 -0
  42. package/install.py +1196 -0
  43. package/package.json +52 -0
  44. package/scripts/audit_api_parity.py +275 -0
  45. package/scripts/live_media_analysis_polish_probe.py +65 -0
  46. package/src/__init__.py +3 -0
  47. package/src/analysis_dashboard.py +4936 -0
  48. package/src/control_panel.py +13 -0
  49. package/src/granular/__init__.py +17 -0
  50. package/src/granular/common.py +727 -0
  51. package/src/granular/folder.py +287 -0
  52. package/src/granular/gallery.py +306 -0
  53. package/src/granular/graph.py +309 -0
  54. package/src/granular/media_pool.py +679 -0
  55. package/src/granular/media_pool_item.py +852 -0
  56. package/src/granular/media_storage.py +179 -0
  57. package/src/granular/project.py +1594 -0
  58. package/src/granular/resolve_control.py +521 -0
  59. package/src/granular/timeline.py +1074 -0
  60. package/src/granular/timeline_item.py +2251 -0
  61. package/src/resolve_mcp_server.py +43 -0
  62. package/src/server.py +15691 -0
  63. package/src/utils/__init__.py +3 -0
  64. package/src/utils/app_control.py +319 -0
  65. package/src/utils/audio_fairlight_live_probe.py +263 -0
  66. package/src/utils/cdl.py +20 -0
  67. package/src/utils/cloud_operations.py +192 -0
  68. package/src/utils/color_grade_live_probe.py +444 -0
  69. package/src/utils/dctl_templates.py +368 -0
  70. package/src/utils/extension_authoring_live_probe.py +292 -0
  71. package/src/utils/fuse_templates.py +1968 -0
  72. package/src/utils/fusion_composition_live_probe.py +284 -0
  73. package/src/utils/layout_presets.py +333 -0
  74. package/src/utils/mcp_stdio.py +32 -0
  75. package/src/utils/media_analysis.py +3618 -0
  76. package/src/utils/media_analysis_jobs.py +796 -0
  77. package/src/utils/media_pool_ingest_live_probe.py +592 -0
  78. package/src/utils/multicam.py +393 -0
  79. package/src/utils/object_inspection.py +287 -0
  80. package/src/utils/platform.py +157 -0
  81. package/src/utils/project_lifecycle_live_probe.py +376 -0
  82. package/src/utils/project_properties.py +601 -0
  83. package/src/utils/render_deliver_live_probe.py +384 -0
  84. package/src/utils/resolve_connection.py +77 -0
  85. package/src/utils/review_annotation_live_probe.py +352 -0
  86. package/src/utils/script_templates.py +1193 -0
  87. package/src/utils/sync_detection.py +887 -0
  88. package/src/utils/timeline_conform_live_probe.py +280 -0
  89. package/src/utils/timeline_kernel_live_probe.py +1091 -0
  90. package/src/utils/timeline_kernel_probe.py +185 -0
  91. package/src/utils/timeline_title_text.py +87 -0
  92. package/src/utils/update_check.py +610 -0
@@ -0,0 +1,521 @@
1
+ """Resolve control resources, inspection helpers, and app-level tools."""
2
+
3
+ from src.granular.common import * # noqa: F401,F403
4
+
5
+ resolve = ResolveProxy()
6
+
7
+ @mcp.resource("resolve://version")
8
+ def get_resolve_version() -> str:
9
+ """Get DaVinci Resolve version information."""
10
+ resolve = get_resolve()
11
+ if resolve is None:
12
+ return "Error: Not connected to DaVinci Resolve"
13
+ return f"{resolve.GetProductName()} {resolve.GetVersionString()}"
14
+
15
+
16
+ @mcp.resource("resolve://current-page")
17
+ def get_current_page() -> str:
18
+ """Get the current page open in DaVinci Resolve (Edit, Color, Fusion, etc.)."""
19
+ resolve = get_resolve()
20
+ if resolve is None:
21
+ return "Error: Not connected to DaVinci Resolve"
22
+ return resolve.GetCurrentPage()
23
+
24
+
25
+ @mcp.tool(annotations=IDEMPOTENT_WRITE_TOOL)
26
+ def switch_page(page: str) -> str:
27
+ """Switch to a specific page in DaVinci Resolve.
28
+
29
+ Args:
30
+ page: The page to switch to. Options: 'media', 'cut', 'edit', 'fusion', 'color', 'fairlight', 'deliver'
31
+ """
32
+ resolve = get_resolve()
33
+ if resolve is None:
34
+ return "Error: Not connected to DaVinci Resolve"
35
+
36
+ valid_pages = ['media', 'cut', 'edit', 'fusion', 'color', 'fairlight', 'deliver']
37
+ page = page.lower()
38
+
39
+ if page not in valid_pages:
40
+ return f"Error: Invalid page name. Must be one of: {', '.join(valid_pages)}"
41
+
42
+ result = resolve.OpenPage(page)
43
+ if result:
44
+ return f"Successfully switched to {page} page"
45
+ else:
46
+ return f"Failed to switch to {page} page"
47
+
48
+
49
+ @mcp.resource("resolve://inspect/resolve")
50
+ def inspect_resolve_object() -> Dict[str, Any]:
51
+ """Inspect the main resolve object and return its methods and properties."""
52
+ resolve = get_resolve()
53
+ if resolve is None:
54
+ return {"error": "Not connected to DaVinci Resolve"}
55
+
56
+ return inspect_object(resolve)
57
+
58
+
59
+ @mcp.resource("resolve://inspect/project-manager")
60
+ def inspect_project_manager_object() -> Dict[str, Any]:
61
+ """Inspect the project manager object and return its methods and properties."""
62
+ project_manager = get_project_manager()
63
+ if not project_manager:
64
+ return {"error": "Failed to get Project Manager"}
65
+
66
+ return inspect_object(project_manager)
67
+
68
+
69
+ @mcp.resource("resolve://inspect/current-project")
70
+ def inspect_current_project_object() -> Dict[str, Any]:
71
+ """Inspect the current project object and return its methods and properties."""
72
+ pm, current_project = get_current_project()
73
+ if not current_project:
74
+ return {"error": "No project currently open"}
75
+
76
+ return inspect_object(current_project)
77
+
78
+
79
+ @mcp.resource("resolve://inspect/media-pool")
80
+ def inspect_media_pool_object() -> Dict[str, Any]:
81
+ """Inspect the media pool object and return its methods and properties."""
82
+ pm, current_project = get_current_project()
83
+ if not current_project:
84
+ return {"error": "No project currently open"}
85
+
86
+ media_pool = current_project.GetMediaPool()
87
+ if not media_pool:
88
+ return {"error": "Failed to get Media Pool"}
89
+
90
+ return inspect_object(media_pool)
91
+
92
+
93
+ @mcp.resource("resolve://inspect/current-timeline")
94
+ def inspect_current_timeline_object() -> Dict[str, Any]:
95
+ """Inspect the current timeline object and return its methods and properties."""
96
+ pm, current_project = get_current_project()
97
+ if not current_project:
98
+ return {"error": "No project currently open"}
99
+
100
+ current_timeline = current_project.GetCurrentTimeline()
101
+ if not current_timeline:
102
+ return {"error": "No timeline currently active"}
103
+
104
+ return inspect_object(current_timeline)
105
+
106
+
107
+ @mcp.tool()
108
+ def object_help(object_type: str) -> str:
109
+ """
110
+ Get human-readable help for a DaVinci Resolve API object.
111
+
112
+ Args:
113
+ object_type: Type of object to get help for ('resolve', 'project_manager',
114
+ 'project', 'media_pool', 'timeline', 'media_storage')
115
+ """
116
+ resolve = get_resolve()
117
+ if resolve is None:
118
+ return "Error: Not connected to DaVinci Resolve"
119
+
120
+ # Map object type string to actual object
121
+ obj = None
122
+
123
+ if object_type == 'resolve':
124
+ obj = resolve
125
+ elif object_type == 'project_manager':
126
+ obj = resolve.GetProjectManager()
127
+ elif object_type == 'project':
128
+ pm = resolve.GetProjectManager()
129
+ if pm:
130
+ obj = pm.GetCurrentProject()
131
+ elif object_type == 'media_pool':
132
+ pm = resolve.GetProjectManager()
133
+ if pm:
134
+ project = pm.GetCurrentProject()
135
+ if project:
136
+ obj = project.GetMediaPool()
137
+ elif object_type == 'timeline':
138
+ pm = resolve.GetProjectManager()
139
+ if pm:
140
+ project = pm.GetCurrentProject()
141
+ if project:
142
+ obj = project.GetCurrentTimeline()
143
+ elif object_type == 'media_storage':
144
+ obj = resolve.GetMediaStorage()
145
+ else:
146
+ return f"Error: Unknown object type '{object_type}'"
147
+
148
+ if obj is None:
149
+ return f"Error: Failed to get {object_type} object"
150
+
151
+ # Generate and return help text
152
+ return print_object_help(obj)
153
+
154
+
155
+ @mcp.tool()
156
+ def inspect_custom_object(object_path: str) -> Dict[str, Any]:
157
+ """
158
+ Inspect a custom DaVinci Resolve API object by path.
159
+
160
+ Args:
161
+ object_path: Path to the object using dot notation (e.g., 'resolve.GetMediaStorage()')
162
+ """
163
+ resolve = get_resolve()
164
+ if resolve is None:
165
+ return {"error": "Not connected to DaVinci Resolve"}
166
+
167
+ try:
168
+ # Start with resolve object
169
+ obj = resolve
170
+
171
+ # Split the path and traverse down
172
+ parts = object_path.split('.')
173
+
174
+ # Skip the first part if it's 'resolve'
175
+ start_index = 1 if parts[0].lower() == 'resolve' else 0
176
+
177
+ for i in range(start_index, len(parts)):
178
+ part = parts[i]
179
+
180
+ # Check if it's a method call
181
+ if part.endswith('()'):
182
+ method_name = part[:-2]
183
+ if hasattr(obj, method_name) and callable(getattr(obj, method_name)):
184
+ obj = getattr(obj, method_name)()
185
+ else:
186
+ return {"error": f"Method '{method_name}' not found or not callable"}
187
+ else:
188
+ # It's an attribute access
189
+ if hasattr(obj, part):
190
+ obj = getattr(obj, part)
191
+ else:
192
+ return {"error": f"Attribute '{part}' not found"}
193
+
194
+ # Inspect the object we've retrieved
195
+ return inspect_object(obj)
196
+ except Exception as e:
197
+ return {"error": f"Error inspecting object: {str(e)}"}
198
+
199
+
200
+ @mcp.resource("resolve://layout-presets")
201
+ def get_layout_presets() -> List[Dict[str, Any]]:
202
+ """Get all available layout presets for DaVinci Resolve."""
203
+ resolve = get_resolve()
204
+ if resolve is None:
205
+ return {"error": "Not connected to DaVinci Resolve"}
206
+
207
+ return list_layout_presets(layout_type="ui")
208
+
209
+
210
+ @mcp.tool()
211
+ def save_layout_preset_tool(preset_name: str) -> Dict[str, Any]:
212
+ """Save the current UI layout as a preset.
213
+
214
+ Calls Resolve.SaveLayoutPreset() to save the current UI layout.
215
+
216
+ Args:
217
+ preset_name: Name for the saved preset.
218
+ """
219
+ resolve = get_resolve()
220
+ if resolve is None:
221
+ return {"error": "Not connected to DaVinci Resolve"}
222
+ result = resolve.SaveLayoutPreset(preset_name)
223
+ return {"success": bool(result), "preset_name": preset_name}
224
+
225
+
226
+ @mcp.tool()
227
+ def load_layout_preset_tool(preset_name: str) -> Dict[str, Any]:
228
+ """Load a UI layout preset.
229
+
230
+ Calls Resolve.LoadLayoutPreset() to load a saved UI layout.
231
+
232
+ Args:
233
+ preset_name: Name of the preset to load.
234
+ """
235
+ resolve = get_resolve()
236
+ if resolve is None:
237
+ return {"error": "Not connected to DaVinci Resolve"}
238
+ result = resolve.LoadLayoutPreset(preset_name)
239
+ return {"success": bool(result), "preset_name": preset_name}
240
+
241
+
242
+ @mcp.tool()
243
+ def export_layout_preset_tool(preset_name: str, export_path: str) -> Dict[str, Any]:
244
+ """Export a layout preset to a file.
245
+
246
+ Calls Resolve.ExportLayoutPreset() to export a preset to disk.
247
+
248
+ Args:
249
+ preset_name: Name of the preset to export.
250
+ export_path: Absolute file path to export the preset to.
251
+ """
252
+ resolve = get_resolve()
253
+ if resolve is None:
254
+ return {"error": "Not connected to DaVinci Resolve"}
255
+ result = resolve.ExportLayoutPreset(preset_name, export_path)
256
+ return {"success": bool(result), "preset_name": preset_name, "export_path": export_path}
257
+
258
+
259
+ @mcp.tool()
260
+ def import_layout_preset_tool(import_path: str, preset_name: str = None) -> Dict[str, Any]:
261
+ """Import a layout preset from a file.
262
+
263
+ Calls Resolve.ImportLayoutPreset() to import a preset from disk.
264
+
265
+ Args:
266
+ import_path: Absolute path to the preset file to import.
267
+ preset_name: Name to save the imported preset as (uses filename if None).
268
+ """
269
+ resolve = get_resolve()
270
+ if resolve is None:
271
+ return {"error": "Not connected to DaVinci Resolve"}
272
+ if preset_name:
273
+ result = resolve.ImportLayoutPreset(import_path, preset_name)
274
+ else:
275
+ result = resolve.ImportLayoutPreset(import_path)
276
+ preset_name = os.path.splitext(os.path.basename(import_path))[0]
277
+ return {"success": bool(result), "preset_name": preset_name, "import_path": import_path}
278
+
279
+
280
+ @mcp.tool()
281
+ def delete_layout_preset_tool(preset_name: str) -> Dict[str, Any]:
282
+ """Delete a layout preset.
283
+
284
+ Calls Resolve.DeleteLayoutPreset() to remove a saved preset.
285
+
286
+ Args:
287
+ preset_name: Name of the preset to delete.
288
+ """
289
+ resolve = get_resolve()
290
+ if resolve is None:
291
+ return {"error": "Not connected to DaVinci Resolve"}
292
+ result = resolve.DeleteLayoutPreset(preset_name)
293
+ return {"success": bool(result), "preset_name": preset_name}
294
+
295
+
296
+ @mcp.resource("resolve://app/state")
297
+ def get_app_state_endpoint() -> Dict[str, Any]:
298
+ """Get DaVinci Resolve application state information."""
299
+ resolve = get_resolve()
300
+ if resolve is None:
301
+ return {"error": "Not connected to DaVinci Resolve", "connected": False}
302
+
303
+ return get_app_state(resolve)
304
+
305
+
306
+ @mcp.tool()
307
+ def quit_app(force: bool = False, save_project: bool = True) -> str:
308
+ """
309
+ Quit DaVinci Resolve application.
310
+
311
+ Args:
312
+ force: Whether to force quit even if unsaved changes (potentially dangerous)
313
+ save_project: Whether to save the project before quitting
314
+ """
315
+ resolve = get_resolve()
316
+ if resolve is None:
317
+ return "Error: Not connected to DaVinci Resolve"
318
+
319
+ result = quit_resolve_app(resolve, force, save_project)
320
+
321
+ if result:
322
+ return "DaVinci Resolve quit command sent successfully"
323
+ else:
324
+ return "Failed to quit DaVinci Resolve"
325
+
326
+
327
+ @mcp.tool()
328
+ def restart_app(wait_seconds: int = 5) -> str:
329
+ """
330
+ Restart DaVinci Resolve application.
331
+
332
+ Args:
333
+ wait_seconds: Seconds to wait between quit and restart
334
+ """
335
+ resolve = get_resolve()
336
+ if resolve is None:
337
+ return "Error: Not connected to DaVinci Resolve"
338
+
339
+ result = restart_resolve_app(resolve, wait_seconds)
340
+
341
+ if result:
342
+ return "DaVinci Resolve restart initiated successfully"
343
+ else:
344
+ return "Failed to restart DaVinci Resolve"
345
+
346
+
347
+ @mcp.tool()
348
+ def open_settings() -> str:
349
+ """Open the Project Settings dialog in DaVinci Resolve."""
350
+ resolve = get_resolve()
351
+ if resolve is None:
352
+ return "Error: Not connected to DaVinci Resolve"
353
+
354
+ result = open_project_settings(resolve)
355
+
356
+ if result:
357
+ return "Project Settings dialog opened successfully"
358
+ else:
359
+ return "Failed to open Project Settings dialog"
360
+
361
+
362
+ @mcp.tool()
363
+ def open_app_preferences() -> str:
364
+ """Open the Preferences dialog in DaVinci Resolve."""
365
+ resolve = get_resolve()
366
+ if resolve is None:
367
+ return "Error: Not connected to DaVinci Resolve"
368
+
369
+ result = open_preferences(resolve)
370
+
371
+ if result:
372
+ return "Preferences dialog opened successfully"
373
+ else:
374
+ return "Failed to open Preferences dialog"
375
+
376
+
377
+ @mcp.tool()
378
+ def get_resolve_version_fields() -> Dict[str, Any]:
379
+ """Get DaVinci Resolve version as structured fields [major, minor, patch, build, suffix]."""
380
+ resolve = get_resolve()
381
+ if resolve is None:
382
+ return {"error": "Not connected to DaVinci Resolve"}
383
+ version = resolve.GetVersion()
384
+ if version:
385
+ return {"major": version[0], "minor": version[1], "patch": version[2], "build": version[3], "suffix": version[4] if len(version) > 4 else ""}
386
+ return {"error": "Failed to get version"}
387
+
388
+
389
+ @mcp.tool()
390
+ def get_fusion_object() -> Dict[str, Any]:
391
+ """Get the Fusion object. Starting point for Fusion scripts."""
392
+ resolve = get_resolve()
393
+ if resolve is None:
394
+ return {"error": "Not connected to DaVinci Resolve"}
395
+ fusion = resolve.Fusion()
396
+ if fusion:
397
+ return {"success": True, "fusion_available": True}
398
+ return {"success": False, "fusion_available": False}
399
+
400
+
401
+ @mcp.tool()
402
+ def update_layout_preset(preset_name: str) -> Dict[str, Any]:
403
+ """Overwrite an existing layout preset with the current UI layout.
404
+
405
+ Args:
406
+ preset_name: Name of the preset to overwrite.
407
+ """
408
+ resolve = get_resolve()
409
+ if resolve is None:
410
+ return {"error": "Not connected to DaVinci Resolve"}
411
+ result = resolve.UpdateLayoutPreset(preset_name)
412
+ return {"success": bool(result), "preset_name": preset_name}
413
+
414
+
415
+ @mcp.tool()
416
+ def import_render_preset(preset_path: str) -> Dict[str, Any]:
417
+ """Import a render preset from a file.
418
+
419
+ Args:
420
+ preset_path: Absolute path to the render preset file.
421
+ """
422
+ resolve = get_resolve()
423
+ if resolve is None:
424
+ return {"error": "Not connected to DaVinci Resolve"}
425
+ result = resolve.ImportRenderPreset(preset_path)
426
+ return {"success": bool(result), "preset_path": preset_path}
427
+
428
+
429
+ @mcp.tool()
430
+ def export_render_preset(preset_name: str, export_path: str) -> Dict[str, Any]:
431
+ """Export a render preset to a file.
432
+
433
+ Args:
434
+ preset_name: Name of the render preset to export.
435
+ export_path: Absolute path where the preset file will be saved.
436
+ """
437
+ resolve = get_resolve()
438
+ if resolve is None:
439
+ return {"error": "Not connected to DaVinci Resolve"}
440
+ result = resolve.ExportRenderPreset(preset_name, export_path)
441
+ return {"success": bool(result), "preset_name": preset_name, "export_path": export_path}
442
+
443
+
444
+ @mcp.tool()
445
+ def import_burn_in_preset(preset_path: str) -> Dict[str, Any]:
446
+ """Import a burn-in preset from a file.
447
+
448
+ Args:
449
+ preset_path: Absolute path to the burn-in preset file.
450
+ """
451
+ resolve = get_resolve()
452
+ if resolve is None:
453
+ return {"error": "Not connected to DaVinci Resolve"}
454
+ result = resolve.ImportBurnInPreset(preset_path)
455
+ return {"success": bool(result), "preset_path": preset_path}
456
+
457
+
458
+ @mcp.tool()
459
+ def export_burn_in_preset(preset_name: str, export_path: str) -> Dict[str, Any]:
460
+ """Export a burn-in preset to a file.
461
+
462
+ Args:
463
+ preset_name: Name of the burn-in preset to export.
464
+ export_path: Absolute path where the preset file will be saved.
465
+ """
466
+ resolve = get_resolve()
467
+ if resolve is None:
468
+ return {"error": "Not connected to DaVinci Resolve"}
469
+ result = resolve.ExportBurnInPreset(preset_name, export_path)
470
+ return {"success": bool(result), "preset_name": preset_name, "export_path": export_path}
471
+
472
+
473
+ @mcp.tool()
474
+ def get_keyframe_mode() -> Dict[str, Any]:
475
+ """Get the current keyframe mode in Resolve. Returns 0=ALL, 1=COLOR, 2=SIZING."""
476
+ resolve = get_resolve()
477
+ if resolve is None:
478
+ return {"error": "Not connected to DaVinci Resolve"}
479
+ mode = resolve.GetKeyframeMode()
480
+ mode_names = {0: "All", 1: "Color", 2: "Sizing"}
481
+ return {"keyframe_mode": mode, "mode_name": mode_names.get(mode, "Unknown")}
482
+
483
+
484
+ @mcp.tool()
485
+ def set_keyframe_mode(mode: int) -> Dict[str, Any]:
486
+ """Set the keyframe mode in Resolve.
487
+
488
+ Args:
489
+ mode: Keyframe mode - 0=All, 1=Color, 2=Sizing.
490
+ """
491
+ resolve = get_resolve()
492
+ if resolve is None:
493
+ return {"error": "Not connected to DaVinci Resolve"}
494
+ if mode not in (0, 1, 2):
495
+ return {"error": "Invalid mode. Must be 0 (All), 1 (Color), or 2 (Sizing)"}
496
+ result = resolve.SetKeyframeMode(mode)
497
+ mode_names = {0: "All", 1: "Color", 2: "Sizing"}
498
+ return {"success": bool(result), "keyframe_mode": mode, "mode_name": mode_names[mode]}
499
+
500
+
501
+ @mcp.tool()
502
+ def get_fairlight_presets() -> Dict[str, Any]:
503
+ """Get the available Fairlight preset names."""
504
+ resolve = get_resolve()
505
+ if resolve is None:
506
+ return {"error": "Not connected to DaVinci Resolve"}
507
+ missing = _requires_method(resolve, "GetFairlightPresets", "20.2.2")
508
+ if missing:
509
+ return missing
510
+ presets = resolve.GetFairlightPresets()
511
+ return {"presets": presets if presets else []}
512
+
513
+
514
+ @mcp.tool()
515
+ def quit_resolve() -> Dict[str, Any]:
516
+ """Quit DaVinci Resolve. WARNING: This will close the application."""
517
+ resolve = get_resolve()
518
+ if resolve is None:
519
+ return {"error": "Not connected to DaVinci Resolve"}
520
+ result = resolve.Quit()
521
+ return {"success": True, "message": "DaVinci Resolve is quitting"}