ES

ext-sakamoro/asepritemcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

27 stars 5 forks 质量 67 趋势 11MIT

Aseprite MCP 服务器(Python)——通过 Claude/LLM 实现编程像素艺术。调色板 / 批处理 / Lua 脚本构建器 / 错误处理 / 测试覆盖。

概览

一个强大的 Python MCP(模型上下文协议)服务器,用于与 Aseprite 进行程序化交互,具备增强的错误处理、配置管理、批处理等功能! - : 自定义异常,带有详细且可操作的错误消息 - : 基于 pydantic 的设置,支持 JSON/YAML - : 结构化日志及性能指标 - : 创建、应用和提取色彩调色板 - : 并行处理多个文件 - : 干净且类型安全的 Lua 脚本生成 - : 输入验证和路径穿越保护 - : 全面的单元测试 - : 创建精灵,添加图层和帧 - : 像素、线条、矩形、圆圈和填充操作 - : 导出为支持缩放和图层的各种格式 - : GameBoy、NES、PICO-8、CGA、单色、棕褐色 - : 创建并应用自定义配色方案 - : 从现有图像中提取颜色 - : 替换精灵图中的颜色 - : 调整多个精灵大小并保持宽高比 - : 将多个文件转换为不同格式 - :...

概述(AI 翻译)

日本語版はこちら |macOS 设置指南

一个强大的 Python MCP(模型上下文协议)服务器,用于与 Aseprite 进行程序化交互,具备增强的错误处理、配置管理、批处理等功能!

🚀 v2.0 有什么新内容

  • ** 🛡️ 全面错误处理**:带有详细且可操作错误信息的自定义异常
  • ** 🔧 配置管理**:基于Pydantic的设置,支持JSON/YAML数据
  • ** 📝 高级日志**:带有性能指标的结构化日志
  • ** 🎨 调色板管理**:创建、应用和提取调色板
  • ** ⚡ 批处理**:并行处理多个文件
  • ** 🏗️ Lua 脚本构建器**:干净、类型安全的 Lua 脚本生成
  • ** 🔒 增强安全性**:输入验证和路径穿越保护
  • ** 🧪 全面测试覆盖**:综合单元测试

📋 特色

核心绘图工具

  • 画布操作:创建精灵,添加图层和框架
  • 绘图工具:像素、线条、矩形、圆圈和填充操作
  • 导出工具:支持缩放和图层的多种格式导出

新调色板工具(v2.0)

  • 预设调色板:GameBoy、NES、PICO-8、CGA、单色、棕褐色

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Aseprite MCP Tools v2.0

日本語版はこちら | macOS Setup Guide

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

📋 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

{
  "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"],
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "aseprite": { "command": "/opt/homebrew/bin/uv", "args": [ "--directory", "/path/to/aseprite-mcp", "run", "-m", "aseprite_mcp" ], "env": { "ASEPRITE_PATH": "/path/to/aseprite" } } } }