Aseprite Agent MCP
v0.3.0Create and verify pixel-art assets with atomic Aseprite edits and Phaser export.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
apply_operations
Apply a list of edit operations to a sprite in one atomic, single-process batch. If any op fails, the whole batch is rolled back, nothing is saved, and the error names the failing op index. dry_run=true checks the list without launching Aseprite (shape only; a missing layer still fails on a real run). Returns a workflow_manifest.v1 with a per-op operations list. Each operation is {"op": "<name>", "args": {...}}. Ops run in order against the same open sprite, so later ops see earlier ones (add a layer, then draw on it). Coordinates are pixels from the top-left (0,0); frames are 1-based and mus…
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
operations * | array | |
dry_run | boolean |
export_onion_skin
Export a frame with neighbouring frames ghosted behind it (onion skin). Args: frame: The in-focus frame (drawn fully opaque), 1-based. previous, next: How many earlier/later frames to ghost. ghost_opacity: Max opacity (0-255) of the nearest ghost; further frames fade. scale: Integer upscaling factor for the output PNG. overwrite: Replace an existing output file. Editable .ase/.aseprite masters are never replaced.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
frame * | integer | |
output * | string | |
ghost_opacity | integer | |
next | integer | |
overwrite | boolean | |
previous | integer | |
scale | integer |
get_sprite_info
Return structured info about a sprite: size, colour mode, frames (with durations), the full layer tree (names, opacity, blend mode, visibility), animation tags, and palette size.
| Parameter | Type | Description |
|---|---|---|
filename * | string |
render_preview
Render a single frame to a PNG and return it as an image you can view. Use this to *see* your work. frame is 1-based; scale enlarges small sprites (default 8x) so individual pixels are visible.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
frame | integer | |
scale | integer |
get_pixels
Read the composited (all visible layers) pixel colours of a region. Returns rows of "#RRGGBBAA" hex strings. The region is capped at 64x64 (4096 pixels) per call to keep responses small — read in tiles for bigger areas.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
frame | integer | |
height | ||
width | ||
x | integer | |
y | integer |
list_sprites
List sprite/image files in the workspace directory.
get_palette
Return the sprite's palette as a list of "#RRGGBBAA" colours.
| Parameter | Type | Description |
|---|---|---|
filename * | string |
set_palette
Replace the entire palette with the given list of colours. colors: list of colour strings, e.g. ["#000000", "#ffffff", "255,0,0"].
| Parameter | Type | Description |
|---|---|---|
colors * | array | |
filename * | string |
load_palette
Load a palette from a file (.gpl, .pal, .aseprite, .png, ...) and apply it.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
palette_file * | string |
set_cel_position
Move a cel's image to position (x, y) within the canvas.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
frame * | integer | |
layer * | string | |
x * | integer | |
y * | integer |
copy_cel
Copy a cel's image (and position) from one frame to another on the same layer.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
from_frame * | integer | |
layer * | string | |
to_frame * | integer |
draw_pixels
Plot individual pixels. Args: pixels: List of {"x": int, "y": int, "color": "#hex"?}. If a pixel omits "color", the shared `color` argument is used. color: Default colour for pixels that don't specify their own. layer: Target layer name or 1-based index (default: top layer). frame: Target frame, 1-based (default 1).
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
pixels * | array | |
color | ||
frame | integer | |
layer |
draw_line
Draw a straight line from (x1,y1) to (x2,y2). Args: pixel_perfect: Remove L-shaped corner pixels for a clean 1px pixel-art line. antialias: Smooth (Xiaolin Wu) line with alpha blending — RGB sprites only; ignored on indexed/gray. Takes precedence over pixel_perfect.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
filename * | string | |
x1 * | integer | |
x2 * | integer | |
y1 * | integer | |
y2 * | integer | |
antialias | boolean | |
frame | integer | |
layer | ||
pixel_perfect | boolean |
draw_rectangle
Draw a rectangle. filled=False draws a 1px outline, True fills it.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
filename * | string | |
height * | integer | |
width * | integer | |
x * | integer | |
y * | integer | |
filled | boolean | |
frame | integer | |
layer |
fill_area
Flood fill (paint bucket): replace the contiguous region of matching colour starting at (x,y) on the target layer with `color`.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
filename * | string | |
x * | integer | |
y * | integer | |
frame | integer | |
layer |
replace_color
Replace every pixel matching `from_color` (within `tolerance` per channel) with `to_color`, on the chosen layer + frame.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
from_color * | string | |
to_color * | string | |
frame | integer | |
layer | ||
tolerance | integer |
add_frame
Append a new frame to the animation. Args: duration_ms: Frame duration in milliseconds (default 100). copy_from: If given (1-based), duplicate the content of that frame; otherwise the new frame is empty. Returns the new frame number and updated frame count.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
copy_from | ||
duration_ms | integer |
remove_frame
Delete a frame (1-based). The sprite must have more than one frame.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
frame * | integer |
set_frame_duration
Set a single frame's duration in milliseconds (1-based frame).
| Parameter | Type | Description |
|---|---|---|
duration_ms * | integer | |
filename * | string | |
frame * | integer |
add_layer
Add a new (empty) normal layer on top of the stack. Args: name: Layer name. group: Optional name of an existing group layer to nest the new layer in. opacity: 0-255. blend_mode: normal, multiply, screen, overlay, darken, lighten, color_dodge, color_burn, hard_light, soft_light, difference, exclusion, hue, saturation, color, luminosity, addition, subtract, divide. visible: Initial visibility.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
name * | string | |
blend_mode | string | |
group | ||
opacity | integer | |
visible | boolean |
rename_layer
Rename a layer.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
layer * | string | |
new_name * | string |
set_layer_properties
Update one or more layer properties. Only the arguments you pass are changed.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
layer * | string | |
blend_mode | ||
editable | ||
name | ||
opacity | ||
visible |
create_sprite
Create a new sprite file and save it. Args: filename: Output path. Relative paths go in the workspace. Use a .aseprite/.ase extension to keep layers & frames editable. width, height: Canvas size in pixels (1-65535). color_mode: "rgb" (default), "indexed", or "gray". background: Optional fill colour for the first layer (e.g. "#1d2b53"). Omit for a transparent canvas. overwrite: Replace `filename` if it already exists (default False = no-clobber). Returns the new sprite's structured info.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
height * | integer | |
width * | integer | |
background | ||
color_mode | string | |
overwrite | boolean |
save_sprite_as
Save a copy of a sprite under a new path (optionally flattened). The original file is left untouched. Useful for exporting an editable .aseprite to another .aseprite, or snapshotting a version. overwrite: Replace `new_filename` if it already exists (default False = no-clobber).
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
new_filename * | string | |
flatten | boolean | |
overwrite | boolean |
add_tag
Create an animation tag spanning frames [from_frame, to_frame] (1-based). direction: "forward" (default), "reverse", "pingpong", or "pingpong_reverse". color: optional tag colour (shown in the timeline).
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
from_frame * | integer | |
name * | string | |
to_frame * | integer | |
color | ||
direction | string |
remove_tag
Delete an animation tag by name.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
name * | string |
set_tag
Update an existing tag. Only the arguments you pass are changed. Note: changing from_frame/to_frame recreates the tag in place to update its range reliably across Aseprite versions.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
name * | string | |
color | ||
direction | ||
from_frame | ||
new_name | ||
to_frame |
mirror_layer
Mirror one half of a layer onto the other (build symmetric artwork). Args: direction: "horizontal" (reflect left<->right) or "vertical" (top<->bottom). source_side: which half is copied: "first" (left/top) or "second" (right/bottom). axis: mirror line position (x for horizontal, y for vertical); default = centre.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
layer * | string | |
axis | ||
direction | string | |
frame | integer | |
source_side | string |
draw_symmetric_pixels
Plot pixels together with their mirror image(s). mode: "horizontal" (mirror across vertical axis_x), "vertical" (across axis_y), or "both" (4-way radial symmetry). Axes default to the canvas centre.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
filename * | string | |
pixels * | array | |
axis_x | ||
axis_y | ||
frame | integer | |
layer | ||
mode | string |
draw_pixel_rows
Draw a block of pixel art in one call, like a text-art bitmap. Each string in `rows` is one pixel row; each character is looked up in `key` and painted at (x + column, y + row), with (0,0) the top-left of the canvas. '.' and ' ' are left untouched unless `key` defines them. Any other character missing from `key` is an error, so typos never paint silently. Example: rows=["..oo..", ".oxxo.", "..oo.."], key={"o": "#203040", "x": "#f0c060"}. Args: rows: Up to 256 strings of up to 256 characters each. key: Single character -> colour ("#RRGGBB", "#RRGGBBAA"…
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
key * | object | |
rows * | array | |
clear | boolean | |
frame | integer | |
layer | ||
x | integer | |
y | integer |
derive_mirrored_tag
Create a new animation tag by mirroring an existing one (e.g. walk_left from walk_right). Copies every frame of `source_tag` to new frames at the end of the sprite, flips every layer's cel along `axis`, keeps each frame's duration, and tags the new frames `new_tag` with the source tag's playback direction. Other tags keep their exact ranges. Asymmetric details (a sword hand, a logo) flip too, so review the result with ase_preview_animation. Args: source_tag: Existing tag to mirror. new_tag: Name for the new tag; must not exist yet. axis: "horiz…
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
new_tag * | string | |
source_tag * | string | |
axis | string |
copy_frames_from
Append frames from another sprite file, flattened onto one layer of this sprite. Use it to start every character from a shared base body or animation. The source frames are composited (all visible layers) and placed on `layer` of `filename`, keeping each frame's duration. If this sprite has a single empty frame (a fresh file), the first copied frame fills it instead of leaving a blank frame in front. Args: source: The .aseprite file to copy from (same width, height and colour mode). source_tag: Copy this tag's frames. Or give from_frame/to_frame (1-bas…
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
source * | string | |
from_frame | ||
layer | ||
new_tag | ||
source_tag | ||
to_frame |
recolor_sprite
Replace colours across every layer, frame and palette entry of a sprite. Use it to turn one character template into another (new shirt, hair, skin). Each source colour is matched per channel within `tolerance` and replaced by its target; every pixel is mapped once from its original value, so swaps such as A->B and B->A work. With `output`, the recoloured sprite is saved as a new file and the original is left untouched. Args: mapping: Source colour -> target colour, e.g. {"#3060c0": "#c03030"}. output: Optional new .aseprite path. Without it the sprite…
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
mapping * | object | |
output | ||
overwrite | boolean | |
tolerance | integer |
import_generated_image
Clean one PNG into a binary-alpha pixel grid, palette and editable master. background is an explicit #RRGGBB border-connected colour key, not semantic segmentation. outline adds a 1px eight-neighbour border, clipped at the cell edge, and may add one palette colour. N colours excludes transparency. New output directory only. Returns a nearest-neighbour preview for review. width/height support 1..256px grids. palette_first snaps the source to one shared palette before sampling, useful with majority on generated shading.
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
output_directory * | string | |
alpha_threshold | integer | |
background | ||
background_tolerance | integer | |
colours | integer | |
height | integer | |
method | string | |
outline | ||
palette | ||
palette_first | boolean | |
width | integer |
assemble_animation
Clean 1..128 ordered PNG poses with one palette; save master, sheet and JSON. Bounding-box mode uses one shared scale, bottom-centres silhouettes and leaves an outline margin. Anchor mode scales same-size canvases and translates each source [x,y] to (width//2,height-2), refusing clipping. No pose synthesis is implied: inspect the preview for identity, timing and motion coherence. Output is atomically published only after master and PNG pixel verification. Use height=128 and colours=32..48 for detailed sprites. palette_first snaps one shared source palette before sa…
| Parameter | Type | Description |
|---|---|---|
filenames * | array | |
output_directory * | string | |
alignment | string | |
alpha_threshold | integer | |
anchors | ||
background | ||
background_tolerance | integer | |
colours | integer | |
duration_ms | integer | |
durations_ms | ||
height | integer | |
method | string | |
outline | ||
palette | ||
palette_first | boolean | |
tag | string | |
width | integer |
health_check
Run a self-test of the server and its Aseprite integration. Returns whether Aseprite was found, its version, the resolved workspace, the number of registered tools, and whether a real create-sprite + export-PNG round-trip succeeds. `ok` is True only if the full round-trip works.
flip_sprite
Flip the entire sprite. direction: "horizontal" or "vertical".
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
direction | string |
ase_validate_asset_contract
Reopen a native master and check every frame against a contract. Checks frame count, cell size, that each row's tag covers exactly its frames in order with the expected playback, binary alpha, palette membership, empty frames, and optional per-row foot/centre drift. Unknown contract fields are rejected. Rows are laid out in contract order starting at frame 1. Passing proves geometry and colours, not art quality: still review with ase_preview_animation.
| Parameter | Type | Description |
|---|---|---|
contract * | ||
filename * | string |
ase_apply_and_preview
Atomically apply typed batch operations to a native master, then return the result and a nearest-neighbour PNG of `frame` at `scale` (1-16). Save succeeds before the preview; a preview failure is reported as saved, not rolled back. Each operation is {"op": "<name>", "args": {...}}. Ops run in order against the same open sprite, so later ops see earlier ones (add a layer, then draw on it). Coordinates are pixels from the top-left (0,0); frames are 1-based and must exist; layer is a name or 1-based index and defaults to the top layer; durations are milliseconds. '?' marks an optional arg. - add…
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
operations * | array | |
frame | integer | |
scale | integer |
ase_preview_animation
Return a labelled contact sheet of every frame, scaled with nearest-neighbour. With by_tag (default) each tag gets its own row, labelled with its name, frame range, playback and the frame numbers; untagged frames share a final row. The background is a checkerboard so transparency is visible, or any colour. Also returns the sprite info (frame timing in seconds, tags). This is a review sheet, not proof that the motion reads well. Args: scale: 1-16 pixel magnification. background: "checker" (default), a colour such as "#202020", or null for transparent.…
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
background | ||
by_tag | boolean | |
scale | integer |
ase_export_phaser
Validate a native master and export a Phaser bundle directory. Writes sheet.png (one row per contract row), a Phaser hash atlas, animations.json (per-frame timing, repeat and yoyo from the contract), qa.json, contract.json and loader.js. The master and the written PNG are reopened and every RGBA pixel is compared before publishing. Animations are named "<contract name>:<row tag>". An existing directory is only replaced with replace=true, and only if it is a previous bundle; the swap is a rename, so a failed export leaves the old one intact.
| Parameter | Type | Description |
|---|---|---|
contract * | ||
filename * | string | |
output_directory * | string | |
replace | boolean |
ase_export_cast_atlas
Validate several character masters and export them as ONE Phaser atlas. Each member is validated against its own contract; if any fails, nothing is written and every failure is returned. Characters are stacked as row blocks in one sheet.png. Atlas frames are "<character>/<tag>_<nn>" and animations are "<character>:<tag>", all under the atlas key `name`. Every frame of every master is reopened and compared pixel-for-pixel with the written sheet before publishing.
| Parameter | Type | Description |
|---|---|---|
members * | array | |
name * | string | |
output_directory * | string | |
replace | boolean |