Skip to main content
Glama

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

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 github:aimusicvideogen-com/music-video-cli
# or run without installing
npx github:aimusicvideogen-com/music-video-cli --help

Related MCP server: Audio Sonic MCP

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", "github:aimusicvideogen-com/music-video-cli", "mcp"]
    }
  }
}

Claude Code:

claude mcp add aimusicvideogen -- npx -y github:aimusicvideogen-com/music-video-cli 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to an MP3, WAV, M4A, FLAC, OGG or video file
maxTempoNoHighest BPM to report (default 180)
minTempoNoLowest BPM to report (default 70)

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It does disclose one meaningful behavioral trait — 'Runs locally with ffmpeg' — implying no upload/auth and a local dependency, but it omits whether any files are modified, how long analysis takes, limits on file size/length, and failure behavior for unsupported media.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence stating the verb and outputs, with no filler or repetition. The long parenthetical about TikTok/Reels/Shorts is slightly over-stuffed but contributes real intent information, so only minor trimming is warranted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description usefully enumerates the returned fields (BPM, key, Camelot, bar length, duration, energetic windows), which is exactly what an agent needs to decide whether to call it. What remains missing is behavior for edge cases — unsupported formats, very long videos, or analysis runtimes — and it has no annotation support to lean on.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents path, maxTempo and minTempo with defaults. The description adds no parameter-level detail (it never mentions the tempo range knobs), so it does not exceed the baseline of 3 when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a precise verb (detect/analyze) and resource (local audio or video file) and enumerates the concrete outputs: BPM, key, Camelot code, bar length, duration, and energetic windows. It is unmistakably distinct from the sibling creation tools (plan_music_video, create_ai_music_video), but it never names or contrasts with them, so sibling differentiation is implicit rather than explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the mention of 'good clips for TikTok, Reels and Shorts' hints that this analysis feeds downstream clip/video creation, but there is no explicit statement of when to call this versus alternatives or any prerequisite guidance. An agent can infer the context but must guess at exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description does real work: it discloses a paid-credit cost model, that the tool is a web app, that it returns the link and steps, and — importantly — that it does not upload anything, bounding side effects. It omits expected latency or failure/retry behavior, but the cost and side-effect disclosures exceed the norm.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One dense sentence with the outcome, provider, cost, and side-effect constraint front-loaded and no padding. It is slightly run-on, but every clause carries information an agent needs.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool with no output schema, the description covers what it produces (link and steps) and the key constraint (no upload, paid credits). Enough for an agent to decide and call it; only the pipeline relationship to sibling tools is left implicit.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Parameter count is zero, so there are no parameters to document; the baseline for a no-param tool is 4. The description correctly does not invent any input arguments.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a concrete verb and outcome: turning a song plus one photo into a finished, lip-synced, beat-cut music video via AIMusicVideoGen. It implies this is the creation step relative to siblings like analyze_song and plan_music_video, though it never names or contrasts those alternatives explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage context is implied rather than stated: the web-app framing, 'paid credits', and the note that it 'does not upload anything' hint at prerequisites. There is no explicit when-to-use versus plan_music_video or analyze_song, so the agent must infer the ordering of the pipeline.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
inputYesAbsolute path to a video (MP4, MOV, WEBM) or image (JPG, PNG, WEBP)
startNoStart time in seconds for videos (default 0)
lengthNoLength in seconds, 3 to 8 (default 8)
outputNoWhere to write the MP4 (default: next to the input)

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does well: it discloses the output is silent, the exact resolution/aspect, the 3-8s duration band, that videos are cut from `start` and centre-cropped, and that images get a slow seamless zoom loop. It does not mention dependency on ffmpeg-like tooling or error behavior for unsupported inputs, but the transformation semantics are unusually well surfaced.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, zero filler, and the resulting artifact specification is front-loaded before the input-handling detail. Every clause carries information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter, 1-required tool with no output schema or annotations, the description covers input types, output format, duration constraints, and divergent processing for video vs image. Only failure modes and overwrite behavior when `output` collides are left unstated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all four parameters, making 3 the baseline. The description adds modest value by clarifying that `start` triggers cutting and that cropping is centre-based for video, but does not explain how `output` interacts with the default location or the interaction between `start` and `length` limits.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Turn a local video clip or image into a Spotify Canvas') and pins the exact output artifact: silent 1080x1920 9:16 MP4, 3-8 seconds. This is clearly distinguishable from siblings like create_ai_music_video or video_specs, which concern generation/specification rather than local conversion of an existing asset.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'local video clip or image' framing implies the context of use (converting an existing local asset), but no sibling is named and there is no explicit when-not guidance. An agent must infer that this is the conversion tool rather than an AI-generation one.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
bpmYesTempo in beats per minute
sectionsNo
beatsPerBarNoBeats per bar (default 4)
offsetSecondsNoTime of the first downbeat (default 0)
durationSecondsYesLength of the song or clip in seconds

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the full burden. It reveals that only two inputs are mandatory and that sections are optional, plus the qualitative output (a beat-aligned shot list with per-section visual ideas). It does not say whether the call is deterministic, whether it writes anything, or anything about limits/errors, leaving meaningful gaps for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tight sentences: the output shape first, then the input requirements and where to get them. Every clause carries information and nothing is padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and no annotations, the description still conveys the artifact produced and the minimal input set, which is enough to invoke correctly. It stops short of describing the structure of the returned shot list (fields per shot, per-section grouping), which would be needed for a fully self-sufficient definition.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 80%, so the schema already documents bpm, durationSeconds, sections, beatsPerBar and offsetSeconds with defaults. The description adds only a restatement that BPM and duration are the sole needs and that sections are expressed in bars. Baseline 3 is appropriate given the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and artifact: 'Build a shot list for a music video where every cut lands on a bar line, with a visual idea per section.' That is far more concrete than a restated name/title. It does not, however, distinguish itself from sibling outputs like create_ai_music_video or video_specs, so it lands one notch below full marks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It names the prerequisite path clearly: 'get them from analyze_song,' which routes the agent to the correct sibling before calling this tool, and it marks sections as optional. There is no explicit when-not-to-use guidance or statement of how it differs from the other video-planning siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
platformNoLeave empty to list all platforms

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it does convey that this is a static rules lookup with no side effects by framing it as 'rules' by platform. However, it says nothing about whether the values are fixed or dynamic, or how to treat a platform not in the listed set, which matters for a zero-annotation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no filler. The returned fields lead, and the valid platform values follow immediately, which is exactly the order an agent needs them.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter read-only reference tool with no output schema, the description covers what is returned and what inputs are valid. It could go slightly further by sketching the response shape per platform, but nothing essential for correct invocation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema documents its single parameter and its empty-string behavior, but the description supplies the concrete accepted platform values (spotify-canvas, tiktok, instagram-reels, youtube-shorts, youtube) that the schema lacks entirely since no enum is defined. That is genuine added meaning beyond the structured field.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names the exact data returned (aspect ratio, resolution, length, format rules) and enumerates the five supported platforms, so an agent knows precisely what this lookup yields. It does not explicitly contrast itself with siblings like plan_music_video or make_spotify_canvas, but the reference-data purpose is unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied rather than stated: an agent can infer this is a pre-flight lookup consulted before generating a video, and the platform list signals valid inputs. There is no explicit when-to-use, no prerequisite, and no pointer to the sibling tools that actually create the content.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 5 tool updatesv0.1.0
    • First observedanalyze_song
    • First observedcreate_ai_music_video
    • First observedmake_spotify_canvas
    • First observedplan_music_video
    • First observedvideo_specs

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.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Provides video manipulation via ffmpeg (frame extraction, format conversion, trimming, audio adjustments, filters, and subtitle handling) without requiring an external API key.
    20
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables local, private analysis of YouTube URLs and local audio files to extract BPM, key modulations, vocal presence, transient punch, stereo width, and CLAP vibe embeddings, returning structured sonic signatures for AI agents and CLI users.
    4
    MIT
  • A
    license
    B
    quality
    C
    maintenance
    Enables AI coding agents to programmatically assemble vertical videos and manage local CapCut Desktop drafts, including AI background removal, audio mastering to -14 LUFS or Demucs vocal isolation, music auto-ducking, punch zooms, karaoke captions, PiP proof overlays, hook badges, safe-zone linting, proxy previews, and EN→ES cloning/dubbing. It outputs real CapCut draft JSON ready for review and export.
    17
    2
    MIT
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables agents to ingest local video files or URLs, analyze footage for mood, energy, speech, and scene cuts, and receive license-labeled royalty-free or Creative Commons BGM shortlists with a 12–20s hook window, beat-snapped cut suggestions, and an ffmpeg ducking/mix spec.
    -