MCP: Keyframes (#196) #210

Merged
crowmaki merged 2 commits from issue-196-mcp-keyframes into main 2026-10-14 03:43:10 +00:00
Owner

Closes #196. Part of #157.

A harness can now pin a Shot's look with Keyframes through the MCP server. Each tool wraps the existing ApiImpl keyframe command, so edits land in the undo log with their usual labels.

Tools

  • read_shot_keyframes: a Shot's Keyframes in time order, with anchor, origin, provenance (prompt and seed, Edit, or Take frame) and offRatio, plus the jobs still making a Keyframe or failed at it.
  • generate_keyframe: queues a Keyframe at an anchor from a prompt. Returns the jobId and read_shot_keyframes.
  • edit_keyframe: queues an Edit from an instruction, ordered references and an optional seed.
  • import_keyframe: imports an image file, such as a Blender still. Undo label "Add keyframe".
  • keyframe_from_take: the first or last frame of a ready Rendition becomes another Shot's Keyframe. Undo label "Use take frame as keyframe".
  • remove_keyframe: removes the Keyframe at a Shot's anchor. Undo label "Remove keyframe".
  • view_image accepts {kind: "keyframe", id}.

Anchors use the shape read_shot_keyframes shows: {kind: "start"}, {kind: "end"} or {kind: "at", ms}. An unknown kind, at without ms, or start/end with ms is refused with the valid anchors listed.

Tests

src-tauri/tests/mcp_keyframes.rs covers each acceptance criterion:

  • generate → wait_for_jobs → view_image, then Edit
  • the provenance of imported and Take-frame Keyframes, using a real rendered Take
  • an unknown anchor lists the valid values
  • remove → undo

The png and shown_image helpers moved into tests/common/mcp.rs, so the references and keyframes tests share them.

Closes #196. Part of #157. A harness can now pin a Shot's look with Keyframes through the MCP server. Each tool wraps the existing `ApiImpl` keyframe command, so edits land in the undo log with their usual labels. ## Tools - `read_shot_keyframes`: a Shot's Keyframes in time order, with anchor, origin, provenance (prompt and seed, Edit, or Take frame) and `offRatio`, plus the jobs still making a Keyframe or failed at it. - `generate_keyframe`: queues a Keyframe at an anchor from a prompt. Returns the `jobId` and `read_shot_keyframes`. - `edit_keyframe`: queues an Edit from an instruction, ordered references and an optional seed. - `import_keyframe`: imports an image file, such as a Blender still. Undo label "Add keyframe". - `keyframe_from_take`: the first or last frame of a ready Rendition becomes another Shot's Keyframe. Undo label "Use take frame as keyframe". - `remove_keyframe`: removes the Keyframe at a Shot's anchor. Undo label "Remove keyframe". - `view_image` accepts `{kind: "keyframe", id}`. Anchors use the shape `read_shot_keyframes` shows: `{kind: "start"}`, `{kind: "end"}` or `{kind: "at", ms}`. An unknown kind, `at` without `ms`, or `start`/`end` with `ms` is refused with the valid anchors listed. ## Tests `src-tauri/tests/mcp_keyframes.rs` covers each acceptance criterion: - generate → `wait_for_jobs` → `view_image`, then Edit - the provenance of imported and Take-frame Keyframes, using a real rendered Take - an unknown anchor lists the valid values - remove → undo The `png` and `shown_image` helpers moved into `tests/common/mcp.rs`, so the references and keyframes tests share them.
Read a Shot's Keyframes and their jobs; generate, Edit, import and take
from a Take frame a Keyframe at an anchor; remove one; view_image takes
Keyframes. An unknown anchor lists the valid ones.
Convert the anchor up front in each keyframe tool, read created Keyframes
with read_created, show the anchor as JSON when none is there, and share
the png and shown_image test helpers through common::mcp.
crowmaki deleted branch issue-196-mcp-keyframes 2026-10-14 03:43:10 +00:00
Sign in to join this conversation.
No description provided.