An MCP server for creating svg animations.
Project description
MCP SVG Animator
An MCP server for creating animated SVG diagrams. You can create a diagram from text input, photos of sketches and YAML specifications.
You don't normally need to use YAML; just tell Claude code what you want, upload photos of sketches, and then iterate until you've got what you want.
You can see some sample inputs and outputs on the Demo Page
Features
- Create and iterate on your requirements using natural language and/or rough diagrams
- Multiple shape types - circle, rectangle, line, text, path, group
- Path segments - Build curves with move_to, line_to, cubic_bezier, quadratic_bezier, arc
- SMIL animations - Animate attributes and transforms
- Reusable definitions - Define once, use many times
- Library imports - Share definitions across diagrams
- Relative positioning - Reference other elements' positions
- Video export - Record animations to .webm video
Installation
pip install mcp-svg-animator
# Install Playwright browsers (for video generation)
playwright install chromium
Usage with Claude Code
Register the MCP server globally:
claude mcp add --scope user svg-animator -- python -m mcp_svg_animator
Then in any Claude Code session, ask Claude code to create animations:
"Create an animated SVG of a red circle that pulses"
See docs/usage.md for more details.
MCP Tools
You don't need to explicitly invoke these. Ask Claude code to create the animation you describe, and it will invoke the relevant tools.
| Tool | Description |
|---|---|
create_svg_from_yaml |
Generate SVG from YAML specification |
create_animation_video |
Record SVG animation to .webm video |
Development
# Clone the repository
git clone https://github.com/romilly/mcp-svg-animator.git
cd mcp-svg-animator
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
pip install -r requirements-test.txt
# Install Playwright browsers (for video generation)
playwright install chromium
# Run tests
pytest
# Type checking
pyright src/
Examples
See the examples/ directory for sample YAML files and generated SVGs:
demo.yaml- Basic shapesstick_figure.yaml- Static stick figurestick_figure_waving.yaml- Animated wavingcurves.yaml- Bezier curves and arcsmeeting.yaml- Two figures, one walks to meet the other
Acknowledgments
This project uses the following open source packages:
- MCP - Model Context Protocol SDK (MIT)
- Pydantic - Data validation (MIT)
- drawsvg - SVG generation (MIT)
- PyYAML - YAML parsing (MIT)
- Playwright - Video recording (Apache 2.0)
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_svg_animator-0.2.1.tar.gz.
File metadata
- Download URL: mcp_svg_animator-0.2.1.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75697ffdbc8afc0741cc3c2c64462bbe6309fb2ef3ac123dbcd6abf141d3394f
|
|
| MD5 |
49699298ea0969c8ddf67c9013d98bb1
|
|
| BLAKE2b-256 |
2b4183e06c39365045511df0606d917e5577e8dd5da983c7ef11eed55a36d0b0
|
File details
Details for the file mcp_svg_animator-0.2.1-py2.py3-none-any.whl.
File metadata
- Download URL: mcp_svg_animator-0.2.1-py2.py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0d3ab68ba29656c9e6923270b21c467cee17ca73982cb9d7fa7c63c426e547f
|
|
| MD5 |
8679ef38fb7270e07585a3a363f50a55
|
|
| BLAKE2b-256 |
affb096bb16ce6942a9d3b4376d6d9bf5faf776af76ecfbe37cac56c4e391443
|