v0.4.0 LIVE ON PYPI & GITHUB

Turn AI Prompts Into Traditional 2D Animation

A lightweight Model Context Protocol (MCP) server that empowers Claude Desktop, Google Antigravity, Cursor, and autonomous agents to create, inspect, edit, and render hand-drawn Pencil2D animations headlessly with 2-bone Inverse Kinematics (IK), bipedal gait cycles, and Sakuga anime combat physics.

$ pip install pencil2d-mcp

Real Hand-Drawn Animations Generated via MCP

24 FPS Fluid Stickman Kinematics Animation

24 FPS Fluid Stickman Kinematics

Full bipedal locomotion engine featuring analytic 2-bone Inverse Kinematics (IK), grounded stance foot locking (zero ice-skating), swing knee lift arcs, Wing Chun circular hand deflections, 180° roundhouse kick, and parabolic backflip with squash-cushion landing.

2-Bone IK 24 FPS 240 Frames (10.0s) Grounded Gait Hand Deflections No Teleporting
24 FPS Ultimate Sakuga Anime Stickman Fight Animation

24 FPS Ultimate Sakuga Anime Fight

High-octane martial arts combat featuring Flaming Nichirin Katana vs Twin Lightning Daggers/Shurikens, destructible ancient stone pillars, mid-air sliced projectile boulder, inverted monochrome Sakuga impact frames, and camera shake.

Sakuga FX 24 FPS Destructible Objects Weapon Combat Impact Frames Camera Shake
Starlit Campfire & Shooting Stars Animation

Starlit Campfire & Shooting Stars

Tranquil Makoto Shinkai / Studio Ghibli-inspired wilderness night scene with dynamic shooting stars streaking across the sapphire Milky Way, fluid campfire flame harmonics, and floating particle embers in an infinite seamless loop.

4 Raster Layers 12 FPS 48 Frames Infinite Loop Shooting Stars FX
Traditional 2D Pencil Test Bouncing Ball Animation

Classic 2D Pencil Test: Bouncing Ball

Authentic hand-drawn animator's line test on lightbox paper with 2B graphite contour strokes, traditional curved cross-hatching, non-photo blue Col-Erase construction circles, sketched impact accent lines, and volume-preserving squash & stretch in a seamless infinite loop.

4 Raster Layers 12 FPS 48 Frames Infinite Loop Pencil Sketch FX Squash & Stretch

Built for Autonomous Animation Pipelines

⚡ Zero Heavy Dependencies

Pure Python implementation utilizing standard library and Pillow. No heavyweight GUI frameworks required to read, write, and manipulate .pclx archives.

🎬 Headless Movie Exporter

Uses the Pencil2D AppImage CLI to render animations directly into MP4 (H.264), animated GIF, WebM, and transparent PNG sequences without opening windows.

🗂️ Dynamic Multi-Layer Hierarchy

Full control over Bitmap layers, Vector layers, Sound tracks, and Camera viewports. Non-destructively organize facial expressions, line art, and colors.

📦 Bulk Frame Import

Import dozens or hundreds of frame images from folders or structured arrays in a single low-latency tool call, eliminating single-frame bottlenecks.

🔊 Audio Synchronization

Embed WAV/MP3 voiceovers and audio tracks directly onto sound layers aligned to exact timeline keyframe timings.

🩺 Integrity & Diagnostics

Comprehensive project validator that inspects XML syntax, checks for missing PNG asset references, and catches frame gaps before rendering.

🏃 2-Bone IK & Grounded Gait

Analytic trigonometry calculates exact knee and elbow flexion with reach clamping. Ground-locked stance feet eliminate sliding and continuous cubic easing removes all teleporting.

👁️ Visual Look Inspection

Generates multi-frame contact sheet filmstrips and onion-skinned preview sheets on demand via pencil2d_look so AI agents visually verify animation quality headlessly.

17 Model Context Protocol Tools

One Config to Connect Your Agent

claude_desktop_config.json
{
  "mcpServers": {
    "pencil2d": {
      "command": "pencil2d-mcp",
      "args": ["serve"],
      "env": {
        "PENCIL2D_APPIMAGE": "/path/to/pencil2d-linux-amd64-v0.7.2.AppImage"
      }
    }
  }
}
👋 Developer Note from chriz-3656

This is my first time building an MCP server as a 20-year-old solo developer! If you encounter any bugs, issues, or have feature ideas, please reach out directly at chrizmonsaji@proton.me or open an issue on GitHub. Your feedback and support mean everything!