Skip to main content
Glama

DaVinci Resolve MCP Server

by hnethery
platform.py3.09 kB
#!/usr/bin/env python3 """ Platform-specific functionality for DaVinci Resolve MCP Server """ import os import sys import platform import logging logger = logging.getLogger("davinci-resolve-mcp.platform") def get_platform(): """Identify the current operating system platform. Returns: str: 'windows', 'darwin' (macOS), or 'linux' """ system = platform.system().lower() if system == 'darwin': return 'darwin' elif system == 'windows': return 'windows' elif system == 'linux': return 'linux' return system def get_resolve_paths(): """Get platform-specific paths for DaVinci Resolve scripting API. Returns: dict: Dictionary containing api_path, lib_path, and modules_path """ platform_name = get_platform() if platform_name == 'darwin': # macOS api_path = "/Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting" lib_path = "/Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fusionscript.so" modules_path = os.path.join(api_path, "Modules") elif platform_name == 'windows': # Windows program_files = os.environ.get('PROGRAMDATA', 'C:\\ProgramData') program_files_64 = os.environ.get('PROGRAMFILES', 'C:\\Program Files') api_path = os.path.join(program_files, 'Blackmagic Design', 'DaVinci Resolve', 'Support', 'Developer', 'Scripting') lib_path = os.path.join(program_files_64, 'Blackmagic Design', 'DaVinci Resolve', 'fusionscript.dll') modules_path = os.path.join(api_path, "Modules") elif platform_name == 'linux': # Linux (not fully implemented) # Default locations for Linux - these may need to be adjusted api_path = "/opt/resolve/Developer/Scripting" lib_path = "/opt/resolve/libs/fusionscript.so" modules_path = os.path.join(api_path, "Modules") else: # Fallback to macOS paths if unknown platform api_path = "/Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting" lib_path = "/Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fusionscript.so" modules_path = os.path.join(api_path, "Modules") return { "api_path": api_path, "lib_path": lib_path, "modules_path": modules_path } def setup_environment(): """Set up environment variables for DaVinci Resolve scripting. Returns: bool: True if setup was successful, False otherwise """ try: paths = get_resolve_paths() os.environ["RESOLVE_SCRIPT_API"] = paths["api_path"] os.environ["RESOLVE_SCRIPT_LIB"] = paths["lib_path"] # Add modules path to Python's path if it's not already there if paths["modules_path"] not in sys.path: sys.path.append(paths["modules_path"]) return True except Exception as e: logger.error(f"Error setting up environment: {str(e)}") return False

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hnethery/davinci-resolve-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server