Skip to main content

MCP server for generating SPINE2D animations from PSD files using natural language

Project description

SPINE2D Animation MCP Server

This Model Context Protocol (MCP) server provides tools for creating SPINE2D animations from PSD character files using natural language descriptions.

Overview

The SPINE2D Animation MCP server allows you to:

  1. Import PSD character files
  2. Automatically rig characters
  3. Generate animations using natural language descriptions
  4. Preview animations
  5. Export animations in various formats

Requirements

  • Python 3.6+
  • Required Python packages (installed automatically):
    • Flask
    • Pydantic
    • Pillow
    • PSD-Tools
    • OpenAI (for natural language processing)
    • Requests
    • Python-dotenv

Installation

  1. Clone this repository
  2. Run the installation script:
./install.sh

The installation script will:

  • Create necessary storage directories
  • Install Python dependencies
  • Configure MCP settings for VS Code
  • Optionally configure MCP settings for Claude Desktop

Usage

After installation, restart VS Code and/or Claude. You can then use the following tools through the MCP server:

Import PSD Character

Upload and process a PSD file:

Use: "Import my character from character.psd"

Parameters:

  • file_path: Path to the PSD file

Setup Character

Automatically rig a character that has been imported:

Use: "Set up rigging for my character"

Parameters:

  • character_id: Character ID from import_psd

Generate Animation

Create an animation from a text description:

Use: "Create a happy waving animation for my character"
Use: "Make my character jump with excitement"
Use: "Animate my character to run scared with sparkle effects"

Parameters:

  • character_id: Character ID
  • description: Animation description (e.g., "wave happily")

Preview Animation

Get a preview of the animation:

Use: "Show me a preview of the waving animation"

Parameters:

  • character_id: Character ID
  • animation_id: Animation ID

Export Animation

Export the final animation:

Use: "Export the jumping animation as a GIF"

Parameters:

  • character_id: Character ID
  • animation_id: Animation ID
  • format: Export format (json, png, gif)

Project Structure

spine2d-animation-mcp/
├── README.md             # This file
├── requirements.txt      # Python dependencies
├── install.sh            # Installation script
├── src/
│   ├── main.py           # Entry point
│   ├── server.py         # MCP server implementation
│   ├── psd_parser.py     # PSD parsing module
│   ├── animation_generator.py  # Animation generation module
│   └── spine2d_integration.py  # SPINE2D integration module
└── storage/              # Created during installation
    ├── characters/       # Imported character data
    ├── animations/       # Generated animations
    ├── rigs/             # Character rigs
    └── exports/          # Exported animations

How It Works

  1. PSD Import: The server parses a PSD file, extracts layers, and organizes them into a character structure.
  2. Character Rigging: The server analyzes the character structure and automatically creates bones, IK constraints, and skin attachments.
  3. Animation Generation: Natural language descriptions are parsed to extract animation type, emotion, and intensity. The server then applies these to animation templates.
  4. Animation Preview: The server generates a preview of the animation in GIF format.
  5. Animation Export: The server exports the animation in the requested format (JSON, PNG, or GIF).

Limitations

  1. The automatic rigging system is based on layer names and structure, which may require specific naming conventions for optimal results.
  2. The animation templates are predefined, so complex custom animations may require manual adjustment.
  3. The natural language processing is simplified in this implementation and may not capture all nuances of complex descriptions.

Future Improvements

  1. Improved natural language understanding using more advanced LLM integration
  2. More sophisticated automatic rigging with bone placement based on image analysis
  3. Expanded library of animation templates
  4. Real-time preview rendering
  5. More export formats and options

Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_naosen_spine2d_animation_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: iflow_mcp_naosen_spine2d_animation_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_naosen_spine2d_animation_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 10547721e471fb5eff342165fc650b64962130fe8dee23bce321a7cce6ea4106
MD5 d28ec6d9b286a70f4eac92638173ab60
BLAKE2b-256 43b98a15afa9e2147a0a6692621e61b2bee82f96778e52d75c170be079bcc922

See more details on using hashes here.

File details

Details for the file iflow_mcp_naosen_spine2d_animation_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_naosen_spine2d_animation_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_naosen_spine2d_animation_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 198d29bcef0ea7b1df2cef4eecd1f9c0a6f0ab0c014959b000871a7240b27d7f
MD5 93951bc57394ed5f5a08297ae1655c2e
BLAKE2b-256 79125e2343f1df0ceb17c82a04015b1c40ad7c6af40aca6c5983bb48934ddee9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page