Skip to main content

Clip.A.Canvas MCP server — render HTML/CSS/JS animations to MP4 via MCP tools

Project description

Clip.A.Canvas MCP Server

A universal MCP (Model Context Protocol) server that exposes Clip.A.Canvas HTML-to-video rendering as an MCP tool. Works with any STDIO-based MCP client.

Features

  • Universal MCP toolrender_video and render_video_to_file exposed via the MCP protocol
  • Works everywhere — Claude Desktop, Codex, Gemini CLI, Qwen Coder, and any MCP-compatible AI coding tool
  • Local rendering — no upload, no cloud; Chromium + FFmpeg run on your machine
  • Base64 or file output — return video as base64 string or save directly to a path

Installation

Public one-command MCP install

After this mcp/ package is pushed to GitHub, users can add it directly from the repo without cloning Clip.A.Canvas:

gemini mcp add clipacanvas -- uvx --from "clipacanvas-mcp @ git+https://github.com/mechreaper007x/ClipACanvas.git#subdirectory=mcp" clipacanvas-mcp
codex mcp add clipacanvas -- uvx --from "clipacanvas-mcp @ git+https://github.com/mechreaper007x/ClipACanvas.git#subdirectory=mcp" clipacanvas-mcp

Claude Code on Windows may need the same cmd /c wrapper used during local testing:

claude mcp add -s user clipacanvas -- cmd /c uvx --from "clipacanvas-mcp @ git+https://github.com/mechreaper007x/ClipACanvas.git#subdirectory=mcp" clipacanvas-mcp

After publishing to PyPI, the shorter form works:

gemini mcp add clipacanvas -- uvx --from clipacanvas-mcp clipacanvas-mcp
codex mcp add clipacanvas -- uvx --from clipacanvas-mcp clipacanvas-mcp
claude mcp add -s user clipacanvas -- cmd /c uvx --from clipacanvas-mcp clipacanvas-mcp

From source (editable)

cd code2video/mcp
pip install -e .

As a distributable package

pip install clipacanvas-mcp
# or
uvx --from clipacanvas-mcp clipacanvas-mcp

uvx handles the Python package environment. On first render, the MCP package will also install Playwright Chromium automatically if it is missing.

Configuration

Environment variables (all optional):

Variable Default Description
CLIPACANVAS_FFMPEG_EXE auto-detect Path to FFmpeg executable
CLIPACANVAS_BROWSERS_PATH auto-detect Path to Playwright browsers
CLIPACANVAS_MAX_DURATION 12 Max render duration in seconds
CLIPACANVAS_DEFAULT_WIDTH 540 Default video width
CLIPACANVAS_DEFAULT_HEIGHT 960 Default video height
CLIPACANVAS_DEFAULT_BITRATE 5M Default FFmpeg bitrate
CLIPACANVAS_DEFAULT_FRAME_RATE 60 Default frame rate

MCP Tools

render_video

Render HTML/CSS/JS to MP4, returned as base64.

Arguments:

{
  "code": "<!DOCTYPE html><html>...</html>",
  "width": 540,
  "height": 960,
  "bitrate": "5M",
  "frame_rate": 60,
  "max_duration": 12
}

Returns: Text content with video metadata and base64-encoded MP4 data.

render_video_to_file

Same as above but saves the MP4 directly to output_path.

Arguments:

{
  "code": "<!DOCTYPE html><html>...</html>",
  "output_path": "/absolute/path/to/video.mp4",
  "width": 540,
  "height": 960
}

Usage in AI Coding Tools

Claude Code

For this local repo checkout:

cd code2video/mcp
pip install -e .
claude mcp add -s local clipacanvas -- cmd /c python -m clipacanvas_mcp.server

The cmd /c wrapper is useful on Windows because Claude Code's MCP health check can fail to resolve the same Python command that works in an interactive PowerShell session.

Claude Desktop

Add to your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "clipacanvas": {
      "command": "python",
      "args": ["-m", "clipacanvas_mcp.server"]
    }
  }
}

Then restart Claude Desktop. The render_video and render_video_to_file tools will appear in the tool list.

Codex CLI

For this local repo checkout:

cd code2video/mcp
pip install -e .
codex mcp add clipacanvas -- python -m clipacanvas_mcp.server

Gemini CLI (Google)

For this local repo checkout, install the server in editable mode first:

cd code2video/mcp
pip install -e .
gemini mcp add clipacanvas -- python -m clipacanvas_mcp.server

Use the uvx command only after clipacanvas-mcp is published to a package index and uvx is installed:

gemini mcp add clipacanvas -- uvx --from clipacanvas-mcp clipacanvas-mcp

Qwen Coder (Alibaba)

Add to Qwen Coder's MCP configuration:

{
  "mcpServers": {
    "clipacanvas": {
      "command": "uvx",
      "args": ["--from", "clipacanvas-mcp", "clipacanvas-mcp"]
    }
  }
}

Any STDIO MCP Client

# Direct run
uvx --from clipacanvas-mcp clipacanvas-mcp

# Or after pip install
clipacanvas-mcp

Testing the Server Manually

# Start the server
python -m clipacanvas_mcp.server

# Send initialize
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | clipacanvas-mcp

# List tools
echo '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' | clipacanvas-mcp

Requirements

  • Python 3.10+
  • FFmpeg (installed system-wide, via imageio-ffmpeg, or set CLIPACANVAS_FFMPEG_EXE)
  • Playwright Chromium: installed automatically on first render if missing; run python -m playwright install chromium manually only if you want to preinstall it

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

clipacanvas_mcp-1.0.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

clipacanvas_mcp-1.0.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file clipacanvas_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: clipacanvas_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for clipacanvas_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ab63f63d860d099417a711e8e63bb87dfa06d0a0dcaabb9445922a23866fc262
MD5 50bf578f8be3a24cbfb6fa84c1da6614
BLAKE2b-256 1e038cea6d2701d495ad0fee177567b23b45e7d41058e8934e657cb305f414ba

See more details on using hashes here.

File details

Details for the file clipacanvas_mcp-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for clipacanvas_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b27b34a3332de6ed1a3ff1d453dfc54dbef1441742d7e5b93e1eabb3462ca7e7
MD5 06f495d9409e530b47d6c2254e327c60
BLAKE2b-256 5ce7c4421c20e5433058ae6ce71332c20b1b9d48bab35531bb1813a3e8caac27

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