aseprite-mcp
An MCP server, packaged as a Claude Code plugin, that lets Claude Code drive Aseprite to create static sprites, animated sprites, and tilemaps. Claude gets tools to draw and export art, and can see its work through rendered previews. You open the resulting .aseprite files in the editor and keep working on them yourself.
Features
- Sprites: create a canvas (or import a PNG), use palette presets, manage layers and groups, draw pixels, lines, rectangles and ellipses, flood fill, replace colors, and paste images.
- ASCII-art drawing: draw with row strings plus a color legend, which is compact and easy for an LLM to reason about.
read_pixels returns the same format.
- Animation: add, copy and remove frames, set per-frame durations, define tags with a direction, and move cels for bobbing or sliding motion.
- Tilemaps: create tilesets, draw tiles, add tilemap layers, place tiles from a 2D grid, and export a tileset atlas with JSON or Tiled
.tmj map data.
- Feedback loop:
render_preview returns a zoomed PNG of a frame, several frames or a tag, with optional onion skin. Any editing tool also accepts preview: true.
- Batching:
batch runs many steps in one Aseprite process. It is fast and all-or-nothing: if any step fails, nothing is saved.
- Exports: sprite sheets with JSON metadata for Godot, Unity, Phaser and LÖVE, animated GIF or WebP, and PNG frames or layers.
- Non-destructive output: everything is saved as normal
.aseprite files.
How it works
┌─────────────┐ MCP (stdio) ┌──────────────────┐ CLI + Lua ┌────────────────────┐
│ Claude Code │ ──────────────▶ │ aseprite-mcp │ ─────────────▶ │ aseprite --batch │
│ │ ◀────────────── │ (Node.js) │ ◀───────────── │ --script runner.lua│
└─────────────┘ results+images └──────────────────┘ JSON files └────────────────────┘
│
▼
workspace/*.aseprite, *.png, *.json
- Claude calls a tool such as
draw_pixels. The server validates the arguments and resolves paths inside the workspace.
- The server writes a request file and runs Aseprite headlessly:
aseprite --batch --script-param input=… --script-param output=… --script lua/runner.lua
lua/runner.lua runs each operation through the Aseprite scripting API, saves the changed files only if every operation succeeded, and writes a JSON response.
- The server returns that result to Claude, plus a PNG image when a preview was requested.
Calls don't share state: the .aseprite file on disk is the only record. A typical call takes about 100 ms. Exports use Aseprite's own CLI flags (--sheet, --save-as, and so on).
Tools
| Group | Tools |
|---|
| Document | create_sprite, get_sprite_info, resize_sprite, crop_sprite (also extends the canvas), set_palette, set_color_mode, list_sprites, list_palettes |
| Layers | add_layer, remove_layer, set_layer_props, duplicate_layer |
| Drawing | draw_pixels, draw_line, draw_rect, draw_ellipse, fill, clear, replace_color, paste_image, read_pixels |
| Animation | add_frame, remove_frame, copy_frame, set_frame_duration, add_tag, remove_tag, move_cel |
| Tilemaps | create_tileset, add_tilemap_layer, draw_tile, set_tiles, get_tilemap, export_tilemap |
| Preview & export | render_preview, export_png, export_spritesheet, export_gif |
| Meta | batch, plus run_lua (only when ASEPRITE_ALLOW_LUA=true) |
Conventions: paths are relative to the workspace, frames are 1-based, and tile index 0 is always the empty tile. Colors are #rgb, #rrggbb or #rrggbbaa, a palette index, or "transparent".
Palette presets: pico8, sweetie16, db32, endesga32, gameboy.
Example: ASCII-art drawing
{
"file": "items/potion.aseprite",
"x": 4, "y": 2,
"legend": { "k": "#1a1c2c", "g": "#a7f070", "G": "#38b764", "w": "#f4f4f4" },
"rows": [
"...kk...",
"..kggk..",
".kgwggk.",
".kgGGGk.",
"..kkkk.."
],
"preview": true
}
Characters that are not in the legend (here .) leave the existing pixel unchanged.
Example: batch