OpenToonz MCP
v1.2.0Animate in OpenToonz from an AI assistant: native vector levels, xsheet timing, rigs and physics.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
opentoonz_info
Install paths, version, scenes, and whether the OpenToonz GUI is running.
scene_context
CALL FIRST. Full current state of a scene from disk: settings, layers, timing, keyframes, outside (GUI) changes detected, notes/memory, recent journal, warnings.
| Parameter | Type | Description |
|---|---|---|
scene * | string |
add_note
Save a memory note for this scene (story, character design, decisions, todo). Shown in scene_context.
| Parameter | Type | Description |
|---|---|---|
note * | string | |
scene * | string |
get_journal
Operation history of a scene (every MCP action, outside edits detected, errors).
| Parameter | Type | Description |
|---|---|---|
scene * | string | |
last | integer |
style_guide
Studio animation rules (Ghibli/Disney/anime practice) with numbers: timing, spacing, squash, line weight, shading, camera. topic: 'rules' (numbered defaults) | 'full' | 'styles'.
| Parameter | Type | Description |
|---|---|---|
topic | string |
undo
Restore the scene (and any overwritten vector levels) to the state before the last N MCP writes.
| Parameter | Type | Description |
|---|---|---|
scene * | string | |
steps | integer |
create_scene
Create a scene in the OpenToonz sandbox project. style: anime | feature | cartoon | sketch | clean (line weight, wobble, taper, default timing).
| Parameter | Type | Description |
|---|---|---|
name * | string | |
bg_color | string | |
fps | number | |
frames | integer | |
height | integer | |
overwrite | boolean | |
style | string | |
width | integer |
import_scene
Bring an existing OpenToonz .tnz (made in the GUI) under MCP control. Copies it into the sandbox scenes folder if it is elsewhere. Its columns appear as 'foreign_columns' you can key/retime. A scene the MCP already manages is refused unless overwrite=true (its MCP layer data is reset).
| Parameter | Type | Description |
|---|---|---|
path * | string | |
name | ||
overwrite | boolean |
set_scene_settings
Change scene length (frames), fps, background colour, or default drawing style.
| Parameter | Type | Description |
|---|---|---|
scene * | string | |
bg_color | ||
fps | ||
frames | ||
style |
add_layer
Add a column with its own drawing level. Later layers are drawn ON TOP. mode: 'vector' (shapes -> native OpenToonz vector .pli, editable in GUI, pressure lines) | 'ink' (a vector .pli you and the user both draw on, stroke by stroke: stroke / read_drawing / erase_stroke) | 'raster' (PNG). style: override scene style for this layer (e.g. 'clean' for BG, 'sketch' for effects). parent: 'Table', a peg or another layer. boil: hand-drawn line boil on held drawings.
| Parameter | Type | Description |
|---|---|---|
layer * | string | |
scene * | string | |
boil | boolean | |
mode | string | |
parent | string | |
style |
add_peg
Add a pegbar (invisible transform node). Parent layers to it to move groups (character rigs, BG sets).
| Parameter | Type | Description |
|---|---|---|
peg * | string | |
scene * | string | |
parent | string |
set_parent
Re-parent a layer or peg to 'Table', a peg, or another layer.
| Parameter | Type | Description |
|---|---|---|
parent * | string | |
scene * | string | |
target * | string |
set_layer
Layer properties: visible, opacity (0-1, renders), boil, style (needs redraw), timing 'auto'|'manual'.
| Parameter | Type | Description |
|---|---|---|
layer * | string | |
scene * | string | |
boil | ||
opacity | ||
style | ||
timing | ||
visible |
delete_layer
Delete a layer (column, level, drawings). Undo-able.
| Parameter | Type | Description |
|---|---|---|
layer * | string | |
scene * | string |
draw
Draw drawing #frame on a layer (held until the next drawing when timing is auto). Shapes (canvas px, origin top-left), painted in order: circle{x,y,r} ellipse{x,y,rx,ry,rotation} rect{x,y,w,h,radius,rotation} (x,y=top-left) polygon{points,smooth} path{points,smooth=true,closed} text{x,y,text,size,anchor='mm'} svgpath{d:'M.. C.. A.. Z', transform?} - any SVG path data (detailed art: hair, hands, folds) brush{points:[[x,y,pressure 0-1],...], width:px max, color} - inked stroke with per-point pressure Paint/ink: fill, stroke, stroke_width (px; default from style),…
| Parameter | Type | Description |
|---|---|---|
frame * | integer | |
layer * | string | |
scene * | string | |
shapes * | array | |
force | boolean |
draw_many
Batch draw: drawings=[{"frame": n, "shapes": [...]}, ...]. Use for frame-by-frame animation.
| Parameter | Type | Description |
|---|---|---|
drawings * | array | |
layer * | string | |
scene * | string | |
force | boolean |
opentoonz_live
The live link to a running OpenToonz (needs the otbridge plugin, see bridge/README.md). action: 'status' (is OpenToonz connected, which scene is open, is it unsaved, which cell is the cursor on) | 'save' (File > Save All, so preview_frame / render / the files show what is on screen) | 'undo' | 'redo' (Edit > Undo / Redo in OpenToonz). When the scene you work on is open there, stroke, read_drawing and erase_stroke go through this link by themselves: strokes appear at once in the user's viewer.
| Parameter | Type | Description |
|---|---|---|
action | string |
stroke
Draw by hand on an ink layer: each stroke is one pen line, written straight into the OpenToonz vector level on top of what is already there (yours or the user's). Nothing is regenerated or overwritten. strokes: [{"points": [[x, y] or [x, y, pressure 0-1], ...], "width": px at full pressure (default: the style's line), "color": '#rrggbb', "closed": false, "smooth": true}]. Points are canvas px (origin top-left); the line passes through every point (smooth=false joins them with straight segments). Without pressure values the ends are tapered like a pen lift (taper 0 = none,…
| Parameter | Type | Description |
|---|---|---|
frame * | integer | |
layer * | string | |
scene * | string | |
strokes * | array | |
taper | number |
read_drawing
Look at a vector drawing as strokes, the user's included: what is on the level file right now. Works on ink and vector layers. Each stroke: index (drawing order, later = on top), by ('mcp' = drawn with stroke, 'other' = the user in OpenToonz or shapes), color, width px, closed, bbox [x0, y0, x1, y1] and points [[x, y, pressure], ...] along the line (canvas px, thinned to max_points). Use it before adding to someone's drawing, then preview_frame to see the result. only_new=true returns just the strokes that appeared since your last read_drawing or stroke on this drawing…
| Parameter | Type | Description |
|---|---|---|
frame * | integer | |
layer * | string | |
scene * | string | |
max_points | integer | |
only_new | boolean |
erase_stroke
Remove strokes from a drawing on an ink layer by index (from read_drawing). Indices are those BEFORE the call; the remaining strokes are renumbered. A stroke that borders a painted area is refused.
| Parameter | Type | Description |
|---|---|---|
frame * | integer | |
indices * | array | |
layer * | string | |
scene * | string |
paint
Paint closed areas of a drawing on an ink layer, like clicking with the fill tool: every area that contains one of the points (canvas px) gets the colour. The outline around a point must be closed. Live only: it is done by OpenToonz itself, so the scene must be open there with the otbridge plugin (opentoonz_live shows the link). 'missed' lists points that were not inside a closed area: close the gap with stroke, or move the point. One undo step in OpenToonz.
| Parameter | Type | Description |
|---|---|---|
frame * | integer | |
layer * | string | |
points * | array | |
scene * | string | |
color | string |
live_view
See the OpenToonz viewer exactly as the user sees it right now: their zoom and pan, onion skin, unsaved strokes, everything. It takes a fraction of a second and saves nothing, so use it after every few live strokes to check your work. (preview_frame renders the saved files through the camera instead.) Needs OpenToonz running with the otbridge plugin.
| Parameter | Type | Description |
|---|---|---|
max_width | integer |
ink_layer
Turn a vector layer into an ink layer, so you and the user can both keep drawing on it. Its level file becomes the only truth: the shapes it was built from are dropped, it is never recompiled, and edits made in OpenToonz no longer lock it. After this use stroke / read_drawing / erase_stroke; draw no longer applies.
| Parameter | Type | Description |
|---|---|---|
layer * | string | |
scene * | string |
inbetween
Generate in-betweens (douga) between two key drawings (genga). start/end_shapes default to the drawings already on start_frame/end_frame. easing: slow_in_out (studio chart) | snappy | linear | in | out | bounce | elastic | back. step: 1 ones, 2 twos, 3 threes (default: style timing, anime=3, feature=2). arc: bow of the travel path (0.15 = natural arc). squash: 0-1 stretch round shapes along motion. Studio rule: only auto-inbetween 'tight' moves (rotation<=30deg, scale change<=25%); add a breakdown key otherwise.
| Parameter | Type | Description |
|---|---|---|
end_frame * | integer | |
layer * | string | |
scene * | string | |
start_frame * | integer | |
arc | number | |
easing | string | |
end_shapes | ||
force | boolean | |
squash | number | |
start_shapes | ||
step |
set_exposure
Xsheet timing for a layer (sets timing=manual). cells[i] = drawing at frame i+1 (0 = blank), or run-length text '1x6 2x6 3x4 0x2' (drawing x frames). Cycle example on twos: '1x2 2x2 3x2 4x2 1x2 ...'.
| Parameter | Type | Description |
|---|---|---|
cells * | ||
layer * | string | |
scene * | string |
set_keyframe
Keyframe a layer, peg, or 'camera' (real OpenToonz keys, editable in GUI Function Editor). x/y: px offset from rest (+y down). rotation: deg CCW. scale*: 1.0=100%. z: depth. interp (segment starting at this key): ease | linear | constant | speed | exp. Camera: scale<1 zooms IN; use exp interp for trucks (natural zoom).
| Parameter | Type | Description |
|---|---|---|
frame * | integer | |
scene * | string | |
target * | string | |
interp | string | |
rotation | ||
scale | ||
scale_x | ||
scale_y | ||
x | ||
y | ||
z |
set_pivot
Set the rotation/scale pivot of a layer or peg without moving it (OpenToonz 'center'). x,y: canvas px. x='auto': from the layer's drawing bounds; anchor 'bottom' (feet - use for squash on the ground) | 'center' | 'top'. Do this BEFORE squash/stretch or rotation keys.
| Parameter | Type | Description |
|---|---|---|
scene * | string | |
target * | string | |
anchor | string | |
x | ||
y |
clear_keyframes
Remove keys from a target (optionally one param: x,y,rotation,scale,scale_x,scale_y,z; optional frame range).
| Parameter | Type | Description |
|---|---|---|
scene * | string | |
target * | string | |
end | ||
param | ||
start |
animate_action
Move a layer/peg/camera with animation principles baked in (Illusion of Life numbers): anticipation (opposite move, 15% amplitude, 25% of duration, min 3f), main move with slow-in/out, overshoot (10% past target) and damped settle (x0.45 swing) over settle_frames AFTER 'end'. to/from_: {x,y,rotation,scale,scale_x,scale_y} (px/deg/factor). from_ defaults to current value at start.
| Parameter | Type | Description |
|---|---|---|
end * | integer | |
scene * | string | |
start * | integer | |
target * | string | |
to * | object | |
anticipation | number | |
easing | string | |
from_ | ||
overshoot | number | |
settle_frames | integer |
camera_move
Camera work (satsuei): kind='pan': move view by dx,dy px from start..end (eased 8f). parallax={layer: ratio} makes layers move at ratio of camera speed (sky 0.05, far BG 0.3, mid 0.6, char 1.0, FG 1.8). kind='truck': zoom to 'zoom' scale (0.75 = push in 25%) with exponential interpolation. kind='shake': impact shake starting at 'start', strength px (8 default), decays x0.7/frame on ones.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
scene * | string | |
start * | integer | |
dx | number | |
dy | number | |
end | ||
parallax | ||
strength | number | |
zoom |
import_image
Bring a picture (sketch, scanned drawing, painting, photo, AI image) into a layer. Raster layer (mode 'raster'): the image is placed as-is. Traced layer (add_layer mode='traced'): OpenToonz's own vectorizer turns it into editable vector strokes and fills on compile. trace: set the traced layer's method once: 'outline' (colour regions) | 'centerline' (ink lines). box [x,y,w,h] px (default whole canvas); fit contain | cover | stretch | none.
| Parameter | Type | Description |
|---|---|---|
layer * | string | |
path * | string | |
scene * | string | |
accuracy | integer | |
box | ||
despeckling | integer | |
fit | string | |
frame | integer | |
max_colors | integer | |
threshold | integer | |
trace |
import_svg
Import an SVG file (Inkscape/Illustrator/free assets) as editable vector shapes on a drawing. Every path becomes an 'svgpath' shape you can tween, recolour or humanize (human=true adds the hand-drawn wobble/pressure of the layer style). box [x,y,w,h] fits the art (default whole canvas).
| Parameter | Type | Description |
|---|---|---|
layer * | string | |
path * | string | |
scene * | string | |
box | ||
force | boolean | |
frame | integer | |
human | boolean |
save_part
Save a reusable part to the global model-sheet library (head, eye, hand, mouth chart, prop). shapes use the part's own coordinates; anchor [x,y] is its attachment/pivot point. variants: alternative drawings by name, e.g. {"closed": [...], "A": [...], "O": [...]}. Use in any drawing as {"type":"part","name":..,"variant":..,"x","y","scale","rotation","flip"}.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
shapes * | array | |
anchor | ||
notes | string | |
variants |
list_parts
Parts in the model-sheet library with their variants.
physics_bounce
Physically exact bouncing (gravity parabolas, coefficient of restitution) on a layer/peg. The drawing must rest on the ground line; y offsets go UP from there. height px. fall_frames: frames for the first drop (default: real gravity for a 1.7 m character = 1080 px tall, i.e. 14.1*sqrt(height/1080)). material: rubber_ball | table_tennis | basketball | tennis | soft_rubber | bowling | balloon (sets restitution and squash). travel_x: px moved over the whole bounce, slowing with each contact. squash: area-preserving contact squash (set_pivot at the feet first).
| Parameter | Type | Description |
|---|---|---|
height * | number | |
scene * | string | |
start * | integer | |
target * | string | |
bounces | integer | |
fall_frames | ||
material | string | |
squash | boolean | |
start_on_ground | boolean | |
travel_x | number |
physics_jump
Recipe jump on a layer/peg: anticipation crouch -> takeoff stretch -> exact parabola -> landing squash -> recovery. style: realistic | feature | cartoon (crouch depth, stretch and squash amounts). air_frames default: real gravity for the scene height (1.7 m character = frame height).
| Parameter | Type | Description |
|---|---|---|
height * | number | |
scene * | string | |
start * | integer | |
target * | string | |
air_frames | ||
style | string |
follow_through
Overlapping action / follow-through from a damped spring (second-order system). The target reacts to the driver's motion (driver's `param`, exact OpenToonz values). mode 'follow': target_param = spring(driver) (a separate object trailing the driver). mode 'offset': target_param = gain * (spring(driver) - driver) (a part PARENTED to the driver: hair, ears, tail, cloth; use target_param='rotation' with gain in deg per px for a swing). frequency Hz (hair 2-2.5, ears 3, belly 4-5, cape 1.2), damping 0.25-0.5 (overshoot 15-45%), response < 0 anticipates. Keep frequency <…
| Parameter | Type | Description |
|---|---|---|
driver * | string | |
end * | integer | |
scene * | string | |
start * | integer | |
target * | string | |
damping | number | |
frequency | number | |
gain | number | |
mode | string | |
param | string | |
response | number | |
target_param |
camera_follow
Follow a layer/peg with the camera using critically damped smoothing (game-camera SmoothDamp). smooth_time in frames (7 = 0.3 s); axis x | y | xy; offset px added to the followed position.
| Parameter | Type | Description |
|---|---|---|
end * | integer | |
scene * | string | |
start * | integer | |
target * | string | |
axis | string | |
offset | number | |
smooth_time | number |
blink
Insert a blink into a layer's xsheet at `start` (switches the layer to manual timing). pattern: standard (H C C H) | quick | anime_twos | physiological | sleepy | double. Drawings: the eye open/half/closed drawing numbers on that layer.
| Parameter | Type | Description |
|---|---|---|
closed_drawing * | integer | |
layer * | string | |
open_drawing * | integer | |
scene * | string | |
start * | integer | |
half_drawing | ||
pattern | string |
lip_sync
Animate a mouth from text (no audio): each mouth shape is a VARIANT of a library part (anime3: closed/half/open; blair: AI E O U WQ MBP FV L etc rest). Draws one drawing per shape on the layer and writes the xsheet from `start` (2-frame minimum holds). Shift `start` 2 frames earlier than the audio (mouths lead sound).
| Parameter | Type | Description |
|---|---|---|
layer * | string | |
part * | string | |
scene * | string | |
start * | integer | |
text * | string | |
x * | number | |
y * | number | |
chart | string | |
frames_per_syllable | integer | |
scale | number |
anatomy_reference
Body proportions for drawing a person, from anthropometric data (Drillis-Contini segment lengths, de Leva masses, CDC/NHANES stature, growth-standard head ratios). person: baby | toddler | boy | girl | child | teen | teen_boy | teen_girl | young_man | young_woman | man | woman | old_man | old_woman (or give age years / label and sex). Returns heights from the floor, segment lengths, front widths, side depths (px), heads tall, mass fractions, centre of mass, notes. Scale: height_px, or px_per_m (340 = 1.75 m adult about 600 px; keep one px_per_m per scene). region (list_…
| Parameter | Type | Description |
|---|---|---|
age | ||
bmi | ||
height_px | ||
person | ||
px_per_m | number | |
region | ||
sex |
list_regions
Regions with surveyed body averages for anatomy_reference / build_character (region=...).
build_character
Build a side-view cut-out character rig with real proportions for the age and sex. Creates a root peg '<name>' at the hips and 16 vector layers '<name>_<part>' (torso, head, upper arm, forearm, hand, thigh, shin, foot, toe; far side darker and behind), parented like a skeleton with each pivot on its joint. Animate it with walk_cycle / run_cycle, or key the parts directly (rotation on a part turns it about its joint). x: hip x px (default centre); ground_y: floor line px (default 90% of the frame). hair: short | long | bob | ponytail | bun | afro | none. colors: {skin, h…
| Parameter | Type | Description |
|---|---|---|
name * | string | |
scene * | string | |
age | ||
appeal | number | |
bmi | ||
colors | ||
design | string | |
face | ||
facing | string | |
ground_y | ||
hair | string | |
hat | string | |
outfit | string | |
person | ||
px_per_m | number | |
region | ||
sex | ||
skin_tone | ||
style | ||
x |
walk_cycle
Walk a build_character rig with biomechanically correct timing for its age and sex. Feet stay planted and roll heel -> flat -> ball -> toe; legs use two-bone IK; the hips ride an inverted-pendulum arc (low at contact, high at passing); arms swing opposite the legs. Defaults come from gait studies (e.g. adult man 108 steps/min at 1.4 m/s; toddler 154 at 0.86; old age shorter steps). speed m/s, cadence steps/min override them. cycles (default 2) or end. travel=false walks in place (pan the BG). on=2 holds every pose 2 frames (keys become constant). bounce, arm_swing scale…
| Parameter | Type | Description |
|---|---|---|
character * | string | |
scene * | string | |
arm_swing | number | |
bounce | number | |
cadence | ||
cycles | ||
end | ||
lean | number | |
mood | string | |
on | integer | |
phase | number | |
speed | ||
start | integer | |
travel | boolean |
run_cycle
Run a build_character rig: spring-mass physics (exact gravity in the flight phase, a spring arc in contact, lowest at mid-stance), planted feet, high knee recovery, bent arms. Defaults by age and sex from jogging norms (adult man about 166 steps/min at 3.3 m/s). Same options as walk_cycle; bounce=1 keeps gravity exact.
| Parameter | Type | Description |
|---|---|---|
character * | string | |
scene * | string | |
arm_swing | number | |
bounce | number | |
cadence | ||
cycles | ||
end | ||
lean | number | |
on | integer | |
phase | number | |
speed | ||
start | integer | |
travel | boolean |
compile_vectors
Convert pending vector drawings to native OpenToonz .pli levels with pen-pressure lines. Runs automatically before preview/render/open. force=true also overwrites GUI-edited levels.
| Parameter | Type | Description |
|---|---|---|
scene * | string | |
force | boolean |
preview_frame
Render one frame through OpenToonz and return the image (check your work visually).
| Parameter | Type | Description |
|---|---|---|
scene * | string | |
frame | integer | |
max_width | integer |
contact_sheet
Render several frames into one labelled grid (default 6 spread over the scene) to review motion.
| Parameter | Type | Description |
|---|---|---|
scene * | string | |
frames | ||
thumb_width | integer |
render
Render with OpenToonz (tcomposer), then double-check: frame count, blank frames, flashing. format: mp4 | gif | png (sequence). shrink 2 = half size (faster drafts).
| Parameter | Type | Description |
|---|---|---|
scene * | string | |
end | ||
format | string | |
shrink | integer | |
start |
open_in_opentoonz
Open the scene in the OpenToonz GUI for hand editing (vector levels compiled first). After editing: SAVE in OpenToonz, then the MCP picks up your changes automatically.
| Parameter | Type | Description |
|---|---|---|
scene * | string |
validate_scene
Double-check a scene: structure, missing files, layer/column mapping, timing gaps, studio rule warnings (holds, pan speed), and optionally a 1-frame test render.
| Parameter | Type | Description |
|---|---|---|
scene * | string | |
render_test | boolean |
learn_lesson
Record an insight from reviewing your own output (e.g. 'squash 0.8 looks rubbery; 0.4 reads better for a heavy ball'). Lessons are shown in every later scene_context so future work improves.
| Parameter | Type | Description |
|---|---|---|
lesson * | string | |
scene | ||
tags |
feedback
Store the USER's rating (1-5) and comment about a result. Ranked highest in lessons/preferences. Ask the user for this after showing a render.
| Parameter | Type | Description |
|---|---|---|
rating * | integer | |
scene * | string | |
comment | string |
tune_style
Permanently adjust a style preset's defaults (learned from feedback). Keys: line, interior, wobble, wavelength, taper_start, taper_end, min_ratio, pressure_var, loop_var, exposure, squash [lo,hi], shadow, overshoot_ends. Applies to all future drawings using that style.
| Parameter | Type | Description |
|---|---|---|
changes * | object | |
reason * | string | |
style * | string |
knowledge
Search accumulated lessons (errors seen, quality issues, insights, user preferences) with advice.
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
query |
list_scenes
Scenes known to the MCP.
list_looks
Studio looks apply_look can build from real OpenToonz fx, with what each does.
apply_look
Give the scene a studio look made of real OpenToonz fx nodes (open the FX Schematic to tweak them). look: ghibli | klaus | spider_verse | comic | anime_satsuei | painterly | cartoon_saloon (list_looks). Whole-frame fx go just before the output; per-layer fx (e.g. Klaus form shadow and rim light) go on `layers` (default: every layer except ones named like bg/background/sky). strength scales the amounts (0.5 subtle, 1 default, 1.5 strong). light_angle: degrees, 90 = light from above, 135 = top-left. Re-applying replaces the previous look; fx you made by hand are kept.
| Parameter | Type | Description |
|---|---|---|
look * | string | |
scene * | string | |
layers | ||
light_angle | number | |
strength | number |
remove_look
Remove the fx apply_look added (fx you made in OpenToonz stay).
| Parameter | Type | Description |
|---|---|---|
scene * | string |