Framekit Docs
日本語GitHub

Your First Video

Run and verify a disposable headless video example.

Make a two-second video in a new Framekit-owned project, inspect the preview and resulting timeline, and independently check the MP4. This headless example does not open or edit Final Cut Pro. For plugin setup, see Installation.

Prerequisites #

The commands below were checked on macOS 26.5.1 with Node.js 22.23.5, npm, FFmpeg/ffprobe 9.0.2, and the published Framekit v0.2.6 server at commit 2f6f03b6a0cba5b5cb5d4a3ea0f44c3ffa9cdf6c. FFmpeg must provide the libx264 encoder. Install Git only if you also want a repository checkout; this example does not require one. The published package supports Node.js 20 or newer, but this exact example was checked with the version above.

The scripted MCP workflow below is separate from the framekit-local prompt run described later on this page. Both used real sample media.

Download the sample and tools #

Sample Flash Animation by H0iadfpwijdf is an original work dedicated to the public domain under CC0 1.0. It is 14,384 bytes. Create a new directory, install the pinned MCP client and Framekit package, and download the sample and example client:

Terminal
mkdir framekit-first-video
cd framekit-first-video
npm install --no-save --no-package-lock @morshoto/framekit@0.2.6 @modelcontextprotocol/sdk@1.32.2
curl -fL -o sample.webm 'https://commons.wikimedia.org/wiki/Special:FilePath/Sample_Flash_Animation.webm'
curl -fL -o first-video.mjs https://raw.githubusercontent.com/morshoto/framekit/0b876c9ef2a314b6c2601eabc980b74c3b3fcc14/apps/docs/public/examples/first-video.mjs
shasum -a 256 sample.webm

The source SHA-256 must be e96efec0c3bf57836b54cbead8d195564ee4e1303a320b343b4fda6642ce5904. Stop if it differs. The client also checks that digest and the installed server’s embedded version and commit before creating a project, then verifies the registered media digest again before preview. If it differs, the client stops before the edit; the disposable project and registration remain in the example state directory. The npm command and downloads write only within the new example directory and normal npm cache.

Preview and render #

Terminal
node first-video.mjs sample.webm

The client starts the pinned package in headless mode with automatic connection disabled, ignores inherited Final Cut socket and FCPXML settings, creates a disposable project, registers the source, and prints the proposed timeline and a new output path. It then asks for confirmation. Review the one sample-shot occurrence, starting at zero and lasting two seconds. Type yes to execute that same revision-bound edit and render; any other answer stops before edit execution and rendering. Project creation and media registration already write to the new Framekit-owned state directory. A successful run prints Result: passed and the directory containing first-video.mp4 and evidence.json.

The observed tool sequence was headless.project.create, headless.media.register, headless.edit.preview, headless.edit.execute, and headless.render. The render response and its verification both reported passed. If execution or verification fails, inspect the error and retained state before deciding what to do; do not blindly repeat an uncertain operation. The client prints its example directory before editing and saves evidence.json at each checkpoint. A status of edited records the committed project revision and timeline but does not prove rendering succeeded. A status of previewed does not prove a later dispatched edit failed; inspect the exact project state before deciding on another action.

Inspect and verify #

Change into the output directory printed by the program. To inspect the saved Framekit timeline before and after the edit:

Terminal
node --input-type=module <<'NODE'
import { readFileSync } from 'node:fs';
const evidence = JSON.parse(readFileSync('evidence.json', 'utf8'));
console.log('Before:', JSON.stringify(evidence.before, null, 2));
console.log('After:', JSON.stringify(evidence.after, null, 2));
NODE

In the observed run, the starting sequence had no occurrences and the resulting sequence had one two-second occurrence. Open first-video.mp4 in a player. This frame was extracted from an earlier v0.2.6 headless render of the same CC0 source and edit, not from Final Cut:

A stick figure from the rendered CC0 animation

Independently probe the output:

Terminal
ffprobe -v error -show_entries stream=codec_type,width,height,r_frame_rate -show_entries format=duration -of json first-video.mp4

The observed output contained 400 × 290 video at 12 fps, an audio stream, and a duration of 2.000000 seconds. The sample has an audio stream but its first two seconds are silent; silence in this example is expected and does not verify audible audio handling. Metadata alone does not prove visual or audio correctness; inspect playback as well.

To compare the first two seconds of the downloaded source with the rendered video, run this from the output directory printed by the program (the source remains in its parent directory):

Terminal
ffmpeg -hide_banner -nostdin -i ../sample.webm -i first-video.mp4 -filter_complex '[0:v]trim=duration=2,setpts=PTS-STARTPTS[source];[1:v]setpts=PTS-STARTPTS[render];[source][render]ssim' -an -f null -

The observed run compared 24 frames and reported SSIM ... All:0.996139; results can vary with FFmpeg and encoding versions. A high SSIM indicates similar video frames, not correct audio or a native Final Cut edit. Inspect playback as well. evidence.json can contain local paths: remove personal information before sharing it.

Optional Codex prompt #

The following prompt was exercised with framekit-local in the current Codex environment using the downloaded sample and runtime 0.2.6 at commit 7168ccca0fc0200dd7fdfb0dd09b97cffd99db4e. The user approved the displayed revision-bound preview before execution. This run used the headless path; it does not establish that an installed published plugin was used or that Final Cut was edited.

text
Use the downloaded sample.webm in this directory with Framekit and a new disposable headless project. Register it, inspect its media ID and current project revision, then preview inserting the first two seconds at the beginning of a 12 fps timeline. Show me the proposed timeline and wait for approval before executing. After approval, execute the reviewed edit, render a 400 × 290 MP4 at 12 fps to a new path, and inspect it with ffprobe. Report the revision, output path, and verification results. Do not open or modify Final Cut Pro.

The observed calls included headless.project.create, headless.media.register, headless.project.inspect, headless.edit.approved-preview, headless.edit.approved-execute, headless.project.open, and headless.render. The preview showed one clip from source 0–2 seconds at timeline 0–2 seconds with no warnings; execution followed user approval. Framekit reported a passed render and verification. An independent ffprobe reported H.264 video at 400 × 290, 12 fps and 24 frames, an AAC audio stream, and a duration of 2.000000 seconds. The sample's audio is silent, so this does not verify audible audio handling.

The framekit-local output played through in QuickTime. This is not evidence of a native Final Cut edit or published-plugin installation; check your installed server version when reproducing the prompt.

Candidate: review an interview short #

This separate, headless walkthrough uses a release-candidate package and real speech. The commands and output below describe one macOS run with Node.js 22.23.5, FFmpeg 9.0.2 and a locally built Framekit 0.3.0 candidate; they do not assert that 0.3.0 has been published. Use a fresh directory and a package from a candidate you trust. After publication, obtain the matching package through Installation and verify its identity before editing.

The interview is NASA's ISS astronaut video package. Check NASA's media guidance and any third-party or identifiable-person rights before sharing an output; this walkthrough does not imply NASA endorsement. The observed music was “Isolated” by Kevin MacLeod, licensed under CC BY 4.0. When sharing a video with that track, credit the title, author, source and license and indicate that the track was shortened, faded and mixed under speech.

From a new directory, prepare the two inputs. These commands write only in that directory; verify the download hashes before converting the files:

Terminal
mkdir framekit-interview-example
cd framekit-interview-example
curl -fL -A 'Mozilla/5.0' -o nasa-full.webm 'https://svs.gsfc.nasa.gov/vis/a010000/a014600/a014622/VIDEO_PACKAGE_6%3A_ISS_Astronaut_Video_.webm'
curl -fL -o isolated.mp3 'https://incompetech.com/music/royalty-free/mp3-royaltyfree/Isolated.mp3'
shasum -a 256 nasa-full.webm isolated.mp3

The observed source hashes were 7169612e99eb51a0f3d19e4d25b099f96e8341e437e7cca4a8ed3cc738549389 for the NASA file and e9fd0ea8bf305cfc03bccea597e0e7153d4c0bd5c065ed69d8d25b18f1db8510 for the music. Stop and investigate if either differs. The resulting files below are new derivatives, not the original downloads:

Terminal
ffmpeg -v error -i nasa-full.webm -t 52.4 -vf 'fps=30,scale=640:360' -c:v libx264 -preset veryfast -pix_fmt yuv420p -c:a aac -ar 48000 interview.mp4
ffmpeg -v error -i isolated.mp3 -t 46 -af 'afade=t=in:st=0:d=0.5,afade=t=out:st=45:d=1' -ar 44100 -ac 2 -c:a pcm_s16le music.wav
shasum -a 256 interview.mp4 music.wav

With the observed FFmpeg build, their hashes were 43f28a2f315d561228cbca5d4d708ec4efad83aa17625327c413bff5b804dd5c and 1c2ffa0eec8c31a6c041ab4bb01eb0df19f0a28816a083941cc99a6cb35645a2, respectively. Other encoder builds can produce different bytes: record the actual hashes and check that the registered sources retain those identities.

Install the local candidate tarball into a separate client directory; do not use an unpublished registry version as evidence of a candidate:

Terminal
mkdir client
npm install --prefix client --no-save --no-package-lock /absolute/path/to/morshoto-framekit-0.3.0.tgz @modelcontextprotocol/sdk@1.32.2
cat client/node_modules/@morshoto/framekit/dist-package/apps/mcp-server/src/build-identity.json

The observed candidate was commit d24989ac0c2c1221faf3a2e4ccd44c76ed87cf0b; the local tarball SHA-256 was 2712f50f63c5ccdf58228f939c9b37fde0adfe18fc0bfaa0baaa8419a3e83c3e. These identify that observation, not a later candidate or published release.

To check that a clean SDK client can start the installed server, run the following from inside client. It uses a new local state directory and closes the connection after reporting the server name and version:

Terminal
cd client
node --input-type=module <<'NODE'
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
import { resolve } from 'node:path';
const transport = new StdioClientTransport({
  command: process.execPath,
  args: [resolve('node_modules/@morshoto/framekit/bin/framekit.mjs'),
    'mcp', '--editor', 'final-cut-live'],
  env: { ...process.env, FRAMEKIT_EDITOR: 'final-cut-live',
    FRAMEKIT_AUTO_CONNECT: '0', FRAMEKIT_FINAL_CUT_HEADLESS: '1',
    FRAMEKIT_FINAL_CUT_NATIVE_WRITES: '0',
    FRAMEKIT_FINAL_CUT_SOCKET: resolve('no-native.sock'),
    FRAMEKIT_FCPXML_PATH: '', FRAMEKIT_STATE_DIR: resolve('state') },
});
const client = new Client({ name: 'framekit-startup-check', version: '1' });
await client.connect(transport);
console.log(JSON.stringify(client.getServerVersion()));
await client.close();
await transport.close();
NODE
cd ..

The observed response was {"name":"framekit","version":"0.3.0"}. This startup check does not configure an AI client or establish editing success.

To connect an AI client, add a new stdio server entry to its existing configuration; do not replace an existing entry. The following TOML shape is for a Codex client. Replace every /absolute/... placeholder with the actual path on your machine and select a name that does not collide with another server. Its PATH must include the Python environment containing the pinned Whisper/VAD dependencies, Node and FFmpeg. The state directory must be new and separate from existing projects.

toml
[mcp_servers.framekit-candidate]
command = "/absolute/path/to/node"
args = ["/absolute/path/to/client/node_modules/@morshoto/framekit/bin/framekit.mjs", "mcp", "--editor", "final-cut-live"]

[mcp_servers.framekit-candidate.env]
FRAMEKIT_EDITOR = "final-cut-live"
FRAMEKIT_AUTO_CONNECT = "0"
FRAMEKIT_FINAL_CUT_HEADLESS = "1"
FRAMEKIT_FINAL_CUT_NATIVE_WRITES = "0"
FRAMEKIT_FINAL_CUT_SOCKET = "/absolute/path/to/no-native.sock"
FRAMEKIT_FCPXML_PATH = ""
FRAMEKIT_STATE_DIR = "/absolute/path/to/new-state"
PATH = "/absolute/path/to/venv/bin:/absolute/path/to/node/bin:/opt/homebrew/bin:/usr/bin:/bin"
FRAMEKIT_SPEECH_ANALYZER = "/absolute/path/to/runtime/speech-analyzer-wrapper.mjs"
FRAMEKIT_SPEECH_BACKEND = "/absolute/path/to/runtime/whisper-speech-backend.py"
FRAMEKIT_WHISPER_BACKEND = "mlx-whisper"
FRAMEKIT_WHISPER_MODEL = "/absolute/path/to/prepared-model"
FRAMEKIT_SPEECH_ANALYZER_VERSION = "YOUR_PINNED_PROVIDER_VERSION"
FRAMEKIT_SPEECH_ANALYZER_MODEL_ID = "YOUR_PINNED_MODEL_REVISION"
FRAMEKIT_AUDIO_ANALYZER = "/absolute/path/to/runtime/ffmpeg-audio-backend.py"
FRAMEKIT_AUDIO_ANALYZER_VERSION = "YOUR_FFMPEG_AND_BACKEND_VERSION"
FRAMEKIT_SILERO_VAD_MODEL = "/absolute/path/to/silero_vad.jit"
FRAMEKIT_SILERO_VAD_SHA256 = "YOUR_MODEL_SHA256"
FRAMEKIT_SPEECH_REQUIRE_VAD = "1"
HF_HUB_OFFLINE = "1"
FRAMEKIT_SPEECH_ENV_ALLOWLIST = "PATH,HOME,FRAMEKIT_SPEECH_BACKEND,FRAMEKIT_WHISPER_BACKEND,FRAMEKIT_WHISPER_MODEL,FRAMEKIT_SPEECH_ANALYZER_VERSION,FRAMEKIT_SPEECH_ANALYZER_MODEL_ID,FRAMEKIT_SILERO_VAD_MODEL,FRAMEKIT_SILERO_VAD_SHA256,FRAMEKIT_SPEECH_REQUIRE_VAD,HF_HUB_OFFLINE"

Here runtime is the installed package's client/node_modules/@morshoto/framekit/dist-package/apps/mcp-server/runtime directory. Confirm that the client launches this exact installed path and that the embedded version and commit match the candidate; a tarball filename alone is not runtime identity. Prepare and verify the local model and dependencies using the repository's speech analyzer guide. The observed run used mlx-whisper 0.4.3, model revision a4aaeec0636e6fef84abdcbe3544cb2bf7e9f6fb, and Silero VAD 6.2.1. Other configurations can yield different plans. Restart the client after adding the entry. Do not proceed with a guessed transcript when the provider is unavailable. The audio backend requires Python 3.9 or newer, FFmpeg and ffprobe on PATH; pin its version and the FFmpeg version in FRAMEKIT_AUDIO_ANALYZER_VERSION. Source audio analysis measures the source file, not music audibility or mix safety in the rendered video. If analysis is unavailable, report it rather than inventing evidence.

In a client connected to that server, an example request is:

text
Create a disposable headless interview short from interview.mp4 and music.wav.
First show a 30–60 second, 16:9 brief that retains the eclipse question and
answer and preserves speech. Wait for my approval. Register and inspect the
sources, analyze the actual speech, and show a revision-bound plan including
uncertainties before any edit. Use basic captions and propose music from 0 to
46 seconds at -24 dB; do not infer that the mix is audible or safe. Preview
each edit and wait for my approval before applying it.

Render a new MP4 and export a create-only versioned FCPXML to new paths. Inspect
representative actual frames across the captions, including places with faces
or existing text. Group timestamped samples into contact sheets and inspect
ambiguous cases at full size; do not infer unseen frames from thumbnails. If a
caption obscures important content, propose and review an adjustment, render
again, and inspect the affected frames. Show me the final video for subtitle,
ending and audio review. Record the source and output
hashes, revisions, approvals, provider/model identity and independent ffprobe
results. Report missing or uncertain evidence as unavailable. Do not open or
modify Final Cut Pro.

In one observed candidate run, a user approved the brief and reviewed the 52.4-second proposal. The installed server produced a video with 1,572 decoded frames at 30 fps and a versioned FCPXML; independent XML inspection matched 29 caption texts and timings to the timeline. The user accepted the subtitle appearance and ending. Speech detection marked the ending as continuous speech, so the human review is not an automatically verified safe cut. The added music ended at 46 seconds. These observations are not a guarantee for another run, and this prompt itself has not yet been independently exercised as a fresh-client end-to-end tutorial.

To check your own output, substitute its path below:

Terminal
ffprobe -v error -count_frames -show_entries stream=codec_type,nb_read_frames,avg_frame_rate,duration -of json output.mp4
shasum -a 256 output.mp4 output.fcpxml

Compare the reported duration and frame count to the approved timeline and review the actual output. Metadata and a matching XML structure do not prove that the video is perceptually correct. FCPXML is an interchange artifact, not proof of import, playback, editability or Undo in Final Cut Pro.

If something fails #

Check the first failing message and installed versions. If the client reports “Framekit server not found”, run the pinned install command above from the example directory and try the setup again. Missing FFmpeg, an encoder, or a renderer capability can prevent rendering. Use Troubleshooting for symptom-based checks and the Error Reference for coded errors. The MP4 is a headless output; FCPXML is a separate handoff artifact, and neither proves import, playback, or an edit in Final Cut Pro.