# Pillow Lottie > Free, privacy-first Lottie (Bodymovin JSON / .lottie) editor. Humans edit in the browser; AI agents can edit animations through a remote MCP server, a REST API, or an in-page JavaScript/WebMCP API. Site: https://lottie.pillow-sauce.com/ ## MCP server (recommended for AI assistants) - Endpoint: `https://lottie.pillow-sauce.com/mcp` — MCP Streamable HTTP, stateless, no auth, JSON responses. - Add it as a "custom connector" / remote MCP server in Claude, ChatGPT, Cursor, VS Code, etc. - Every tool takes the animation as ONE of: - `lottie` — the Lottie JSON object (or a JSON string) - `lottie_url` — public URL of a `.json` or `.lottie` file - `share_url` — an editor link returned by a previous call (cheapest way to chain edits) - Output (`output`): `"json"` (default, edited Lottie JSON), `"link"` (editor URL the user can open), `"both"`. Tools: - `lottie_inspect` — size, fps, duration, layers (keys + names), colors with usage, texts, missing fonts. Call first. - `lottie_edit` — batch of operations (below), applied atomically. - `lottie_replace_colors` — `{map: {"#FF0000": "#00AAFF"}, tolerance?, layers?}` - `lottie_set_text` — `{layer, text?, font_size?, font_family?, fill?, justify?}` - `lottie_crop` — `{x, y, width, height}` crop, or `{width, height, anchor}` canvas resize without scaling - `lottie_resize` — uniform scale `{factor}` / `{width}` / `{height}` - `lottie_trim` — `{start, end}` frames or `{start_sec, end_sec}` - `lottie_set_speed` — `{factor}` or `{duration_sec}` - `lottie_optimize` — `{preset: safe|balanced|smallest-file|mobile-smooth|web-fast}` - `lottie_validate` — Web/iOS/Android compatibility report - `lottie_open_in_editor` — link that opens the animation in the editor (data lives in the URL #fragment, never uploaded) Operations for `lottie_edit` (`{"op": "...", ...}`): - `replace_color {from, to, tolerance?, layers?}` · `replace_colors {map, tolerance?, layers?}` - `set_layer_color {layer, color, sources?: [fill|stroke|gradient|text|solid|effect]}` - `set_text {layer, text?, font_size?, font_family?, fill?, justify?}` (`\n` = line break) - `set_layer {layer, visible?, name?, opacity?, position?: [x,y], scale?: % | [sx,sy], rotation?, in_frame?, out_frame?}` - `delete_layer {layer}` - `crop {x, y, width, height}` · `resize_canvas {width, height, anchor?}` · `scale {factor|width|height}` - `trim {start?, end?, start_sec?, end_sec?}` · `set_speed {factor}` · `set_duration {seconds}` · `set_frame_rate {fps, keep_duration?}` - `optimize {preset?}` · `set_name {name}` Layer selectors: a key from `lottie_inspect` (`"::0"`, `"comp_1::3"`), a layer name (case-insensitive), `"*"`, `{"ind": 5}`, or `{"name": "...", "match": "exact|contains|regex"}`. Colors are hex strings. Coordinates are composition pixels. Times are frames unless the field ends in `_sec`. Example: ```json {"name": "lottie_edit", "arguments": { "lottie_url": "https://example.com/loader.json", "operations": [ {"op": "replace_colors", "map": {"#6366F1": "#E11D48"}}, {"op": "set_text", "layer": "Title", "text": "Готово!"}, {"op": "crop", "x": 40, "y": 40, "width": 432, "height": 432}, {"op": "set_speed", "factor": 1.5} ], "output": "both" }} ``` ## REST API (same tools, no MCP client needed) - `GET /api/tools` — tool list with JSON Schemas - `POST /api/` — body = tool arguments, e.g. `POST /api/inspect {"lottie_url": "..."}` or `POST /api/edit {"lottie": {...}, "operations": [...]}` - Response: `{content: [{type: "text", text}], structuredContent, isError?}`. The last `content` item is the Lottie JSON when `output` includes json. ## Editor deep links - `/#lz=&name=` — opens the animation (decoded in the browser). - `/?lottie_url=` — downloads a `.json`/`.lottie` in the browser and opens it. ## In-page API (browser agents) On https://lottie.pillow-sauce.com/ the page exposes `window.pillowLottie`: `load(json, name?)`, `loadUrl(url)`, `inspect()`, `validate()`, `apply(operations)` (one undo step), `undo()`, `redo()`, `export(pretty?)`, `download(name?)`, `shareUrl()`, `get()`. When the browser supports WebMCP (`navigator.modelContext`), the tools `pillow_lottie_get_state`, `pillow_lottie_load`, `pillow_lottie_edit`, `pillow_lottie_undo`, `pillow_lottie_export` are registered. ## Limits - Stateless: nothing is stored server-side. Large files (> a few MB) may hit Cloudflare CPU limits on the free plan. - Editing animated text keyframes, expressions and effects is not supported (they are preserved).