flowmusic-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@flowmusic-mcp generate a warm lo-fi track at 85 bpm and download the mp3"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
flowmusic-cli
Lightweight Python CLI and MCP server for Google Flow Music (https://www.flowmusic.app), modeled after gflow-cli's engineering discipline (real-Chrome OAuth bootstrap, ProfileLease locking, billing-safe SubmitAttempt, --json envelopes, and --no-spend MCP policy) while taking advantage of Flow Music's pure-HTTP Supabase + REST/SSE stack (no resident browser or reCAPTCHA minting required for daily commands).
Installation
git clone https://github.com/Eleven1111/flowmusic-cli.git
cd flowmusic-cli
uv sync --extra dev
# Install global `flowmusic` and `flowmusic-mcp` executables:
uv tool install -e .
flowmusic --versionRelated MCP server: fmusic
Quick Start
# 1. One-time sign-in via your currently active Google Chrome (PKCE OAuth)
flowmusic auth login
# Or non-interactive two-step PKCE / isolated Playwright profile / refresh_token import:
flowmusic auth login --start
flowmusic auth login --code <CODE>
flowmusic auth login --method isolated-chrome
flowmusic auth import-token
# 2. Verify live session & inspect account/models/library (pure HTTP, no browser)
flowmusic auth status
flowmusic me
flowmusic credits
flowmusic models
flowmusic list --limit 10
# 3. Generate a song (`Lyria 3.5` / `Lyria 3 Pro` / `Lyria 4`) and auto-download MP3
flowmusic generate "warm lo-fi beats for midnight coding" --instrumental --bpm 85 --out-dir ./out
# 4. Conversational Producer mode
flowmusic chat "Make an acoustic indie folk song about autumn rain in Tokyo" --download --out-dir ./out
# 5. Stems separation, remixing (`cover` / `extend` / `replace`), upload & download
flowmusic stems <clip-id> --out-dir ./stems
flowmusic cover <clip-id> --strength 0.5 -i "acoustic jazz piano trio" --out-dir ./out
flowmusic extend <clip-id> --seconds 30 --out-dir ./out
flowmusic replace <clip-id> --region 12:24 -i "bright brass solo" --out-dir ./out
flowmusic upload-audio ./track.mp3 --json
flowmusic download <clip-id> --format wav --out-dir ./out
# 6. Search, favorites, clip metadata, conversations & playlists (0 credits)
flowmusic search "lofi piano" --limit 10
flowmusic search "jazz" --type playlists --limit 10
flowmusic favorites --limit 10
flowmusic clip update <clip-id> --title "Midnight Sketch" --privacy unlisted
flowmusic clip favorite <clip-id>
flowmusic clip preference <clip-id> liked
flowmusic conversations list --limit 10
flowmusic conversations show <conversation-id>
flowmusic conversations rename <conversation-id> "Tokyo Rain Drafts"
flowmusic playlists list --kind mine
flowmusic playlists list --kind featured
flowmusic playlists create "Late Night Focus" --privacy private
flowmusic playlists update <playlist-id> --name "Focus v2" --privacy unlisted
flowmusic playlists add <playlist-id> <clip-id>
flowmusic playlists remove <playlist-id> <clip-id>
flowmusic playlists favorite <playlist-id>
flowmusic playlists show <playlist-id>
flowmusic playlists delete <playlist-id> --yes
# 7. Clip video render, music-video library, social video & audio trim (v0.4)
flowmusic video clip <clip-id> --preset modern --out ./clip.mp4
flowmusic video quota
flowmusic video list --limit 20
flowmusic video show <video-id>
flowmusic video social <clip-id> --length 15
flowmusic trim <clip-id> --start 0 --end 10 --title "Intro Hook" --out-dir ./outMCP Server (mcp>=2.0.0)
# Start stdio MCP server for Claude Desktop / Cursor / Antigravity:
flowmusic mcp run
flowmusic-mcp
# Hide credit-spending tools (`generate`, `chat`, `stems`, `edit`, `create_social_video`, `trim_clip`):
flowmusic mcp run --no-spendExposed MCP tools (26 total):
Read / search / library / media utilities (20, always available):
flowmusic_auth_status,flowmusic_credits,flowmusic_models,flowmusic_list_clips,flowmusic_get_clips,flowmusic_download_audio,flowmusic_upload_audio,flowmusic_search,flowmusic_favorites,flowmusic_update_clip,flowmusic_list_conversations,flowmusic_get_conversation,flowmusic_rename_conversation,flowmusic_list_playlists,flowmusic_get_playlist,flowmusic_manage_playlist,flowmusic_render_clip_video,flowmusic_social_video_quota,flowmusic_list_music_videos,flowmusic_get_music_videoCredit/quota-spending tools (6, removed under
--no-spend):flowmusic_generate_song,flowmusic_chat_generate,flowmusic_split_stems,flowmusic_edit_song,flowmusic_create_social_video,flowmusic_trim_clip
Multi-Profile & Agent Usage
Every command supports
--profile <name>(isolated sessions under~/Library/Application Support/flowmusic-cli/profiles/<name>/session.jsonwith0600permissions, overridable viaFLOWMUSIC_CLI_HOME).Every CLI command supports
--jsonfor stable machine-readable output ({"ok": true, ...}or{"ok": false, "error": {"type", "detail", "charged", "retryable", "next_action"}}), and MCP failures setisError: true.
Architecture
src/flowmusic_cli/session.py— Dynamic Supabase config discovery fromwww.flowmusic.app, chunked/base64-@supabase/ssrcookie decoding,0600atomic persistence, and GoTruerefresh_tokenrotation.src/flowmusic_cli/auth_chrome.py— One-time real Chrome OAuth login (channel="chrome"with anti-webdriver flags) +import-tokenfallback.src/flowmusic_cli/profile_lease.py— Cross-process OS file locking (fcntl.flock/msvcrt.locking) preventing concurrent refresh-token rotation collisions.src/flowmusic_cli/submit_policy.py— Phase-trackedSubmitAttempt: never resends a generation POST once bytes leave the client.src/flowmusic_cli/payloads.py— Pure recipe/payload builders (CoverSong,ExtendSection,ReplaceSection, Lyria 4 edit plans), stem base64 validation, and MIME inference.src/flowmusic_cli/operations.py,library_ops.py,video_ops.py&client.py— Pure-HTTP asynchttpxclient (/__api/REST, multipart audio upload, SSE streaming, library search/favorites/conversations/playlists, clip video render, music-video library, social video, trim, atomic downloads).src/flowmusic_cli/cli_helpers.py,cli_auth.py,cli_library.py,cli_video.py,cli.py— Click CLI surface.src/flowmusic_cli/mcp_server.py,mcp_library.py&mcp_video.py—MCPServerstdio server (26 tools) with stdout isolation,--no-spendpolicy, andisErrorfailure flagging.
Design Philosophy
Pure HTTP for daily calls, Chrome only once: Flow Music runs on Supabase Auth +
/__api/REST/SSE with no resident browser needed after the initial PKCE OAuth handshake.Billing-safe by construction: Mutating/generation POSTs are guarded by phase-tracked
SubmitAttempt(never auto-retried once bytes leave the client), and--no-spendhides all credit/quota-spending MCP tools.Agent-friendly contracts: Every CLI command emits stable
--jsonenvelopes (ok,error.type,charged,retryable,next_action), every MCP failure flagsisError=True, and session files enforce0600permissions under cross-processProfileLeaselocks.
Directory Tree
flowmusic-cli/
├── LICENSE
├── README.md
├── pyproject.toml
├── src/flowmusic_cli/
│ ├── auth_chrome.py # One-time active/isolated Chrome PKCE OAuth
│ ├── cli.py # Root Click CLI entry point
│ ├── cli_auth.py # `auth` subcommands
│ ├── cli_helpers.py # Shared JSON envelopes, Rich tables, profile validation
│ ├── cli_library.py # `search`, `favorites`, `clip`, `conversations`, `playlists`
│ ├── cli_video.py # `video` and `trim` subcommands
│ ├── client.py # Async httpx client + auth/SSE transport
│ ├── config.py # Settings, profile paths, timeouts
│ ├── errors.py # Typed error hierarchy & exit codes
│ ├── library_ops.py # Zero-credit library REST mixin
│ ├── mcp_library.py # MCP library tool registrations
│ ├── mcp_server.py # MCPServer stdio host + `--no-spend` policy
│ ├── mcp_video.py # MCP video & trim tool registrations
│ ├── operations.py # Generation, stems, remix edits, upload, download
│ ├── payloads.py # Pure recipe/payload builders & ID validation
│ ├── profile_lease.py # Cross-process refresh-token file lock
│ ├── session.py # Dynamic Supabase config discovery & 0600 persistence
│ ├── sse.py # Incremental SSE parser
│ ├── submit_policy.py # Phase-tracked billing-safe SubmitAttempt
│ └── video_ops.py # Clip video render, music-video library, social video, trim
└── tests/ # 34 unit & stdio MCP tests (pytest)License
See LICENSE (MIT).
Available Tools
26 toolsflowmusic_auth_statusB
Verify Flow Music session live against /users/me and return redacted summary.
Inputs: profile. Returns: object
flowmusic_chat_generateC
Send a conversational prompt to Flow Music Producer and collect generated clips.
Inputs: message (required), profile, model_name, conversation_id. Returns: object
flowmusic_create_social_videoC
Create a social music video from a clip (consumes social video quota/credits).
Inputs: clip_id (required), profile, length_s, conversation_id. Returns: object
flowmusic_creditsC
Check current Flow Music credits balance and subscription tier.
Inputs: profile. Returns: object
flowmusic_download_audioC
Download clip audio by ID (mp3, wav, or m4a) to a local file path.
Inputs: clip_id (required), out_path (required), profile, audio_format. Returns: object
flowmusic_edit_songC
Edit a clip via cover, extend, or replace (regions as ['start:end', ...]).
Inputs: kind (required), clip_id (required), seed, wait, +11 more. Returns: object
flowmusic_favoritesC
List favorited Flow Music clips for the signed-in profile.
Inputs: limit, offset, profile. Returns: object
flowmusic_generate_songC
Generate a song (Lyria 3.5 / Lyria 3 Pro / Lyria 4) and optionally save audio files.
Inputs: prompt (required), bpm, seed, wait, +8 more. Returns: object
flowmusic_get_clipsB
Fetch metadata and audio URLs for one or more clip IDs.
Inputs: clip_ids (required), profile. Returns: object
flowmusic_get_conversationB
Fetch full message history for one producer conversation ID.
Inputs: conversation_id (required), profile. Returns: object
flowmusic_get_music_videoB
Fetch metadata (or generation status when status_only=True) for a music video.
Inputs: video_id (required), profile, status_only. Returns: object
flowmusic_get_playlistC
Get playlist metadata and ordered track items by playlist ID.
Inputs: playlist_id (required), limit, offset, profile. Returns: object
flowmusic_list_clipsC
List generated Flow Music clips for the signed-in profile.
Inputs: limit, offset, profile, filter_kind. Returns: object
flowmusic_list_conversationsC
List producer conversation sessions for the signed-in profile.
Inputs: limit, offset, profile. Returns: object
flowmusic_list_music_videosC
List music videos from Flow Music.
Inputs: limit, offset, profile, user_id, +1 more. Returns: object
flowmusic_list_playlistsC
List playlists (mine, following, featured, or trending-daily/weekly/monthly).
Inputs: kind, profile, user_id. Returns: object
flowmusic_manage_playlistC
Create, update, favorite, delete (confirm_delete=True), or add/remove clips on a playlist.
Inputs: action (required), name, privacy, profile, +5 more. Returns: object
flowmusic_modelsC
List available Flow Music models on this account.
Inputs: profile. Returns: object
flowmusic_rename_conversationC
Rename a producer conversation session.
Inputs: title (required), conversation_id (required), profile. Returns: object
flowmusic_render_clip_videoC
Render (or fetch cached) shareable MP4 clip video and optionally save it to out_path.
Inputs: clip_id (required), preset, profile, out_path, +1 more. Returns: object
flowmusic_searchC
Search Flow Music public/accessible clips or playlists by text query.
Inputs: query (required), kind, limit, offset, +1 more. Returns: object
flowmusic_social_video_quotaB
Return remaining social music-video quota (used and limit).
Inputs: profile. Returns: object
flowmusic_split_stemsC
Separate a clip into stems (out_dir is required unless create_clips=True).
Inputs: clip_id (required), wait, out_dir, profile, +2 more. Returns: object
flowmusic_trim_clipC
Trim a clip to [start_s, end_s] seconds via audio__apply_effect.
Inputs: end_s (required), clip_id (required), start_s (required), wait, +6 more. Returns: object
flowmusic_update_clipC
Update clip metadata (title, privacy, lyrics, description), favorite flag, or like/dislike.
Inputs: clip_id (required), title, lyrics, privacy, +4 more. Returns: object
flowmusic_upload_audioC
Upload a local audio file, wait for analysis, and confirm it to obtain a clip_id.
Inputs: file_path (required), profile, filename, model_name, +2 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 26 tools
Most tools target a distinct resource and action, and the descriptions clarify overlapping areas such as list_clips vs. favorites vs. search. The main ambiguity is between create_social_video and render_clip_video, and to a lesser extent chat_generate vs. generate_song, but the boundaries are mostly inferable.
All tools use the flowmusic_ prefix and snake_case, with a mostly predictable verb_noun pattern. Minor deviations include noun-only names like credits, models, favorites, and search, plus the reversed chat_generate.
At 26 tools, the surface is heavy and near the upper bound for a single MCP server. The broad music-platform domain justifies many operations, but several related tools could likely be consolidated.
The server covers a wide lifecycle: auth, credits, models, generation, upload/download, editing, stems, clips, videos, conversations, playlists, and search. Minor gaps remain, notably no clear delete operations for clips, conversations, or music videos.
Maintenance
Related MCP Connectors
Generate full songs with vocals, instrumentals and sound effects from text. One server for Suno, Google Lyria, Mureka, MiniMax, ACE-Step, YuE and ElevenLabs. Your agent can quote the credit cost before generating, start a song, wait for it to finish and return download links. Sign in with OAuth; optional daily credit caps; retries never charge twice.
Google Flow Music (Lyria): songs, lyrics, extend, cover, remix, effects, stems
Generate images, video, music and voice from your CLI or AI agent. On-brand AI media toolkit.
Google Flow's agent: chat that plans and makes images and videos, approvals, your own media
Related MCP Servers
- AlicenseAqualityAmaintenanceDrives Google Flow from an agent or the terminal: Veo text-to-video, image-to-video and clip extension, plus Imagen image generation. Runs locally against your own Google account with Flow access; video generation bills that account's credits.318,232 PyPI1,421MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to create music with Google Flow Music (Lyria) using your own account: generate songs from text prompts, use custom lyrics, make instrumentals, restyle uploaded audio, continue and refine songs in a conversation, split tracks into stems, and list, download, rename, or delete clips. It also reports account credits and subscription status, so an agent can drive the whole song-production workflow without a browser.5MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents and remote MCP clients to manage Google Flow projects, generate and edit images/videos with Veo and Nano Banana models, build and export Scene Builder timelines, and upload or retrieve media over local stdio or authenticated remote HTTP connections.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to create and edit Lyria songs, generate lyrics and videos, split stems, chat with the Producer agent, and manage sessions, playlists, and Spaces on Google Flow Music via Chrome CDP. It also queues credit-spending jobs with wait/cancel/retry controls and downloads audio, video, and cover art into an indexed local library.4MIT