agent-link
v0.1.2Connect your own AI agent (Claude Code, Codex, Cursor…) to KinoViz Studio over MCP — the agent builds animations live in your browser tab.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
kinoviz_status
Check the connection to the KinoViz Studio browser tab: connected / paired / brief loaded, the open project (element count, duration, aspect ratio, editor mode) and what to do next. Call this first; it waits a few seconds for the tab to connect.
kinoviz_pair
Pair with the Studio tab using the 6-digit code the user sees in KinoViz Studio → "Connect agent". Required before any other tool (local dev tabs opened with ?agentLink=1 need no code).
| Parameter | Type | Description |
|---|---|---|
code * | string | The 6-digit pairing code shown in Studio, e.g. "482913" |
kinoviz_get_brief
Load the user's Agent brief for the open project: style family, aspect ratio, duration, palette, fonts, copy, assets already on the canvas (with elementIds), plus the matching style chapter and recommended self-check times. Required before canvas tools. If there is no brief, it tells you how to proceed.
kinoviz_start_freeform
Proceed WITHOUT a brief. Only when the user explicitly declines to fill in the Agent brief; results without one are usually generic. Unlocks canvas tools.
| Parameter | Type | Description |
|---|---|---|
ack * | boolean | Must be true: the user accepted working without a brief |
kinoviz_get_guide
The KinoViz design guide: coordinate system, element / keyframe schema rules, aesthetic rules, palettes, easings, tool rules and style-family chapters. READ ALL PAGES once before building — the canvas tools assume you follow it. Pages are stable for the whole session.
| Parameter | Type | Description |
|---|---|---|
mode | string | create (default) = building on an empty canvas; edit = changing an existing animation (adds the current canvas as an extra last page) |
part | number | Page number, 1-based. The response says how many pages there are. |
kinoviz_list_projects
List the signed-in user's recent KinoViz projects (id, name, updatedAt).
| Parameter | Type | Description |
|---|---|---|
limit | number | Max projects (default 30) |
kinoviz_create_project
Create a new empty project and open it in the Studio tab (the user sees it live). Prefer the project the user prepared with a brief.
| Parameter | Type | Description |
|---|---|---|
aspectRatio | string | Canvas aspect ratio (default 1:1). Set it here BEFORE building — element x/y are % of the canvas. |
name | string | Project name |
kinoviz_set_canvas_ratio
Change the canvas aspect ratio of the open project (match the brief before building; changing later re-fits the canvas).
| Parameter | Type | Description |
|---|---|---|
ratio * | string |
kinoviz_open_project
Open an existing project in the Studio tab.
| Parameter | Type | Description |
|---|---|---|
projectId * | string |
kinoviz_get_snapshot
Current project state as JSON (element ids, layer names, types, positions, sizes, keyframe counts, duration, canvas size). Canvas tool results do not include the canvas — call this before targeted edits.
kinoviz_import_image
Import an image file from this machine into the open project as a new image element (KinoViz's own import pipeline: compressed, sized to the image aspect ratio, uploaded as a project asset). Use it for images you produced with your own tools, e.g. a transparent PNG cut-out. Returns elementId; then position / animate it with modifyElement.
| Parameter | Type | Description |
|---|---|---|
path * | string | ABSOLUTE path to a local .png, .jpg, .jpeg, .webp, .gif or .svg (max 10 MB). Animated GIFs import as a still. |
layerName | string | Layer name shown in the layer panel (recommended) |
width | number | Width in the same virtual units as addElement width (360-unit base). Height follows the image aspect ratio. Default: longer side = 120. |
x | number | Center x as % of canvas width (0-100, default 50) |
y | number | Center y as % of canvas height (0-100, default 50) |
kinoviz_render_frames
Render the animation at given times through the real export pipeline and return the frames as images, so you can SEE the result (layout, colors, legibility, motion at key moments). Use after every significant change; fix what looks wrong and re-render. Preview quality: max 12 frames, max 800 px.
| Parameter | Type | Description |
|---|---|---|
maxWidth | number | Longest side in px (200-800, default 800) |
source | string | export (default) = final export pipeline; editor = raw editor canvas layer (debugging only) |
times | array | Times in seconds (max 12). Default: start / middle / end. Use the check times from kinoviz_get_brief. |
kinoviz_finish
Final quality gate: renders the check frames and returns a checklist against the brief (duration, aspect ratio, unnamed layers, lint) plus a report template for the user. Fix every ✗ and call again; then preview, save and report.
kinoviz_preview
Control playback in the Studio tab so the user can watch: play (from the start by default), pause, or seek.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
fromStart | boolean | For play: restart from 0 (default true) |
time | number | Seconds, for seek |
kinoviz_save
Save the project now (canvas tools already auto-save; call once at the end to be sure).
getKinoSkill
Lazy-load design knowledge / cookbook / templates. Call BEFORE using uncommon features to keep system prompt small. Available topics (use as `sections` field, comma-separated for multiple): "roles" (design templates), "capabilities" (full property reference), "boolean-operations" (union/subtract/flatten recipes), "shape-properties" (gradient/dashed/shadow), "mask-and-clip" (setElementMask rules), "composition-replication" (1:1 reference 4-step protocol), "asset-discovery-guide" (when to call searchAssets for each library), "textfx-cookbook" (42 text animation preset selection guide), "glsl-coo…
| Parameter | Type | Description |
|---|---|---|
section | string | Legacy alias for sections. Comma-separated single string: "boolean-operations,shape-properties". |
sections | array | 1-4 topics to load. Preferred form: ["textfx-cookbook", "icon-style-guide"]. Phase 6.1 archetype + craft 组合需要 3-4 sections (e.g. ["dashboard-archetypes", "craft-anti-slop", "craft-typography",… |
addBackgroundKeyframe
Record a background keyframe at a specific time for animated backgrounds. Supports solid color, gradient, and the whole-canvas prism lens. Automatically enables bgAnimated. Use for scenarios like "background starts black, fades to red at 2s, transitions to blue gradient at 5s". Provide bgColor (solid) OR gradient (linear/radial), not both; canvasLens can go on its own or alongside either.
| Parameter | Type | Description |
|---|---|---|
time * | number | Time in seconds when this keyframe applies |
bgColor | string | Solid color hex like "#ff0000" (use for solid background keyframe) |
canvasLens | object | Whole-canvas prism lens at this time (Pro to export). amount 0→1 = lens eases in; centerX 0→100 = lens sweeps across. enabled switches discretely (no half-open frame). |
easing | string | Easing curve (default: smooth; note: gradient stops switch at t=0.5 midpoint since stops are discrete) |
gradient | object | Gradient background keyframe (use instead of bgColor for gradient) |
addElement
Add a NEW element to the canvas. For model3d: you MUST call searchAssets FIRST in a separate step, wait for results, then call addElement with the URL from results. Never guess model URLs. For AI-generated images: use generateImage instead (it auto-places). For modifying EXISTING elements: use modifyElement instead. For physics animations: add elements first (no motion keyframes), then call applyPhysics. Returns the new element ID.
alignElements
Align or distribute 2+ elements relative to their collective bounding box. Operations: left/right/top/bottom (edge alignment), center-h/center-v (centered alignment), distribute-h/distribute-v (equal spacing between elements). Use to enforce grid / row / column structure when replicating a reference image.
| Parameter | Type | Description |
|---|---|---|
elementIds * | array | IDs of 2+ elements to align. distribute-h/v needs at least 3 elements. |
operation * | string | left/right/top/bottom: align edges to collective bbox edge. center-h/center-v: align centers horizontally/vertically. distribute-h/distribute-v: keep first and last in place, distribute middle element… |
applyEmphasisPreset
Apply a repeating emphasis loop to keep important elements alive (pulse/breathe/wiggle/shake/glow-tilt). Use sparingly — only on 1-2 hero elements per composition (overuse = chaos).
| Parameter | Type | Description |
|---|---|---|
elementIds * | array | IDs of elements to emphasize. |
presetId * | string | Emphasis type: pulse (scale throb), breathe (slow scale+opacity sigh), wiggle (rotation tick-tock), shake (translate jitter), glow-tilt (slow scale+rotate). |
loops | integer | Number of loops to play (default 1). Use 2-3 for entrance emphasis, 10+ for continuous breathing. |
staggerMs | number | Override stagger between elements in milliseconds (default 100). |
startAt | number | Start time in seconds (default 0). |
applyEntrancePreset
Apply a high-level entrance animation to one or more elements. Auto-applies the full Disney 5 + four-act narrative (anticipation 15% / action 40% / reaction 15% / resolution 30% with mandatory 100-200ms breathing room) + per-property easing layering. STRONGLY PREFERRED over raw keyframes — produces 5-7 keyframes per element with mixed easings. IMPORTANT: list elements with **hero first** — hero leads, supporting elements start at 60% of hero duration + their own stagger. Total stagger budget enforced ≤500ms (LottieFiles standard) — over budget auto-switches to center-out wave. Safe ins…
| Parameter | Type | Description |
|---|---|---|
elementIds * | array | IDs of elements to animate. **First ID = hero** (leads entrance). Order of rest = stagger order. |
presetId * | string | Entrance personality: editorial-fade (calm, no overshoot, magazine), snappy-pop (UI, +8% overshoot), cinematic-rise (hero reveal, slow build), organic-drift (breathy, micro-rotation), mechanical-slot… |
centerOut | boolean | When true, sort by distance from center (wave-from-center) instead of linear order. Auto-enabled when stagger total > 500ms budget. |
heroLeadMs | number | Lead time hero gets before supporting elements start (default 150ms, LottieFiles 100-200 standard). |
staggerMs | number | Stagger between SUPPORTING elements in ms (default 100). LottieFiles: 50-150 sweet spot. micro=40, standard=100, dramatic=180, wave=80. |
startAt | number | Start time in seconds (default 0). Use to chain after other entrances. |
applyExitPreset
Apply a high-level exit animation to one or more elements. Use this so animations don't freeze at end — instead they fade/shrink/dissolve. Strongly preferred over raw keyframes for exits.
| Parameter | Type | Description |
|---|---|---|
elementIds * | array | IDs of elements to animate out. Order = stagger order. |
presetId * | string | Exit personality: editorial-fade-out (calm), snappy-shrink (quick), cinematic-pullback (hero), organic-dissolve (breathy). |
startAt * | number | Start time in seconds — typically 0.5-1s BEFORE total duration ends. |
staggerMs | number | Override stagger between elements in milliseconds (default 80). |
applyFullProject
Create a complete animation project with HETEROGENEOUS elements (different shapes/text/images mixed). **NOT for arrays/grids/fanouts** — if user wants N evenly-distributed copies of the SAME element (12 dots in a circle / 5 cards in a row / 4×4 pixel grid / scattered snowflakes), use **applyEffector** instead (1 call vs N hand-listed elements). **PHYSICS (CRITICAL):** When user mentions falling, bouncing, gravity, collision, drop, physics, realistic motion — you MUST include the "physics" field with body configs. Do NOT add motion keyframes for physics elements; the engine handles all mov…
duplicateElement
Duplicate an existing element, optionally including its keyframes/animation. New element is offset slightly so it does not overlap the source. Use to build arrays of repeating shapes (radial patterns, equal-spaced grids), or to copy a fully-animated element as a starting point.
| Parameter | Type | Description |
|---|---|---|
elementId * | string | ID of the element to duplicate. |
withAnimation | boolean | If true, copy keyframes/animation along with the element. Default false (clone visual properties only). |
groupElements
Group 2+ elements into a single logical group. The group becomes a unit for animation, transform, and selection. Use after addElement to bundle related primitives (e.g. an icon = body + accent + outline). Subsequent applyEntrancePreset / modifyElement on the group id animates/transforms the whole bundle together.
| Parameter | Type | Description |
|---|---|---|
elementIds * | array | IDs of 2+ elements to group together. Element relative positions are preserved. |
groupName | string | Layer-panel name for the new group (e.g. "Ghost mascot", "Top-row decorations"). Strongly recommended for editability. |
modifyElement
Modify properties or animation of an EXISTING element. Find element ID in canvas_state. Use for: change material, animate, resize, reposition, change GLSL preset. Do NOT use for: creating new content (use addElement), generating images (use generateImage), searching assets (use searchAssets).
removeElement
Delete a specific element from the canvas by its ID. Use when the user asks to remove or delete an element. Note: user-uploaded model3d and image elements are protected and cannot be deleted. Returns success or an error if the element is protected.
| Parameter | Type | Description |
|---|---|---|
elementId * | string | ID of the element to remove |
setElementMask
Apply one element as a clipping mask on another element. The mask element itself becomes invisible (only used as a clip shape), and the target element renders only where it overlaps with the mask. Use to clip images into custom shapes (circle / star / heart), or to reveal text through a shape window. For nested mask rules, call getKinoSkill({ topic: "mask-and-clip" }).
| Parameter | Type | Description |
|---|---|---|
maskElementId * | string | ID of the element used as the clipping shape (typically a shape / path). Becomes invisible after mask is applied. |
targetElementId * | string | ID of the element to be clipped (image / shape / text / etc.). Renders only where it overlaps with the mask. |
setProjectState
Change global project settings: animation duration, static background (solid/gradient), static camera position (pan/zoom/rotation), and camera motion preset (shake/drift/etc). Use for a single one-time configuration. For time-based animation of background or camera, use addBackgroundKeyframe / addCameraKeyframe instead. Do NOT use this for modifying individual elements.
| Parameter | Type | Description |
|---|---|---|
animationEnabled | boolean | Enable animation playback |
background | string | Solid background. Presets: "white","black","gray","checker". Or hex like "#1a1a2e". For gradient use backgroundGradient instead. |
backgroundGradient | object | Gradient background (overrides solid background if both provided) |
camera | object | Static camera position applied to entire canvas (around canvas center) |
cameraEnabled | boolean | Enable camera preset overlay |
cameraIntensity | number | Camera preset intensity 0-1 |
cameraMode | string | Camera motion preset (shake/drift overlay on top of camera keyframes) |
canvasLens | object | Whole-canvas prism lens (Pro to export): bends and colour-splits the ENTIRE finished frame — background, every element, after the camera. enabled + amount (0-1 blend, 0 = off), distortion (0-6 edge… |
duration | number | Total animation duration in seconds |