libresprite-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@libresprite-mcp create a 32x32 pixel art of a treasure chest and export it as PNG"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
libresprite-mcp
An MCP server that drives LibreSprite headlessly, so an AI agent can generate and edit pixel art via tool-calling instead of a human using the GUI.
This exists because every "Aseprite MCP" server on GitHub generates Lua and shells out to real Aseprite -- LibreSprite forked before Aseprite switched to Lua and has its own JavaScript scripting API instead, so none of those servers work against it. This one is written directly against LibreSprite's JS API and CLI batch flags.
This is a personal project, scaffolded by Claude Code and implemented by Codex against the
task backlog tracked in the repository's GitHub issues. The repository is public, and the
testing notes are in docs/testing/README.md. Local development
notes about LibreSprite's scripting API are kept in docs/Design-Notes/.
The current headless API direction is documented in
docs/testing/Headless-API-Improvement-Plan.md.
Related LibreSprite fork
The MCP server and tooling live in this repository. Development patches for the headless LibreSprite scripting/API gaps live in the public vchopDev/LibreSprite fork, which is based on LibreSprite/LibreSprite. The released LibreSprite builds do not yet include those patches; use the fork when testing layer/frame creation or frame-tag support, and use a released binary for the currently supported API.
Related MCP server: Aseprite MCP Server
Requirements
Python 3.10+
A LibreSprite binary on
PATH, or pointLIBRESPRITE_BINat one. CI downloads the latest release's Linux AppImage; there's no binary bundled with this repo.
Usage
pip install -e .
LIBRESPRITE_BIN=/path/to/libresprite libresprite-mcpPoint an MCP client (Claude Code, Codex, etc.) at the libresprite-mcp command over stdio. See
your client's MCP server configuration docs for how to register a local command-based server.
Project layout
src/libresprite_mcp/
client.py Subprocess wrapper around `libresprite -b --script <file>`
seed.py Blank PNG generation (stdlib-only, no image library)
tools.py Sprite operations -- pure functions, one JS script per call
server.py FastMCP wiring: exposes tools.py functions as MCP tools
tests/
test_seed.py Unit tests, no LibreSprite binary needed
integration/ Requires LIBRESPRITE_BIN; skipped otherwiseArchitecture in one paragraph
Every LibreSprite invocation is a fresh subprocess -- there's no persistent "active document"
across tool calls, so every tool is path-in/path-out: open a file, mutate it, save it, return
the path. A sprite is a file on disk, not a session handle. LibreSprite has no headless "new
sprite" command (like every app.command.* call, NewFile is a no-op in batch mode -- see
Known limits), so create_sprite writes a minimal blank PNG itself and hands it to
app.open(), which does work headlessly.
Known limits
With an unpatched released LibreSprite binary, the scripting API runs against a UIContext
that batch mode never marks as having
an "active document." Anything routed through the command system (app.command.*) is
therefore disabled headlessly, confirmed empirically for NewLayer, NewFrame, and
CanvasSize-via-command. This blocks, in this version:
Creating new layers or frames on an existing sprite. Only pre-authored multi-frame/ multi-layer files (built once in the GUI) can be edited per-layer/per-frame; new ones can't be added from a script.
Frame tags (naming an animation range like "walk" or "idle"): no scripting binding exists for these at all, independent of the command-system issue above.
Palette read/write is unsafe in the installed Windows 1.1-dev binary: reading
doc.sprite.palettecauses a native access violation in a fresh headless process. The upstreamPalettemethods are usable only afterloadPalette()in that same process, which cannot safely recover an existing sprite palette across this repo's path-in/path-out calls.
Mutations that go through LibreSprite's Transaction API directly instead of the command
system (sprite.resize(), the sprite.width/height setters) are unaffected and confirmed
working headlessly. The corresponding development patches are tracked in the related fork;
they are not part of the released LibreSprite binaries yet.
Animating with templates
Headless scripts cannot create new frames, but they can edit frames that already exist in a
hand-authored .ase template. Create the animation in LibreSprite's GUI with one explicit,
unlinked cel per frame, save the template, then use set_pixel/set_pixels_bulk with the
desired frame index. The per-frame cel images remain independent across save and reopen;
linked or extended cels are not a supported template layout.
Status
Early scaffold. create_sprite, resize_canvas, export_png, and get_png_data are
implemented and covered by integration tests. get_pixel/set_pixel are stubbed
(NotImplementedError) pending a spike into LibreSprite's pixelColor packing API -- see the
open issues on this repo for the current task backlog.
License
This project is released under the Zero-Clause BSD (0BSD) license. It permits use, modification, redistribution, and commercial use without an attribution requirement, and is provided without warranty.
Available Tools
7 toolscreate_spriteB
Create a new blank sprite file. path should end in .ase or .png.
Inputs: path (required), width (required), height (required). Returns: result
export_pngC
Flatten and export a sprite to a PNG file.
Inputs: path (required), out_path (required). Returns: result
get_pixelA
Read one pixel as RGBA from a layer/frame.
Inputs: x (required), y (required), path (required), frame, +1 more. Returns: object
get_png_dataB
Return base64-encoded PNG data for one layer/frame's image.
Inputs: path (required), frame, layer. Returns: result
resize_canvasC
Resize an existing sprite's canvas in place.
Inputs: path (required), width (required), height (required). Returns: result
set_pixelC
Write one RGBA pixel to a layer/frame.
Inputs: b (required), g (required), r (required), x (required), +5 more. Returns: result
set_pixels_bulkC
Write raw image bytes from base64 to a layer/frame.
Inputs: path (required), data_b64 (required), frame, layer. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools target distinct actions: create, resize, export, pixel read/write. The main overlap risk is between export_png and get_png_data, since both produce PNG output, though one writes a file and the other returns base64 data.
All tool names follow a consistent snake_case verb_noun pattern: create_sprite, resize_canvas, export_png, get_png_data, get_pixel, set_pixel, set_pixels_bulk. Verbs are clear and predictable.
Seven tools is well-scoped for a sprite manipulation server. Each tool covers a core operation without excessive overlap or unnecessary additions.
The set covers creation, resizing, export, and pixel access, but lacks fundamental sprite editor operations: loading existing sprites, saving/in-place writes, layer/frame enumeration, and canvas metadata. Agents cannot meaningfully inspect or manipulate a sprite's structure beyond individual pixels.
Maintenance
Related MCP Connectors
Generate, edit, style-match, turn, and animate game-ready pixel art at exact sizes.
Generate authentic pixel art - sprites, animations, and tilesets - from any MCP client
Pixel art for your game, from your coding agent. Generate sprites, items and tiles in your game's style (64 to 1024 px), make variants, reskins and N/E/S/W directions, then edit everything in a full pixel art editor that syncs into your project. Works with Claude, Claude Code, Cursor and ChatGPT; sign in with OAuth, no API key.
Turn images into pixel art, extract and remap palettes, and upscale sprites without blur.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to visually interact with LibreSprite for real-time pixel art creation and automated drawing with self-healing capabilities.MIT
- AlicenseAqualityBmaintenanceEnables AI to create pixel art in Aseprite through pixel-level drawing primitives, read canvas screenshots, and iterate until satisfied.317MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to create, inspect, edit, and export pixel art, sprites, animations, and spritesheets using headless Aseprite, and to convert arbitrary images into indexed pixel art.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI clients to create and revise editable pixel art in a running Aseprite editor, with live tools for sprites, layers, drawing, animation, palettes, selections, previews, saving, and exporting.MIT