Development
pnpm install
pnpm dev
| Command | What |
|---|---|
pnpm dev |
tsx watch the server from source |
pnpm build |
tsc -p tsconfig.build.json → dist/ |
pnpm start, start:http |
Run the built server (stdio, HTTP); RESOLVE_ADAPTER=mock for the mock adapter |
pnpm typecheck |
tsc --noEmit over src/, tests/, scripts/ |
pnpm lint |
ESLint |
pnpm test |
Vitest unit + integration + security suites (mock DaVinci Resolve) |
pnpm test:live |
Live DaVinci Resolve end to end (TESTING.md) |
pnpm docs:tools |
Regenerate docs/TOOLS.md from the tool registry (scripts/gen-tool-docs.ts; CI fails if it is stale) |
node scripts/pack-release.mjs |
Release ZIP for the installers (release/davinci-resolve-mcp-<version>.zip + .sha256; run after pnpm build) |
node scripts/smoke-install.mjs |
Start an installed copy with the mock adapter, list tools, run one call |
Helper scripts (PowerShell, scripts/): install.ps1, build.ps1, launch.ps1, check-deps.ps1, diagnostics.ps1,
test-bridge.ps1, integration-test.ps1, new-token.ps1; macOS equivalents install.sh, diagnostics.sh, test-bridge.sh.
Single package: TypeScript in src/ compiled with tsc (NodeNext, .js import suffixes) to dist/. Python in
resolve-scripts/ runs as-is in the bridge worker and is not compiled. Use pnpm only.
Layout
| Path | Contents |
|---|---|
src/mcp/tools/ |
Tool modules (one per category), registry.ts and shared arguments (args.ts) |
src/resolve/bridge/ |
ResolveBridge, adapters (Python, Lua, mock), op allowlist, serial queue, install detection |
src/design-engine/, src/schemas/ |
Editing planner, presets and looks, workflow engine; shared Zod schemas |
src/jobs/ |
Background jobs |
resolve-scripts/ |
resolve_worker.py + *_manager.py op modules, fusion_helpers.lua |
installers/, site/ |
One-line installers and the Astro docs site (renders docs/*.md) |
Adding a tool
- If DaVinci Resolve needs a new operation, implement it in the right
resolve-scripts/*_manager.pymodule and register it with@op("area.name"). Return plain JSON-serialisable data, usecheck()on API return values and raise the errors fromresolve-scripts/errors.pyfor expected failures. Add the op name toBRIDGE_OPSinsrc/resolve/bridge/commands.ts;tests/unit/bridge.test.tsfails if the allowlist and the Python registry differ. Add a handler toMockResolve(src/resolve/bridge/mock-adapter.ts) if tests need realistic state. - Define the tool in
src/mcp/tools/<category>.tswithreg.define({ name, category, description, input: { zod shape }, handler }):readOnly: truefor inspection,destructive: truefor anything that deletes or discards work (addsconfirm),background: truefor calls that can run for minutes (addsbackground). Userun()for one op; write paths throughctx.paths.write(...), read paths throughctx.paths.read(...). - If a feature cannot be implemented, use
reg.unsupported(name, category, description, reason, alternative)— never return a fake success. - Add a test in
tests/unit, runpnpm docs:tools, and if it touches DaVinci Resolve,pnpm test:live.
Debugging the bridge
- Every op is recorded (
mcp_bridge_statusshows the adapter, queue and recent ops with timing;LOG_LEVEL=debuglogsbridge okwithopandms, plus the worker’s stderr). - Run an op directly:
echo '{"id":"1","op":"app.status","params":{}}' | python -u resolve-scripts/resolve_worker.py, or list the registered ops with--list-ops. - Errors carry the API method and arguments in
error.details. - Method names come from Resolve’s own
Support/Developer/Scripting/README.txt; probe newer methods withhas()/require_method()so older versions reportunsupported.
Conventions
- Strict TypeScript, Zod for every input, structured
McpToolErrorcodes. - Logs go to stderr only (stdout is the stdio transport).
- Non-destructive first: new timelines, grade versions, render jobs; project backups before destructive changes.
Releases are cut from GitHub Actions (see CONTRIBUTING.md).