Aseprite MCP Server
Enables AI to create pixel art in Aseprite through pixel-level drawing primitives, read canvas screenshots, and iterate until satisfied.
README
<div align="center">
๐จ Aseprite MCP Server
Let AI draw pixel art in Aseprite
A Model Context Protocol (MCP) server that enables AI to create pixel art in Aseprite through pixel-level drawing primitives, read canvas screenshots, and iterate until satisfied.
<p align="center"> <a href="README_CN.md">๐จ๐ณ ็ฎไฝไธญๆ</a> </p>
</div>
<br>
[!IMPORTANT] This project requires a local installation of Aseprite v1.3+. AI performs drawing via the MCP protocol by calling the Aseprite CLI + Lua scripts.
Two execution modes are supported:
- CLI mode (default): Each tool call spawns a headless Aseprite process (
aseprite -b). No UI, state passed via.asefiles.- Live mode (WebSocket): AI operates the running Aseprite instance directly through a WebSocket bridge. UI is visible, state is persistent, and you can watch AI draw in real time. See Live Mode Setup below.
Table of Contents
How to Use
1. Environment Setup
Before configuring MCP, prepare your local development environment:
| Dependency | Version | Download |
|---|---|---|
| Python | 3.10+ | python.org |
| Aseprite | v1.3+ | aseprite.org (remember the install path) |
2. MCP Server Setup
git clone https://github.com/ZhangDongyang800/Aseprite_MCP.git
cd Aseprite_MCP
pip install -e .
This installs fastmcp and websockets (the latter is required for optional Live Mode).
3. Client Configuration
[!IMPORTANT] Replace the paths below with your actual local paths:
- Path to
server.pyinargsASEPRITE_PATHenvironment variable valuepythonpath incommand
TRAE:
Open TRAE โ Settings โ MCP โ Add MCP Server, paste:
{
"mcpServers": {
"aseprite": {
"command": "python",
"args": ["C:\\path\\to\\Aseprite_MCP\\server.py"],
"env": {
"ASEPRITE_PATH": "C:\\Program Files\\Aseprite\\aseprite.exe"
}
}
}
}
Codex CLI:
Config file: ~/.codex/config.toml
[mcp_servers.aseprite]
command = "python"
args = ["/path/to/Aseprite_MCP/server.py"]
[mcp_servers.aseprite.env]
ASEPRITE_PATH = "C:\\Program Files\\Aseprite\\aseprite.exe"
After configuration, ask your AI tool to use Aseprite-related tools to start creating.
๐ฅ Live Mode (Optional, WebSocket)
Live mode lets AI operate your running Aseprite instance directly โ you can watch every stroke happen in real time on your screen, and the sprite state persists across tool calls (no repeated file open/save overhead).
How It Works
โโโโโโโโโโโ MCP (stdio) โโโโโโโโโโโโโโโโ WebSocket โโโโโโโโโโโโโโโโโโโโ
โ AI/TRAE โ โโโโโโโโโโโโโโโโบ โ Python MCP โ โโโโโโโโโโโโโโบ โ Aseprite Extensionโ
โ โ โโโโโโโโโโโโโโโโ โ Server โ โโโโโโโโโโโโโ โ (WebSocket client) โ
โโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโฌโโโโโโโโโโโโ
โ Lua app.* API
โผ
โโโโโโโโโโโโโโโโ
โ Visible Aseprite โ
โ Sprite + UI โ
โโโโโโโโโโโโโโโโ
The Python MCP server starts a WebSocket server on 127.0.0.1:9001. The Aseprite extension connects to it as a client. Each MCP tool call is forwarded to Aseprite over WebSocket, executed via the existing Lua scripts, and the result is sent back.
Setup
1. Install the Aseprite extension
The extension is in the extension/ folder of this repo. Install it via:
- Open Aseprite โ
File > Scripts > Open Scripts Folder - Copy the entire
extension/folder contents into the scripts folder (or useEdit > Preferences > Extensions > Add Extensionand select theextension/folder)
2. Enable WebSocket mode in MCP config
Add ASEPRITE_MCP_MODE=ws to the env section of your MCP server config:
{
"mcpServers": {
"aseprite": {
"command": "python",
"args": ["C:\\path\\to\\Aseprite_MCP\\server.py"],
"env": {
"ASEPRITE_PATH": "C:\\Program Files\\Aseprite\\aseprite.exe",
"ASEPRITE_MCP_MODE": "ws",
"ASEPRITE_WS_HOST": "127.0.0.1",
"ASEPRITE_WS_PORT": "9001"
}
}
}
}
3. Connect Aseprite
With the MCP server running, open Aseprite and click:
File > Scripts > MCP Bridge: Toggle Connection
You should see an alert: "MCP Bridge: Connected to ws://127.0.0.1:9001".
Now AI can operate Aseprite directly โ create a sprite, draw pixels, and you'll see it happen live.
CLI vs Live Mode Comparison
| Aspect | CLI Mode (default) | Live Mode (WebSocket) |
|---|---|---|
| UI visibility | Headless (-b flag) |
Full UI, watch AI draw |
| State persistence | Per-call (file-based) | Persistent across calls |
| Startup overhead | New process per call | Single running instance |
| Setup complexity | None | Install extension + connect |
| Aseprite focus required | No | Yes (callbacks delayed when unfocused) |
| Fallback | N/A | Auto-falls back to CLI if extension not connected |
[!TIP] If the Aseprite extension is not connected, Live mode tools return a clear error message guiding you to connect. The existing CLI mode is always available as fallback by setting
ASEPRITE_MCP_MODE=cli(or removing the variable).
Environment Variables
| Variable | Default | Description |
|---|---|---|
ASEPRITE_MCP_MODE |
cli |
Execution mode: cli or ws |
ASEPRITE_WS_HOST |
127.0.0.1 |
WebSocket server bind address |
ASEPRITE_WS_PORT |
9001 |
WebSocket server port |
What It Can Do
Let AI create pixel art in Aseprite like a human artist โ with a complete workflow supporting pixel-level drawing, multi-layer management, animation frame editing, palette control, animation tags, image transforms, and canvas preview. 49 tools in total.
Pixel-Level Drawing
All drawing tools support layer and frame parameters, allowing drawing on a specific layer and frame (default: layer 1, frame 1).
| Tool | Description |
|---|---|
draw_pixel |
Draw a pixel at specified coordinates |
draw_line |
Draw a straight line |
draw_rect |
Draw a rectangle (outline / filled) |
draw_ellipse |
Draw an ellipse (outline / filled) |
fill_region |
Paint bucket fill a connected region |
clear_region |
Clear a region to transparent |
clear_canvas |
Clear the entire canvas |
Sprite Management
| Tool | Description |
|---|---|
create_sprite |
Create a new canvas (supports rgb / grayscale / indexed modes) |
open_sprite |
Open an existing .ase or .png file |
save_sprite |
Save as .ase / .png / .gif |
close_session |
Close the session and clean up temporary resources |
import_png |
โ
Recommendedโ
Import an image from a PNG file โ the most token-efficient way to draw arbitrary shapes. Two modes: new (create a new session from the PNG, auto-reads real dimensions) / stamp (paste the PNG onto an existing session at a given layer/frame/offset). Recommended workflow: generate a PNG with Python/PIL, call import_png(mode="new"), then refine with draw_pixel / draw_rect etc. |
Animation & Frames
| Tool | Description |
|---|---|
add_frame |
Add a new frame (copy last or create empty) |
remove_frame |
Remove a specific frame |
set_frame_duration |
Set frame duration (seconds) |
get_frame_info |
Get all frame info (count, duration per frame) |
export_gif |
Export GIF animation (supports scaling) |
export_sprite_sheet |
Export sprite sheet (PNG + JSON data) |
Layer Management
| Tool | Description |
|---|---|
add_layer |
Create a new layer |
remove_layer |
Remove a layer (by name or index) |
set_layer_properties |
Set layer properties (name, visibility, opacity, blend mode) |
get_layer_info |
Get info for all layers |
move_cel |
Move a cel between layers / frames |
Palette
| Tool | Description |
|---|---|
set_palette_color |
Set the color at a specific palette index |
get_palette |
Get all colors in the current palette |
resize_palette |
Resize the palette (number of colors) |
load_palette |
Load a palette from a file (.gpl / .pal / .png) |
Animation Tags
| Tool | Description |
|---|---|
add_tag |
Create an animation tag (supports playback direction, loop count) |
remove_tag |
Remove a tag by name |
get_tags |
Get info for all tags |
Image Transforms
| Tool | Description |
|---|---|
flip_canvas |
Flip canvas (horizontal / vertical) |
resize_sprite |
Resize the sprite |
rotate_canvas |
Rotate canvas (90ยฐ / 180ยฐ / 270ยฐ) |
crop_sprite |
Crop sprite to a specified region |
invert_color |
Invert all colors |
replace_color |
Replace a specific color |
Palette Enhancements
| Tool | Description |
|---|---|
apply_preset_palette |
โ Batchโ Apply a built-in preset palette (db16/db32/aap64/nes/gameboy) |
derive_shading_palette |
Derive a three-step shading palette from a base color (with hue shift, auto-applied by default) |
append_palette_colors |
โ Batchโ Append multiple colors to the palette |
Animation Helpers
| Tool | Description |
|---|---|
apply_timing_preset |
โ Batchโ Set frame durations in bulk by animation type |
draw_animation_frames |
โ Batchโ Draw multiple animation frames in one call |
export_onion_skin_preview |
Onion-skin overlay preview (compare adjacent frames) |
Tileset Tools
| Tool | Description |
|---|---|
create_tileset_canvas |
Create a tileset canvas and set up the grid |
export_tiled_preview |
Tiled layout preview (seam check) |
Quality Checks
| Tool | Description |
|---|---|
export_silhouette |
Export a solid black silhouette (silhouette test) |
check_canvas_standards |
Auto-check canvas standards (size / colors / frame duration / pixel art) |
Canvas Inspection
| Tool | Description |
|---|---|
get_canvas_preview |
Export a PNG for AI visual analysis (core iteration tool) |
get_canvas_info |
Get canvas metadata (size, color mode, etc.) |
get_pixel_color |
Query the color of a pixel at specified coordinates |
Other Capabilities
- MCP Resources โ Session list, default palette, canvas metadata, blend mode list, animation direction list
- MCP Prompts โ Sprite creation guide, iteration review guide, animation creation guide, multi-layer workflow guide
[!TIP]
get_canvas_previewis the core of the workflow: after drawing, AI calls it to "see" the canvas, analyze it, and decide whether to fix it, forming a draw โ preview โ analyze โ fix loop.
<br>
<div align="center">
CLI Mode Data Flow (default)
AI Request โ MCP Tool Call โ FastMCP (Python) โ Aseprite CLI โ Lua Script โ .ase File
โ
AI Visual Analysis โ base64 PNG โ Image Object โ FastMCP โ export_png.lua โโโ
</div>
Demo
Example: Chibi Knight Walk Cycle
<div align="center">
Four-Direction Walk Animation
| โ Down | โ Up |
|---|---|
![]() |
![]() |
| โ Left | โ Right |
![]() |
![]() |
Sprite Sheet
![]()
</div>
AI Prompt:
Use Aseprite MCP to generate a pixel art sprite sheet of a brave knight in silver armor holding a long sword. Four-direction walk cycle (down, up, left, right), 4 frames per direction, 32x32, flat colors, transparent background.
Example: Import a PNG (Recommended Workflow for Arbitrary Shapes)
When drawing complex or non-grid-friendly shapes, generating a PNG with Python/PIL and importing it is far more token-efficient than describing every pixel with draw_from_grid or hundreds of draw_pixel calls.
# Step 1: Generate a PNG with Python/PIL
from PIL import Image, ImageDraw
img = Image.new("RGBA", (32, 32), (0, 0, 0, 0)) # transparent background
d = ImageDraw.Draw(img)
d.ellipse([4, 4, 27, 27], fill=(231, 76, 60, 255)) # draw a red circle
img.save("circle.png")
# Step 2: Import the PNG into a new Aseprite session
import_png(png_path="circle.png", mode="new")
# Returns: { "session_id": "...", "width": 32, "height": 32, ... }
# Step 3: Refine with pixel-level tools if needed
draw_pixel(session_id="...", x=16, y=6, color="#FFFFFF") # add a highlight
Use mode="stamp" to paste a PNG onto an existing session at a specific layer/frame/offset โ handy for adding details, stamps, or compositing sub-images.
๐ค Contributing
Issues and Pull Requests are welcome!
I've tried it, but I can't guarantee it works perfectly. It still needs more optimization.
License
This project is open-sourced under the MIT License.
Copyright ยฉ 2026 ZhangDongyang800
<div align="center">
<sub>Built with โค๏ธ for pixel art lovers</sub>
</div>
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.



