Skip to main content
Glama

aimusicvideogen: free music video tools (CLI + MCP server)

npm license

Small, local tools for musicians and AI music creators who are making a music video for a song:

  • Analyze a song: BPM, musical key, Camelot code, beat and bar length, and the most energetic 15 s and 30 s windows (usually the chorus or drop, the clip you want for TikTok, Reels and Shorts).

  • Plan beat-synced shots: a shot list where every cut lands on a bar line, with a visual idea for each section.

  • Make a Spotify Canvas: turn a video clip or a still image into a silent 1080x1920 MP4 of 3 to 8 seconds.

  • Platform specs: aspect ratio, resolution, length and format for TikTok, Instagram Reels, YouTube Shorts, YouTube and Spotify Canvas.

Everything runs on your machine with ffmpeg. No account, no API key, nothing is uploaded.

It also runs as an MCP server, so Claude, Cursor, Windsurf and other MCP clients can analyze your songs and plan videos for you.

Want the whole video made for you? AIMusicVideoGen turns a song and one photo of the singer into a lip-synced, beat-cut music video. This repo is the free, open-source toolbox that grew out of it.

Install

Requires Node.js 18+ and ffmpeg (brew install ffmpeg, winget install ffmpeg, sudo apt install ffmpeg). If ffmpeg is not on your PATH, set FFMPEG_PATH.

npm install -g aimusicvideogen
# or run without installing
npx aimusicvideogen --help

Related MCP server: Sonicmatch

CLI

aimusicvideogen analyze song.mp3
Duration    40.4 s (19 bars)
Tempo       119 BPM  (half 59.3, double 237)
Key         Bb major  (Camelot 6B, relative G minor)
Beat / bar  0.506 s / 2.025 s
Best 15 s   21.5s - 36.5s
Best 30 s   6.5s - 36.5s
# Shot list from a song file, or from numbers
aimusicvideogen plan song.mp3
aimusicvideogen plan --bpm 100 --duration 200 --offset 0.4

# Spotify Canvas from a video (cut 8 s from 0:12) or from an image (slow seamless zoom)
aimusicvideogen canvas clip.mp4 --start 12 --length 8
aimusicvideogen canvas cover.jpg --length 6 --out canvas.mp4

# Specs
aimusicvideogen specs spotify-canvas
aimusicvideogen specs            # all platforms

# Any command: --json for machine-readable output

MCP server

Add it to your MCP client. For Claude Desktop (claude_desktop_config.json), Cursor (.cursor/mcp.json) and most others:

{
  "mcpServers": {
    "aimusicvideogen": {
      "command": "npx",
      "args": ["-y", "aimusicvideogen", "mcp"]
    }
  }
}

Claude Code:

claude mcp add aimusicvideogen -- npx -y aimusicvideogen mcp

Tools

Tool

What it does

analyze_song

BPM, key, Camelot, bar length, duration, best 15 s / 30 s clip of a local audio or video file

plan_music_video

Beat-synced shot list from BPM and duration, optional song structure in bars

make_spotify_canvas

Silent 1080x1920 MP4 (3-8 s) from a local video or image

video_specs

Upload specs by platform

create_ai_music_video

Steps and link to generate a full lip-synced video from a song and one photo on aimusicvideogen.com

Example prompts:

  • "Analyze ~/Music/demo.mp3 and tell me which 15 seconds to use for TikTok."

  • "Plan a 16:9 music video for this song with a cut on every bar in the chorus."

  • "Make a Spotify Canvas from the first 6 seconds of ~/Videos/teaser.mov."

How it works

  • Tempo: spectral-flux onset envelope, autocorrelation, with the half and double tempo scored together and a mild preference for 120 BPM to settle octave errors. Reported between 70 and 180 BPM by default (minTempo / maxTempo to change).

  • Key: chromagram from a short-time FFT, matched against the Krumhansl-Kessler major and minor profiles.

  • Highlight: the loudest sustained window by RMS energy.

These are estimates. Check the BPM against a tap tempo if a song has tempo changes or a loose groove: free tap tempo, BPM and key finder in the browser.

License

MIT

Available Tools

5 tools
analyze_songAnalyze songA

Detect the BPM (tempo), musical key, Camelot code, bar length and duration of a local audio or video file, and find the most energetic 15 s and 30 s windows (usually the chorus or drop, good clips for TikTok, Reels and Shorts). Runs locally with ffmpeg.

Inputs: path (required), maxTempo, minTempo.

create_ai_music_videoCreate an AI music video onlineA

How to turn a song and one photo of the singer into a finished, lip-synced, beat-cut music video with AIMusicVideoGen (web app, paid credits). Returns the link and the steps; it does not upload anything.

Inputs: no named parameters.

make_spotify_canvasMake Spotify CanvasA

Turn a local video clip or image into a Spotify Canvas: silent 1080x1920 9:16 MP4, 3-8 seconds. Videos are cut from start and centre-cropped; images get a slow seamless zoom loop.

Inputs: input (required), start, length, output.

plan_music_videoPlan beat-synced shotsA

Build a shot list for a music video where every cut lands on a bar line, with a visual idea per section. Needs only the BPM and duration (get them from analyze_song). Optionally pass the song structure as sections in bars.

Inputs: bpm (required), durationSeconds (required), sections, beatsPerBar, +1 more.

video_specsMusic video specs by platformA

Aspect ratio, resolution, length and format rules for music videos and loops. Platforms: spotify-canvas, tiktok, instagram-reels, youtube-shorts, youtube.

Inputs: platform.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 5 tools

    Disambiguation4/5

    Each tool maps to a distinct stage: analysis (analyze_song), planning (plan_music_video), spec lookup (video_specs), and two creation paths (make_spotify_canvas, create_ai_music_video). The only mild friction is between the two creation tools, since one actually renders a file while the other only returns instructions and a link, but the descriptions make the distinction clear.

    Naming Consistency4/5

    Four tools follow a clean verb_noun pattern (analyze_song, plan_music_video, make_spotify_canvas, create_ai_music_video). The lone outlier is video_specs, a bare noun, which is a minor deviation from an otherwise predictable convention.

    Tool Count5/5

    Five tools is well-scoped for a focused music-video pipeline, with each tool earning its place across analysis, planning, specs, and generation. Nothing feels redundant or padded.

    Completeness4/5

    The surface covers a reasonable end-to-end flow: analyze a song, plan cuts, look up platform specs, and produce a Spotify Canvas or kick off full AI video generation. The main gap is that full video rendering is delegated to an external web app rather than produced locally, leaving a partial dead end.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      A
      maintenance
      Analyzes video footage to rank license-safe, royalty-free or user-owned background music, returning a 12–20s hook window, beat/cut suggestions, and an ffmpeg ducking and mix spec for agents and editors. Every recommendation prints its license and attribution, and it never auto-recommends non-commercial tracks.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Watches video footage or URLs to analyze mood, pace, speech, and scene cuts, then returns a shortlist of license-safe BGM tracks with license and attribution text, a 12–20s hook window, and an ffmpeg ducking/mix spec. Runs locally via stdio or HTTP without API keys, with optional catalogs and brand kits for agents and video editors.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to edit video locally through FFmpeg: probing media, validating and previewing JSON edit projects, rendering short-form clips with captions, reframing, transitions and ducked music. Also analyses existing videos and applies or saves reusable format templates, without cloud services or API keys.
      1
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables local, evidence-led analysis of a master recording into inspectable stems, timing, beats, harmony, lyrics, MIDI and sonic evidence, then finds complete-bar loopable sections for Shorts and other short-form video. Results stay traceable through source hashes, manifests, JSON/TSV/NPZ artifacts and portable Sonic Visualiser sessions, and it can run as a CLI, Python library, web service, container or MCP plugin.
      172 PyPI
      MIT