mcp

v0.39.1
@ikijs/mcp Checked 10 hours ago Published 6 days ago

MCP server that lets AI agents build 2D puppet characters: compose AI-drawn part images, or cut one finished illustration into layers, check their geometry and…

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

validate_iki

Validates a raw .iki model (object or JSON string); fail-fast — returns at most ONE error, so fix one, re-run.

ParameterTypeDescription
modelRaw .iki model JSON (object or JSON string)

describe_iki

Summarizes a valid model's canvas/params/parts/deformers and its expressions and motion clips (with the descriptions a host picks them by), and its `generator` (what wrote it: tool, rigger and plugin, each name@version) when it records one; returns an error for an invalid model. It is also the patch writer's view of a rigged model: each part's rest box in model px and in bust-render px, each part's warp stops, each warp2d's stops, and faceWidth, which is what an auto_rig_from_layers `patches` op is aimed with. Pass exactly one of model or modelPath; prefer modelPath for a written rig so a larg…

ParameterTypeDescription
modelRaw .iki model JSON (object or JSON string)
modelPathstringPath to a written .iki model (relative to the working directory, inside it)

list_standard_parameters

Lists the recommended standard parameter ids a host can drive without per-model wiring.

describe_rig_plan

Lists the fields of the `rigPlan` input of auto_rig_from_layers: each one's path, default, range, recommended span, step, unit, the poses it shows at, the report reading that shows it and the `turnTargets` cue that fits it when given. The one source of those numbers.

auto_rig_from_layers

Auto-rigs role-named PNG layers (face, eye_L/eye_R and either mouth or the lip set (mouth_inner + lip_lower + lip_upper, a mouth that folds open instead of crossfading) required; iris_L/R, brow_L/R, hair_front, body, arm_L/arm_R, forearm_pose_L/forearm_pose_R, hair_side_L/hair_side_R, mouth_tongue/mouth_teeth (only with the lip set: drawn under its lips and clipped to mouth_inner), etc. optional; an arm needs the body, a pose forearm needs its arm, a side lock needs hair_front, and a partial lip set, one mixed with mouth/mouth_open, or mouth_tongue/mouth_teeth without it is refused) into a ren…

compose_layers_from_parts

Composes AI-generated part PNGs into canvas-aligned, role-named PNG layers on disk, ready for auto_rig_from_layers (the eyewhite split, alpha-trim/white-key, and placement pipeline the character-generation skill needs), with the same geometry report measure_layers returns standalone included inline. face, eyewhite, iris, brow, hair_front are required, with mouth.png — or the lip set's mouth_keyed.png (the open mouth, its inside painted flat #00FF00) + mouth_interior.png (the cavity, teeth and tongue alone), which the composer keys and splits into mouth_inner / lip_lower / lip_upper on one fr…

ParameterTypeDescription
outDir *stringExisting directory to write the role layer PNGs + preview.png (and preview-pose.png when there is a forearm_pose.png) into (resolved against cwd; must already exist; confined to the working directory)…
partsDir *stringDirectory of the source part PNGs (resolved against cwd).
canvasHeightnumberThe canvas's height in px: an even integer in 1100..4096, default 1100 (a square bust canvas; at 1100 every output is byte-identical to leaving it out). The width stays 1100. The canvas grows downward…
layoutobjectPer-role override merged over the built-in defaults, keyed by role — hair_back, body, arm_L, arm_R, face, blush_L, blush_R, nose, mouth, mouth_open, mouth_inner, eye_L, eye_R, iris_L, iris_R, lash_L…
mirrorPartsarrayPart files to flip left-right as they are read, e.g. `["eyewhite.png"]`. The composer reads eyewhite.png as the eye on the screen LEFT (lash wing at the image's left end, lash-free tear duct at its ri…

measure_layers

Reports read-only geometry checks over an already-composed layers directory — the same checks compose_layers_from_parts returns inline (iris ratio/offset, eye aspect, cropped/cut edges, a nose whose dense core is a speck of its crop, missing optional roles, a body whose feet a tall canvas's bottom cuts off, an arm without a body, an arm whose shoulder cap does not reach under the torso's edge on its shoulder pivot's row (with both readings — a neck, or shoulders over a wider garment — when that row is much narrower than the body below it), a pose forearm without its arm or whose elbow en…

ParameterTypeDescription
layersDir *stringDirectory of role-named layer PNGs (resolved against cwd).

measure_turn_reference

Measures how far a head turns between two images of the same character — a front view and a turned one, at the SAME scale — as three ratios, so a rigged turn can be compared to a reference turn (or to an earlier rig) without registering the images: farEyeRatio (turned far/near iris width over the same ratio at rest), eyeShift (how far the eye pair slides across the head, in units of the FRONT head half-width; NEGATIVE = toward the image's left), silhouetteRatio (head half-width, turned over front). The ratios divide out crop and position, not scale, so the pair must already share framing a…

ParameterTypeDescription
front *stringFront-facing PNG file path (resolved against cwd).
turned *stringThe same character turned, as a PNG file path.
debugDirstringExisting directory (resolved against cwd; confined to the working directory) to write `front-<name>.debug.png` / `turned-<name>.debug.png` overlays into, with the iris boxes and head edges drawn.
irisobjectIris colour window override merged over the violet default (hue 230..300, sat > 0.22) — set it for a character whose eyes are another colour.

render_poses

Renders a rigged .iki into the character loop's pose PNGs with the real engine, through the installed Chrome, Edge or Chromium run headless (set CHROME_PATH to pick one). The model decides the set: a bust gets 560x560 shots (rest, turns, nod, blinks, gaze, combined — ParamAngleX/Y/Z all at 30 — and stress: ParamAngleX/Y/Z all at -30, ParamMouthOpenY 1, both eyes at 0.5, the brows at opposite extremes (ParamBrowLY -1, ParamBrowRY 1, ParamBrowLAngle 1, ParamBrowRAngle -1) and each body angle the model declares at -10); a mouth adds 720x480 mouth crops; a full body (taller than wide) adds the…

ParameterTypeDescription
modelPath *stringRigged .iki file path (resolved against cwd; must sit under the working directory).
outDir *stringExisting directory to write the pose PNGs into (resolved against cwd; must already exist; confined to the working directory).
hidePartsarrayPart ids left out of the drawn frames (poses and sweeps); the fold, physics and sweep reports still read the whole model. Use it to render a character without its custom parts, so `measure_turn_refere…
posesarrayCaller-named poses rendered INSTEAD of the standard set, each `{ name, values, crop? }`, in order. `name` becomes `<outDir>/<name>.png` and the result's pose name: letters, digits, `_`, `.` and `-` on…
sweepobjectA turn sweep rendered IN ADDITION to the poses, `{ name, preset: "turn", crop? }`: an eased `ParamAngleX` turn (0 to -30 to +30 to 0 over 3 s, sinusoidal) at 30 fps on a 60 Hz physics clock, with the…
sweepsarrayMore sweeps rendered after `sweep`, each `{ name, preset, crop? }` into its own `<outDir>/<name>/` (files and `crop` as `sweep`'s). Names are distinct from `sweep`'s and from each other's ignoring cas…

probe_rig

Measures a rigged .iki without rendering it, through the engine's own landing. Each query is one of: `paint` (the opaque runs, alpha 128 and over, of a layer PNG, per canvas row, as `{ y0, rows }` with `[x0, x1)` runs; read from the PNG you give, not the atlas, so a quantized model reads the same, and the PNG must be the model's canvas size), `land` (where each canvas-px point of a part lands in a pose) or `displacement` (the landing minus the point). The frame is canvas px, origin top-left, x right, y down — the frame of the layer PNGs and describe_iki's boxes. A point is `[x, y]` and must…

ParameterTypeDescription
modelPath *stringRigged .iki file path (resolved against cwd; must sit under the working directory).
queries *arrayThe queries, answered in order; at most 64 per call.
outputPathstringA path ending in `.probe.json` (resolved against cwd, under it; its folder must exist) to write the results to.

view_illustration_grid

Writes a PNG of one finished character picture (PNG, JPEG or WebP) for reading coordinates off it: the picture scaled to the 1100 px wide layer canvas (height by its aspect, Lanczos), the same canvas the in-place cut works on, cropped, zoomed by an integer factor nearest-neighbour so the pixels stay readable, with a grid line every `step` canvas px labelled along the top and left edges. FRAME: canvas px, origin top-left, x right, y down; a line labelled v sits on the left (top) edge of canvas pixel v, and a landmark coordinate v names that pixel, drawn through its centre. A picture is turned u…

ParameterTypeDescription
imagePath *stringThe picture (PNG, JPEG or WebP; resolved against cwd).
outputPath *stringA `.png` path (resolved against cwd, under it; its folder must exist). Overwritten if present.
cropobjectThe rectangle to show, in canvas px; clamped to the canvas. The whole canvas when omitted.
landmarksobjectShapes to draw over the picture, by shape (see the description); unknown shapes are skipped.
stepnumberGrid spacing in canvas px, an integer of at least 5; 50 when omitted.
zoomnumberOutput px per canvas px, an integer 1..8; 1 when omitted.

cut_layers_from_illustration

Cuts ONE finished front-facing character picture (PNG, JPEG or WebP) into in-place role layers for auto_rig_from_layers, from landmarks you read off `view_illustration_grid` (no ML: every part is found from your landmarks and colour samples). The picture is scaled to the 1100 px wide layer canvas (height by its aspect), the canvas `view_illustration_grid` shows; a transparent picture is used as is, an opaque one has its flat backdrop keyed from the border's colour (a border that is not one flat colour is refused). FRAME: canvas px, origin top-left, x right, y down; a coordinate names a pixel;…

ParameterTypeDescription
imagePath *stringThe finished picture (PNG, JPEG or WebP; resolved against cwd).
landmarks *objectWhere the picture's parts are, in canvas px read off `view_illustration_grid` (PTS: a list of [x, y] points, each a pixel on the canvas, at most 2000 per list). Required keys: samples, eyes, mouth, fr…
outputDir *stringExisting directory to write the layers into (resolved against cwd; confined to the working directory). Reused across rounds: same-named files are overwritten.
mouthInteriorstringThe lip set's cavity, teeth and tongue alone (the composer's mouth_interior.png; resolved against cwd). Needs `mouthKeyed`.
mouthKeyedstringThe lip set's open mouth, its inside painted flat #00FF00 (the composer's mouth_keyed.png; resolved against cwd). Needs `mouthInterior`.