Aseprite MCP Tools
Provides programmatic interaction with Aseprite, including canvas operations, drawing tools, palette management, and batch processing. Allows creating sprites, managing layers and frames, drawing shapes, applying color palettes, and exporting to various formats.
Implements a Python-based MCP server for interacting with Aseprite, requiring Python 3.13+ to operate and offering Lua script generation for Aseprite operations.
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., "@Aseprite MCP Toolscreate a 64x64 sprite with the GameBoy palette"
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.
Aseprite MCP Tools v2.0
A powerful Python MCP (Model Context Protocol) server for programmatic interaction with Aseprite, featuring enhanced error handling, configuration management, batch processing, and more!
🚀 What's New in v2.0
🛡️ Comprehensive Error Handling: Custom exceptions with detailed, actionable error messages
🔧 Configuration Management: Pydantic-based settings with JSON/YAML support
📝 Advanced Logging: Structured logging with performance metrics
🎨 Palette Management: Create, apply, and extract color palettes
⚡ Batch Processing: Process multiple files in parallel
🏗️ Lua Script Builder: Clean, type-safe Lua script generation
🔒 Enhanced Security: Input validation and path traversal protection
🧪 Full Test Coverage: Comprehensive unit tests
Related MCP server: aseprite-mcp
📋 Features
Core Drawing Tools
Canvas Operations: Create sprites, add layers and frames
Drawing Tools: Pixels, lines, rectangles, circles, and fill operations
Export Tools: Export to various formats with scaling and layer support
New Palette Tools (v2.0)
Preset Palettes: GameBoy, NES, PICO-8, CGA, Monochrome, Sepia
Custom Palettes: Create and apply custom color schemes
Palette Extraction: Extract colors from existing images
Color Remapping: Replace colors throughout sprites
Batch Processing (v2.0)
Batch Resize: Resize multiple sprites maintaining aspect ratio
Batch Export: Convert multiple files to different formats
Batch Palette Apply: Apply palettes to multiple files
Custom Scripts: Run Lua scripts on file sets
🔧 Installation
Requirements
Python 3.13+
Aseprite (must be installed separately)
Claude Desktop Configuration
Using UV (Recommended)
{
"mcpServers": {
"aseprite": {
"command": "/opt/homebrew/bin/uv",
"args": [
"--directory",
"/path/to/aseprite-mcp",
"run",
"-m",
"aseprite_mcp"
],
"env": {
"ASEPRITE_PATH": "/path/to/aseprite"
}
}
}
}Using Python
{
"mcpServers": {
"aseprite": {
"command": "python",
"args": ["-m", "aseprite_mcp"],
"cwd": "/path/to/aseprite-mcp",
"env": {
"ASEPRITE_PATH": "/path/to/aseprite"
}
}
}
}Install Dependencies
pip install -r requirements.txt⚙️ Configuration
Environment Variables
export ASEPRITE_PATH="/Applications/Aseprite.app/Contents/MacOS/aseprite"
export ASEPRITE_MCP_LOG_LEVEL="INFO"Configuration File (config.json)
{
"aseprite_path": "/path/to/aseprite",
"canvas": {
"max_width": 10000,
"max_height": 10000
},
"batch": {
"max_parallel_jobs": 4,
"continue_on_error": true
},
"log_level": "INFO",
"security": {
"allowed_directories": ["/home/user/sprites"],
"max_file_size": 104857600
}
}Configuration File (config.yaml)
aseprite_path: /path/to/aseprite
canvas:
max_width: 10000
max_height: 10000
default_color_mode: RGBA
batch:
max_parallel_jobs: 4
continue_on_error: true
log_level: INFO
security:
allowed_directories:
- /home/user/sprites
max_file_size: 104857600📖 Usage Examples
Basic Drawing Operations
# Create a new sprite
await create_canvas(320, 240, "my_sprite.aseprite")
# Draw pixels
await draw_pixels("my_sprite.aseprite", [
{"x": 10, "y": 10, "color": "FF0000"}, # Red
{"x": 11, "y": 10, "color": "00FF00"}, # Green
{"x": 12, "y": 10, "color": "0000FF"} # Blue
])
# Draw shapes
await draw_rectangle("my_sprite.aseprite", 50, 50, 100, 80, "FFFF00", fill=True)
await draw_circle("my_sprite.aseprite", 160, 120, 30, "FF00FF", fill=False)
await draw_line("my_sprite.aseprite", 0, 0, 320, 240, "FFFFFF", thickness=2)
# Fill area
await fill_area("my_sprite.aseprite", 100, 100, "00FFFF", tolerance=10)Layer and Frame Management
# Add a new layer
await add_layer("my_sprite.aseprite", "Background")
# Add animation frames
await add_frame("my_sprite.aseprite", after_frame=0)Palette Operations
# Apply preset palette
await apply_preset_palette("my_sprite.aseprite", "gameboy")
# Available presets: gameboy, gameboy-pocket, nes, pico-8, cga, monochrome, sepia
# Create custom palette
await create_palette("my_sprite.aseprite", [
"264653", "2A9D8F", "E9C46A", "F4A261", "E76F51"
])
# Extract palette from image
await extract_palette_from_image("reference.png", max_colors=16)
# Get palette information
await get_palette_info("my_sprite.aseprite")
# Remap colors
await remap_colors("my_sprite.aseprite", {
"FF0000": "00FF00", # Red to Green
"0000FF": "FFFF00" # Blue to Yellow
})Export Operations
# Export single file
await export_sprite("my_sprite.aseprite", "output.png", scale=2.0)
# Export with frame range
await export_sprite("animation.aseprite", "frames.gif", frame_range="1-10")
# Export each layer separately
await export_layers("my_sprite.aseprite", "layers/", format="png")Batch Processing
# Resize multiple sprites
await batch_resize(
input_dir="sprites/",
output_dir="sprites_small/",
scale=0.5,
file_pattern="*.aseprite"
)
# Export batch to PNG
await batch_export(
input_dir="sprites/",
output_dir="exports/",
format="png",
scale=2.0
)
# Apply palette to multiple files
await batch_apply_palette(
input_dir="sprites/",
palette_file="my_palette.aseprite",
create_backup=True
)
# Run custom Lua script on multiple files
await batch_process_custom(
input_dir="sprites/",
lua_script="app.activeSprite:flatten()",
output_dir="flattened/"
)🏗️ Architecture
Project Structure
aseprite-mcp/
├── aseprite_mcp/
│ ├── core/
│ │ ├── commands.py # Aseprite command execution
│ │ ├── config.py # Configuration management
│ │ ├── exceptions.py # Custom exceptions
│ │ ├── logging.py # Logging system
│ │ ├── lua_builder.py # Lua script builder
│ │ └── validation.py # Input validation
│ └── tools/
│ ├── batch.py # Batch processing
│ ├── canvas.py # Canvas operations
│ ├── drawing.py # Drawing tools
│ ├── export.py # Export functions
│ └── palette.py # Palette management
├── tests/ # Unit tests
├── examples/ # Example scripts
└── config.example.yaml # Configuration exampleError Handling
try:
result = await create_canvas(-100, 200, "test.aseprite")
except ValidationError as e:
print(f"Validation failed: {e}")
except AsepriteError as e:
print(f"Aseprite error: {e}")Lua Script Builder
from aseprite_mcp.core.lua_builder import LuaBuilder
builder = LuaBuilder()
builder.create_sprite(200, 200)
builder.begin_transaction()
builder.set_color("FF0000")
builder.for_loop("i", 0, 10)
builder.draw_pixel("i * 10", "i * 10")
builder.end_loop()
builder.end_transaction()
builder.save_sprite("output.aseprite")
script = builder.build() # Returns clean Lua code🧪 Testing
Run all tests:
pytest tests/ -vRun specific test:
pytest tests/test_validation.py -vRun demo script:
python examples/demo_improvements.py📝 Logging
Logs include:
Operation tracking
Performance metrics
Error details with context
Structured JSON output (optional)
Example log:
2024-06-11 10:30:45 - aseprite_mcp - INFO - Operation: create_canvas
2024-06-11 10:30:45 - aseprite_mcp - INFO - Canvas created successfully
2024-06-11 10:30:45 - aseprite_mcp - INFO - Performance: create_canvas took 0.234s🤝 Contributing
Fork the repository
Create a feature branch
Follow the coding standards:
Use type hints
Add input validation
Include error handling
Write unit tests
Update documentation
Submit a pull request
📄 License
MIT License - see LICENSE file for details
🙏 Credits
Original implementation: Divyansh Singh
v2.0 improvements: Enhanced error handling, configuration, batch processing, and more
📚 Additional Resources
IMPROVEMENTS.md - Detailed v2.0 changes
Available Tools
19 toolsadd_frameB
Add a new frame to the Aseprite file.
Args: filename: Name of the Aseprite file to modify after_frame: Frame index after which to add the new frame (0-based, optional)
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| after_frame | No |
add_layerC
Add a new layer to the Aseprite file.
Args: filename: Name of the Aseprite file to modify layer_name: Name of the new layer
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| layer_name | Yes |
apply_preset_paletteA
Apply a predefined palette to an Aseprite file.
Args: filename: Name of the Aseprite file to modify preset: Preset palette name. Options: gameboy, gameboy-pocket, nes, pico-8, cga, monochrome, sepia
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| preset | Yes |
batch_apply_paletteC
Apply a palette to multiple Aseprite files.
Args: input_dir: Directory containing input files palette_file: Path to palette file or preset name file_pattern: File pattern to match (default: "*.aseprite") create_backup: Create backup of original files
| Name | Required | Description | Default |
|---|---|---|---|
| input_dir | Yes | ||
| palette_file | Yes | ||
| file_pattern | No | *.aseprite | |
| create_backup | No |
batch_exportB
Batch export multiple Aseprite files to another format.
Args: input_dir: Directory containing input files output_dir: Directory for exported files format: Export format (png, gif, jpg, etc.) scale: Export scale factor file_pattern: File pattern to match (default: "*.aseprite")
| Name | Required | Description | Default |
|---|---|---|---|
| input_dir | Yes | ||
| output_dir | Yes | ||
| format | No | png | |
| scale | No | ||
| file_pattern | No | *.aseprite |
batch_process_customB
Apply a custom Lua script to multiple Aseprite files.
Args: input_dir: Directory containing input files lua_script: Lua script to execute on each file output_dir: Optional output directory for modified files file_pattern: File pattern to match (default: "*.aseprite")
| Name | Required | Description | Default |
|---|---|---|---|
| input_dir | Yes | ||
| lua_script | Yes | ||
| output_dir | No | ||
| file_pattern | No | *.aseprite |
batch_resizeB
Batch resize multiple Aseprite files.
Args: input_dir: Directory containing input files output_dir: Directory for resized files width: Target width (optional) height: Target height (optional) scale: Scale factor (optional, alternative to width/height) maintain_aspect_ratio: Maintain aspect ratio when resizing file_pattern: File pattern to match (default: "*.aseprite")
| Name | Required | Description | Default |
|---|---|---|---|
| input_dir | Yes | ||
| output_dir | Yes | ||
| width | No | ||
| height | No | ||
| scale | No | ||
| maintain_aspect_ratio | No | ||
| file_pattern | No | *.aseprite |
create_canvasA
Create a new Aseprite canvas with specified dimensions.
Args: width: Width of the canvas in pixels height: Height of the canvas in pixels filename: Name of the output file (default: canvas.aseprite)
| Name | Required | Description | Default |
|---|---|---|---|
| width | Yes | ||
| height | Yes | ||
| filename | No | canvas.aseprite |
create_paletteB
Create or replace a palette in an Aseprite file.
Args: filename: Name of the Aseprite file to modify colors: List of hex color codes (e.g., ["FF0000", "00FF00", "0000FF"]) palette_name: Optional name for the palette
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| colors | Yes | ||
| palette_name | No |
draw_circleB
Draw a circle on the canvas.
Args: filename: Name of the Aseprite file to modify center_x: X coordinate of circle center center_y: Y coordinate of circle center radius: Radius of the circle in pixels color: Hex color code (default: "#000000") fill: Whether to fill the circle (default: False)
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| center_x | Yes | ||
| center_y | Yes | ||
| radius | Yes | ||
| color | No | #000000 | |
| fill | No |
draw_lineB
Draw a line on the canvas.
Args: filename: Name of the Aseprite file to modify x1: Starting x coordinate y1: Starting y coordinate x2: Ending x coordinate y2: Ending y coordinate color: Hex color code (default: "#000000") thickness: Line thickness in pixels (default: 1)
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| x1 | Yes | ||
| y1 | Yes | ||
| x2 | Yes | ||
| y2 | Yes | ||
| color | No | #000000 | |
| thickness | No |
draw_pixelsA
Draw pixels on the canvas with specified colors.
Args: filename: Name of the Aseprite file to modify pixels: List of pixel data, each containing: {"x": int, "y": int, "color": str} where color is a hex code like "#FF0000"
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| pixels | Yes |
draw_rectangleB
Draw a rectangle on the canvas.
Args: filename: Name of the Aseprite file to modify x: Top-left x coordinate y: Top-left y coordinate width: Width of the rectangle height: Height of the rectangle color: Hex color code (default: "#000000") fill: Whether to fill the rectangle (default: False)
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| x | Yes | ||
| y | Yes | ||
| width | Yes | ||
| height | Yes | ||
| color | No | #000000 | |
| fill | No |
export_layersA
Export each layer of the sprite as a separate file.
Args: filename: Name of the Aseprite file to export output_dir: Directory to save the exported layers format: Output format (default: "png") scale: Export scale factor (default: 1.0)
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| output_dir | Yes | ||
| format | No | png | |
| scale | No |
export_spriteB
Export the Aseprite file to another format.
Args: filename: Name of the Aseprite file to export output_filename: Name of the output file format: Output format (default: inferred from extension, can be "png", "gif", "jpg", etc.) scale: Export scale factor (default: 1.0) frame_range: Frame range to export (e.g., "1-5" or "2,4,6")
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| output_filename | Yes | ||
| format | No | ||
| scale | No | ||
| frame_range | No |
extract_palette_from_imageC
Extract a color palette from an existing image.
Args: filename: Name of the Aseprite file to extract palette from max_colors: Maximum number of colors to extract (default: 16) output_filename: Optional filename to save the palette
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| max_colors | No | ||
| output_filename | No |
fill_areaC
Fill an area with color using the paint bucket tool.
Args: filename: Name of the Aseprite file to modify x: X coordinate to fill from y: Y coordinate to fill from color: Hex color code (default: "#000000") tolerance: Tolerance for color matching (0-255, default: 0)
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| x | Yes | ||
| y | Yes | ||
| color | No | #000000 | |
| tolerance | No |
get_palette_infoC
Get information about the current palette in an Aseprite file.
Args: filename: Name of the Aseprite file to inspect
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes |
remap_colorsB
Remap colors in an Aseprite file.
Args: filename: Name of the Aseprite file to modify color_map: Dictionary mapping old colors to new colors (e.g., {"FF0000": "00FF00"})
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| color_map | Yes |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
19 tool updates
v0.1.0- First observed
add_frame - First observed
add_layer - First observed
apply_preset_palette - First observed
batch_apply_palette - First observed
batch_export - First observed
batch_process_custom - First observed
batch_resize - First observed
create_canvas - First observed
create_palette - First observed
draw_circle - First observed
draw_line - First observed
draw_pixels - First observed
draw_rectangle - First observed
export_layers - First observed
export_sprite - First observed
extract_palette_from_image - First observed
fill_area - First observed
get_palette_info - First observed
remap_colors
TDQS
Scored across 19 tools
Most tools have distinct purposes targeting specific Aseprite operations like drawing shapes, palette management, or batch processing, but some overlap exists between 'export_sprite' and 'batch_export' which could cause confusion in selection. Descriptions help clarify, but the boundary between single-file and batch export is not entirely clear from names alone.
Tool names consistently follow a verb_noun pattern throughout, such as 'add_frame', 'draw_circle', and 'batch_export', with no deviations in style. This predictability makes it easy for agents to understand and navigate the toolset without confusion from mixed conventions.
With 19 tools, the count is slightly high but reasonable for a comprehensive Aseprite manipulation server, covering operations from creation to export and batch processing. It feels well-scoped for the domain, though it borders on being heavy, which could overwhelm agents but is justified by the functionality offered.
The toolset provides complete coverage for Aseprite file manipulation, including CRUD-like operations (e.g., create_canvas, add_frame/layer), drawing functions, palette management, and batch processing. No obvious gaps exist; agents can handle full workflows from sprite creation to export and modification without dead ends.
Maintenance
Related MCP Connectors
Generate authentic pixel art - sprites, animations, and tilesets - from any MCP client
Game-dev sprite tools: PNG/GIF to spritesheet, split, trim, animate. OAuth-authenticated MCP server.
Generate pixel art sprites, animations, 8-direction rotations and palettes for games.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for programmatically creating and editing Aseprite sprites, enabling AI agents to draw, manage layers and frames, and iterate until the desired result is achieved.113 npmMIT
- FlicenseBqualityCmaintenanceMCP server for controlling Aseprite from Codex, wrapping its native CLI and Lua scripting to enable pixel art creation, sprite editing, animation, file inspection, and export.8-
- AlicenseBqualityDmaintenanceMCP server for Aseprite — create, edit, and export pixel art sprites, animations, and sprite sheets from any AI assistant.43113 npm8MIT
- AlicenseCqualityBmaintenanceA Python MCP server that gives AI assistants full control over Aseprite for creating pixel art and animated sprites. It provides 104 tools across 17 categories for canvas, drawing, layers, animation, palettes, effects, and more.100MIT