Flow Music (fmusic)

io.github.JvanLeeuwen4由 GitHub 帳號 JvanLeeuwen4 發布v0.2.0更新於 Nov 7, 2026

Unofficial MCP server for Google Flow Music (Lyria): generate, remix, stem-split and download songs.

已驗證STDIO僅桌面媒體與設計AI 與機器學習

概覽

AI 產生的概覽

非官方的 Google Flow Music(Lyria)MCP 伺服器,讓助理用你自己的帳號生成、改編、分軌、製作循環並下載歌曲。

可以做什麼
  • 依文字提示生成歌曲,可附上自己的歌詞,並透過對話繼續調整、延長或重混已生成的版本
  • 列出你的作品,並讀取單一作品的標題、長度、提示詞、歌詞與音訊連結等中繼資料
  • 將作品音訊下載為 wav 或 m4a,並附上中繼資料 JSON 檔
  • 把作品拆成人聲、鼓、貝斯與其他分軌並存到本機
  • 用作品或本機音訊檔製作無縫遊戲循環,並查詢剩餘額度與登入狀態
適用情境
適合讓助理依描述產出背景音樂、片頭音樂或遊戲循環音樂,並把音訊檔留在本機,包括可直接用於 Godot、Unity 等引擎的循環曲目。
執行需求
以本機 Python 套件執行(Python 3.10+,透過 uv 或 pipx 安裝)。需要一次性用 Chrome 或 Edge 完成 Google 登入,或手動匯入 Cookie 標頭,並需要具備 Flow Music 存取權的 Google 帳號;有 Google AI 訂閱可獲得較多額度。選用環境變數包括 FMUSIC_PROFILE、FMUSIC_OUTPUT_DIR、FMUSIC_HOME 與 FMUSIC_TIMEOUT。
安裝前請注意
非官方專案,與 Google 無關聯;它使用與 flowmusic.app 網站相同的端點,網站變動時可能失效。生成會消耗你自己的 Flow Music 額度,且 AI 聯合製作人可能一次產生一到兩個版本。登入會在本機保存工作階段權杖,匯入 Cookie 標頭意味著要處理帳號憑證。下載的音訊與分軌檔會寫入本機資料夾。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Flow Music (fmusic),將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

flowmusic-cli

Make music with Google Flow Music (Lyria) from your terminal, your scripts, or your AI agent.

fmusic is a command-line client and MCP server for flowmusic.app. You sign in once with your own Google account. After that it works without a browser: you describe a song, and a few minutes later you have a WAV file plus a JSON file with its details.

mcp-name: io.github.JvanLeeuwen4/flowmusic-cli

[!IMPORTANT] Unofficial project. It is not affiliated with, endorsed by, or supported by Google. It uses the same endpoints as the flowmusic.app website, so it can break when the site changes. You use your own account and credits. Follow the Flow Music terms and the generative AI use policy, and don't use it for spam or mass generation.


Quick start

bash
uv tool install flowmusic-cli        # 1. install (or: pipx install flowmusic-cli)fmusic auth login                    # 2. a browser opens once: sign in with Googlefmusic generate "dreamy synthwave, airy female vocals, 100 bpm"   # 3. make a song

Example output:

text
♪ take 1 (audio__create_song) Dreamy synthwave, airy female vocals, lush pads, 100 bpm  queued "Neon Drift" 3e2b2139-… (~35s)  ✓ rendered "Neon Drift"⬇ ~/Music/flowmusic-cli/2026-11-04/neon-drift_3e2b2139.wavNeon Drift  1:44  3e2b2139-2783-4171-a2b4-a51d03bc4504continue with: fmusic chat 13001945-… "…"

What you need:

  • Python 3.10+, via uv or pipx.
  • Google Chrome or Edge, for the one-time sign-in.
  • A Google account with Flow Music access. A Google AI subscription gives the most credits.

What you can do

I want to…Command
Make a song from a descriptionfmusic generate "folk ballad about the sea, male vocals"
Use my own lyricsfmusic generate "upbeat k-pop" --lyrics lyrics.txt
Make an instrumentalfmusic generate "lofi beat, 80 bpm" --instrumental
Change a song I just madefmusic chat <conversation_id> "make it faster, add a bridge"
Restyle my own audiofmusic generate "turn this into a jazz trio" --audio demo.mp3
Split a song into stemsfmusic stems <clip_id> (vocals, drums, bass, other)
See my songsfmusic clips list
Download, rename or delete songsfmusic clips download/rename/delete <clip_id>
Make looping game musicfmusic generate "cozy village theme" --instrumental --loop (more)
Loop a song I already havefmusic loop <clip_id or file> (no credits)
Check my creditsfmusic credits

The full reference for every command and flag is in docs/commands.md.

How generation works

Flow Music has an AI co-producer. Your prompt goes to it, and it decides what to make: often one or two takes. It rewrites your prompt into a detailed "sound prompt" and may suggest next steps. Each generation belongs to a conversation, and fmusic chat <conversation_id> "…" continues that conversation, for example to tweak, extend or remix a take.

If you want exact control without the co-producer, use the experimental --direct mode. Your prompt goes to the song model as-is, and -n sets the number of takes:

bash
fmusic generate "minimal techno, 126 bpm, hypnotic" --direct -n 2 --title "Night Drive"

Game music: seamless loops

Lyria songs have an intro and a real ending, so looping the raw file jumps from the final chord straight back to the start. --loop fixes that:

[Waveform around the loop seam: the raw file fades out and restarts from a quiet intro; the fmusic loop keeps playing]

Listen to 16 seconds around the seam of a 1-minute Lyria jingle: 🔊 raw file, looped · 🔊 fmusic loop. The seam is at 0:08.

bash
uv tool install --force "flowmusic-cli[game]"     # once: adds numpy + soundfile (no ffmpeg needed)fmusic generate "cozy pixel-art village theme, acoustic guitar, 90 bpm" --instrumental --loop
text
⬇ ~/Music/flowmusic-cli/2026-11-05/peaceful-village_467c790b.wav  ⟳ loop 0:24 → 1:44 (length 80.0s, similarity 0.96 good)⬇ ~/Music/flowmusic-cli/2026-11-05/peaceful-village_467c790b_loop.ogg
  • The prompt gets a short "loopable: steady groove, no intro, no ending" instruction.
  • <name>_loop.ogg is cut and crossfaded so it loops cleanly when you turn looping on in any engine (Godot, Unity, web audio). Use --loop-format wav|both for WAV.
  • The full WAV keeps its intro and gets the loop points as a smpl chunk. In Godot, import it with Loop Mode: Detect From WAV to play the intro once and then loop.
  • The JSON gets loop: {start_s, end_s, length_s, start_sample, end_sample, similarity, quality}. When quality is poor, the seam may be audible; try the other take.
  • Songs you already have don't cost credits: fmusic loop <clip_id> or fmusic loop theme.wav.

How the loop is found is described in docs/how-it-works.md.


Install

MethodCommand
uv (recommended)uv tool install flowmusic-cli
pipxpipx install flowmusic-cli
With game loops (--loop)uv tool install "flowmusic-cli[game]"
Latest from GitHubuv tool install git+https://github.com/JvanLeeuwen4/flowmusic-cli
Updateuv tool upgrade flowmusic-cli

The package installs two equivalent commands, fmusic and flowmusic.

Sign in

bash
fmusic auth login      # opens Chrome/Edge: sign in with Google; the window closes by itselffmusic auth status     # shows email, subscription tier, credits (exit code 0 = OK)fmusic auth logout
  • You sign in once. Tokens refresh automatically, so you won't need to sign in again unless you log out or the session is revoked.
  • To use several accounts, add --profile work (or set FMUSIC_PROFILE=work) to any command.
  • Can't open a browser (for example on a server)? Sign in on flowmusic.app on another machine. In the browser's DevTools, open the Network tab and copy the Cookie header of any __api request. Then run:
    bash
    fmusic auth import "sb-sb-auth-token.0=base64-…; sb-sb-auth-token.1=…"

Use it from AI agents

fmusic is built to be driven by agents. There are three ways:

1. Claude Code plugin (skill + MCP server)

text
/plugin marketplace add JvanLeeuwen4/flowmusic-cli/plugin install fmusic@flowmusic-cli

Then run fmusic auth login once in a terminal. The plugin starts the MCP server through uvx, so you don't need to install anything else.

2. Any MCP client (Claude Desktop, Cursor, VS Code, Codex, …)

Add this to the client's MCP configuration. It only needs uv:

json
{  "mcpServers": {    "fmusic": { "command": "uvx", "args": ["--from", "flowmusic-cli[game]", "fmusic", "mcp", "run"] }  }}

If fmusic is already installed, this command writes the config for you:

bash
fmusic mcp setup --target claude-code      # or: claude-desktop, print

The tools and their parameters are listed in docs/mcp.md.

3. The CLI with --json

Every command accepts --json:

  • Results go to stdout as one JSON object: {"status":"ok","data":…} or {"status":"fail","error":{…}}.
  • Progress messages go to stderr.
  • Exit codes are stable. See docs/troubleshooting.md.
bash
fmusic --json generate "calm piano, 70 bpm" --instrumental | jq '.data.clips[].files'

Agents working on this repository should read AGENTS.md.


Where files go

By default, songs are saved to ~/Music/flowmusic-cli/<date>/. Use -o DIR to choose a folder; the files then go directly in it. Each clip produces:

text
neon-drift_3e2b2139.wav     # audio (or .m4a with --format m4a; both with --format both)neon-drift_3e2b2139.json    # title, duration, sound prompt, lyrics, ids, URLsneon-drift_3e2b2139.jpg     # cover art (only with --cover)

Configuration

All settings are optional environment variables.

VariableDefaultPurpose
FMUSIC_PROFILEdefaultWhich saved account to use
FMUSIC_OUTPUT_DIR~/Music/flowmusic-cliWhere downloads go
FMUSIC_HOMEOS user-data dirWhere sessions are stored
FMUSIC_TIMEOUT60HTTP timeout in seconds

Troubleshooting

The most common issues:

  • Uploads with vocals fail with "not available in your region". In some regions, including the EU, Flow Music doesn't allow uploading tracks with vocals or removing vocals from them. Upload instrumentals instead.
  • Session expired (exit code 3). Run fmusic auth login again.
  • Google won't let you sign in. Make sure Chrome or Edge is installed. You can also use fmusic auth import instead.

Everything else is in docs/troubleshooting.md.


Documentation

DocFor
docs/commands.mdEvery command, flag and JSON shape
docs/mcp.mdMCP tools and client setup
docs/troubleshooting.mdErrors, exit codes, fixes
docs/how-it-works.mdArchitecture and the flowmusic.app API
AGENTS.mdContributors and coding agents
llms.txtA compact summary for LLMs

Contributing

Issues and pull requests are welcome. See AGENTS.md for the layout and test commands:

bash
uv run --extra dev pytest

The sign-in approach is inspired by gflow-cli. MIT licensed.

來源:README.md,提交 424892b

工具

9

fmusic_generate

Generate song(s) on Google Flow Music from a text prompt (genre, mood, instruments, tempo, vocals). Optionally pass full lyrics. The AI co-producer may make 1-2 takes. Takes ~1-2 minutes. For video game background music set loop=True: the prompt asks for a loopable song and each clip also gets a seamless <name>_loop.ogg (loop_format: ogg|wav|both) plus `loop` info (start/end, quality). Returns clips with local file paths (when download=True) and a conversation_id for follow-ups.

輸入參數loopmodelformatlyricsprompt必填out_dirdownloadloop_formatinstrumental

fmusic_chat

Send a follow-up to an existing Flow Music conversation, e.g. 'make it faster', 'extend it', 'add a guitar solo', 'remix the first take as drum and bass'. loop=True also writes seamless game loops.

輸入參數loopformatmessage必填out_dirdownloadloop_formatconversation_id必填

fmusic_list_clips

List the user's songs (newest first).

輸入參數limitoffset

fmusic_get_clip

Get a clip's metadata: title, duration, prompt, lyrics, audio URLs.

輸入參數clip_id必填

fmusic_download

Download a clip's audio (wav, m4a or both) plus a metadata JSON sidecar. loop=True also writes a seamless game loop file (see fmusic_loop).

輸入參數loopcoverformatclip_id必填out_dirloop_format

fmusic_loop

Make a seamless loop for video game background music, without spending credits. `source` is a local audio file (wav/flac/ogg/mp3) or an existing clip id. Skips the intro and the ending, finds a loop point that matches the loop start, and writes <name>_loop.ogg (loop_format: ogg|wav|both) that loops cleanly with looping enabled in the engine. A WAV source also gets the loop points as a smpl chunk (Godot: Loop Mode "Detect From WAV"). Check `quality` (good|ok|poor).

輸入參數source必填out_dirloop_format

fmusic_stems

Split a clip into stems (vocals, drums, bass, other) and save them locally.

輸入參數clip_id必填out_dir

fmusic_credits

Remaining Flow Music credits.

無需輸入參數。

fmusic_auth_status

Check whether the CLI is logged in, and the subscription tier.

無需輸入參數。

版本歷史

2
  1. v0.2.0最新Nov 5, 2026
  2. v0.1.1Nov 5, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分