ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 ruvnet

ruflo-music

透過 Cognitum Music(cogmusic MCP)進行 AI 音樂生成:使用你自己的 music.cognitum.one 帳號創作歌詞/提示詞、生成音軌、分離 stem、擷取 MIDI 並進行母帶處理。作為 mod(ADR-445),它還提供只會收緊限制的工具防護、/music-mod,以及由主控台顯示的狀態檔案。

ruvnet@ruvnet

ruvnet/ruflo/tree/main/plugins/ruflo-music

已翻譯

關於這個 mod

ruflo-music

透過 Cognitum Music 生成 AI 音樂:創作歌詞/提示詞、生成音軌、分離 stem、擷取 MIDI 並進行母帶處理,全部透過 cogmusic MCP 伺服器,使用你自己的 Cognitum 帳號完成。

概觀

它將 cogmusic MCP bridge 包裝成 Ruflo 外掛,包含 2 個 agent、7 個 skill 和一個調度指令。與大多數同系列外掛不同,這裡沒有在本機執行的 CLI 執行階段:每次真正的生成都在遠端 GPU 推論服務(MiniMax-Music3)上執行,透過手寫的 MCP 伺服器連線;你的帳號使用自行簽發的 personal access token 驗證。

先決條件

  • 一個 Cognitum Music 帳號:music.cognitum.one。
  • 一個 cogmcp_... personal access token,在 music.cognitum.one/mcp 簽發(登入後選擇「Generate connection token」)。它只會顯示一次,請立即複製。這個外掛無法替你簽發或輪換 token。
  • 將 [email protected] 或更新版本註冊為 MCP 伺服器:
    claude mcp add cogmusic --env COGMUSIC_TOKEN=cogmcp_... -- npx -y cogmusic@latest
    
    0.1.0 沒有 fetch timeout 覆寫功能,任何執行超過 Node 預設約 5 分鐘的 create_production 呼叫都會失敗;實際生成通常需要更久。完整設定流程請參閱 music-connect skill。

安裝

claude --plugin-dir plugins/ruflo-music

MCP 整合(6 個工具)

註冊後,cogmusic 會公開 6 個工具:

claude mcp add cogmusic --env COGMUSIC_TOKEN=cogmcp_... -- npx -y cogmusic@latest
claude mcp get cogmusic   # 預期:✔ Connected

| 工具 | 用途 | |------|------| | list_productions | 列出已儲存的製作項目(每項包含 metadata 與 audio_url) | | get_production | 取得一個製作項目的目前 metadata 與 audio_url | | create_production | 根據歌詞與風格提示詞生成新音軌(會阻塞數分鐘) | | separate_stems | 分離 4 條 stem(人聲/鼓/貝斯/其他) | | extract_midi | 擷取經過音高追蹤的 MIDI/樂譜 | | master | 進行 LUFS 響度標準化與峰值限制 |

Agents

| Agent | 角色 | |-------|------| | music-composer | 根據創意簡報撰寫結構化歌詞與曲風/風格提示詞。不呼叫 MCP 工具。 | | music-producer | 流程入口:將作曲委派給 music-composer,呼叫 create_production,快取結果,可選擇後製,並回報 audio_url。 |

Skills

| Skill | 用途 | |-------|------| | music-connect | 一次性設定:註冊 cogmusic MCP 伺服器 | | music-generate | 根據完整指定的簡報生成音軌 | | music-list | 列出帳號中的所有製作項目 | | music-get | 取得一個製作項目的 metadata 與 audio_url | | music-stems | 對現有製作項目執行 4-stem 分離 | | music-midi | 從現有製作項目擷取 MIDI | | music-master | 對現有製作項目執行一次母帶處理(LUFS) |

Commands

/music connect [--token cogmcp_...]
/music generate <brief>
/music list
/music get <production-id>
/music stems <production-id>
/music midi <production-id>
/music master <production-id>

已知缺口(已揭露,不會靜默省略)

  • MCP 按設計不會傳送音訊位元組。 每個回傳製作項目的工具都會提供 audio_url,而不是音訊本身;必須使用相同的 cogmcp_ token,以 Authorization: Bearer 發出另一次經過驗證的 GET。
  • 目前 stem 和 MIDI 沒有 audio_url。 separate_stems/extract_midi 會確認生成了什麼(透過 get_production 查看 has_stems/has_midi),但衍生的音訊/MIDI 檔案目前只能在 dashboard 取得。已涵蓋主要音軌的 PAT-authorized-URL 模式(見 Architecture Decisions)尚未由上游延伸到這兩個端點。
  • GPU 推論服務確實有可靠性歷史問題。 間歇性的冷啟動失敗已在上游經過 3 次迭代完成根因分析與修正(見 ADR-0001 的 Related 區段);單次重試可以解決大多數暫時性失敗。每個生成類 skill 都會記錄這點,不會把第一次失敗當成最終結果。

相容性

  • CLI: 固定使用 @claude-flow/cli v3.6 major+minor。
  • 執行階段: [email protected]+ npm 套件(stdio↔HTTP MCP bridge)透過 claude mcp add 註冊;沒有本機計算,生成會在你無法控制的遠端 GPU 服務上執行。
  • 驗證: bash plugins/ruflo-music/scripts/smoke.sh 是契約。

Namespace 協作

這個外掛擁有兩個 AgentDB namespace(kebab-case,遵循 ruflo-agentdb ADR-0001 §「Namespace convention」 的慣例):

| Namespace | 用途 | |-----------|------| | music-productions | 快取製作項目 metadata:id、title、audio_url、prompt、lyrics、duration、處理步驟旗標,方便取回,不必往返呼叫 list_productions/get_production | | music-briefs | 產生每個製作項目的創意簡報,以製作項目 id 為鍵;稍後說「再做一個像那個的」時,可以取回確實有效的完整 prompt/lyrics 形狀 |

所有存取都透過 memory_*(依 namespace 路由)。這個外掛任何地方都不會呼叫帶有 namespace 引數的 agentdb_pattern-* 或 agentdb_hierarchical-*。保留的 namespace(pattern、claude-memories、default)絕不會被遮蔽。

驗證

bash plugins/ruflo-music/scripts/smoke.sh
# 預期:「10 passed, 0 failed」

架構決策

  • ADR-0001:外掛契約,包括 PAT 驗證模型、audio_url 傳遞模式、namespace 宣告和已揭露的可靠性狀況。

相關外掛

  • ruflo-agentdb:這個外掛遵循的 namespace 慣例
  • ruflo-neural-trader:最接近的外部服務包裝外掛契約先例(本機 CLI 與遠端 PAT 驗證 MCP 伺服器的形態不適用之處已分開處理)

授權條款

MIT

作為 mod

Function-hook mod(ADR-445 模式,hooks/register.ts)。它不會連網、不會啟動程序,也不會呼叫模型,但會加入以下內容:

  • Guard(只會收緊限制,預設開啟):如果 cogmusic 呼叫(create_production、separate_stems、master、extract_midi)或 memory 寫入的 prompt/lyrics/payload 含有秘密,就拒絕該呼叫(prompt 會離開本機前往 music.cognitum.one)。拒絕原因只會指出規則,不會透露值。
  • /music-mod:本機 status 和 scan <text>(秘密檢查,規則與 guard 相同);狀態檔案也會統計已開始的製作項目數量。
  • 狀態檔案 .claude-flow/music-mod/status.json({version:1, updatedMs, guard, checked, blocked, ...}),會在工作階段開始和計數器變更時寫入。

這裡刻意沒有加入每個 prompt 的上下文:這個外掛沒有值得附加到每個 prompt 的內容。

| 選項 | 預設值 | 效果 | |---|---|---| | guard | on | 拒絕上述呼叫 |

測試:claude plugin validate plugins/ruflo-music、claude plugin test plugins/ruflo-music、bash plugins/ruflo-music/scripts/smoke.sh。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add ruvnet/ruflo
claude plugin install ruflo-music
原文 / README

ruflo-music

AI music generation via Cognitum Music — compose lyrics/prompts, generate tracks, separate stems, extract MIDI, and master, all through the cogmusic MCP server against your own Cognitum account.

Overview

Wraps the cogmusic MCP bridge as a Ruflo plugin with 2 agents, 7 skills, and one dispatcher command. Unlike most sibling plugins, there's no locally-executed CLI runtime here — every real generation runs on a remote GPU inference service (MiniMax-Music3), reached over a hand-rolled MCP server your own account authenticates against with a personal access token you mint yourself.

Prerequisites

  • A Cognitum Music account at music.cognitum.one.
  • A cogmcp_... personal access token, minted at music.cognitum.one/mcp (sign in → "Generate connection token"). Shown exactly once — copy it immediately. This plugin cannot mint or rotate this token for you.
  • [email protected] or later registered as an MCP server:
    claude mcp add cogmusic --env COGMUSIC_TOKEN=cogmcp_... -- npx -y cogmusic@latest
    
    0.1.0 has no fetch timeout override and fails any create_production call that runs past Node's ~5-minute default — real generations routinely take longer. See the music-connect skill for the full setup flow.

Installation

claude --plugin-dir plugins/ruflo-music

MCP Integration (6 Tools)

cogmusic exposes 6 tools once registered:

claude mcp add cogmusic --env COGMUSIC_TOKEN=cogmcp_... -- npx -y cogmusic@latest
claude mcp get cogmusic   # expect: ✔ Connected

| Tool | Purpose | |------|---------| | list_productions | List saved productions (metadata + audio_url each) | | get_production | Fetch one production's current metadata + audio_url | | create_production | Generate a new track from lyrics + a style prompt (blocks for minutes) | | separate_stems | 4-stem separation (vocals/drums/bass/other) | | extract_midi | Pitch-tracked MIDI/score extraction | | master | LUFS loudness normalization + peak limiting |

Agents

| Agent | Role | |-------|------| | music-composer | Writes structured lyrics + a genre/style prompt from a creative brief. Calls no MCP tools. | | music-producer | Pipeline entry point — delegates composition to music-composer, calls create_production, caches the result, optionally post-processes, reports the audio_url. |

Skills

| Skill | Purpose | |-------|---------| | music-connect | One-time setup — register the cogmusic MCP server | | music-generate | Generate a track from a fully-specified brief | | music-list | List all productions in the account | | music-get | Fetch one production's metadata + audio_url | | music-stems | Run 4-stem separation on an existing production | | music-midi | Extract MIDI from an existing production | | music-master | Run a mastering (LUFS) pass on an existing production |

Commands

/music connect [--token cogmcp_...]
/music generate <brief>
/music list
/music get <production-id>
/music stems <production-id>
/music midi <production-id>
/music master <production-id>

Known gaps (disclosed, not silently omitted)

  • No audio bytes over MCP, by design. Every tool that returns a production carries an audio_url, not the audio itself — always a separate authenticated GET with the same cogmcp_ token as Authorization: Bearer.
  • Stems and MIDI have no audio_url yet. separate_stems/extract_midi confirm what was produced (has_stems/has_midi via get_production), but the derived audio/MIDI files are dashboard-only today — the PAT-authorized-URL pattern that already covers the primary track (see Architecture Decisions) hasn't been extended to these two endpoints upstream.
  • The GPU inference service has a real reliability history. Intermittent cold-start failures were root-caused and fixed upstream across three iterations (see ADR-0001's Related section) — a single retry resolves most transient failures; every generation-class skill documents this rather than treating a first failure as final.

Compatibility

  • CLI: pinned to @claude-flow/cli v3.6 major+minor.
  • Runtime: [email protected]+ npm package (stdio↔HTTP MCP bridge) registered via claude mcp add; no local compute — generation runs on a remote GPU service you don't control.
  • Verification: bash plugins/ruflo-music/scripts/smoke.sh is the contract.

Namespace coordination

This plugin owns two AgentDB namespaces (kebab-case, follows the convention from ruflo-agentdb ADR-0001 §"Namespace convention"):

| Namespace | Purpose | |-----------|---------| | music-productions | Cached production metadata — id, title, audio_url, prompt, lyrics, duration, processing-step flags — for recall without a round-trip to list_productions/get_production | | music-briefs | The creative brief that produced each production, keyed by production id, so a later "make another one like that" can retrieve the exact prompt/lyrics shape that worked |

All access via memory_* (namespace-routed). No agentdb_pattern-* or agentdb_hierarchical-* calls with a namespace argument anywhere in this plugin. Reserved namespaces (pattern, claude-memories, default) are never shadowed.

Verification

bash plugins/ruflo-music/scripts/smoke.sh
# Expected: "10 passed, 0 failed"

Architecture Decisions

  • ADR-0001 — plugin contract: PAT auth model, audio_url delivery pattern, namespace claims, disclosed reliability posture.

Related Plugins

  • ruflo-agentdb — namespace convention this plugin follows
  • ruflo-neural-trader — closest sibling precedent for an external-service-wrapping plugin contract (diverged where local-CLI vs. remote-PAT-authed-MCP-server shape doesn't fit)

License

MIT

As a mod

Function-hook mod (ADR-445 pattern, hooks/register.ts). It adds, with no network, no process spawning and no model call:

  • Guard (tighten-only, default on): refuses a cogmusic call (create_production, separate_stems, master, extract_midi) or memory write whose prompt/lyrics/payload holds a secret (prompts leave the machine for music.cognitum.one). The deny reason names the rule, never the value.
  • /music-mod: local status and scan <text> (secret check, same rules as the guard); the status file also counts productions started.
  • Status file .claude-flow/music-mod/status.json ({version:1, updatedMs, guard, checked, blocked, ...}), written at session start and when counters change.

Per-prompt context is deliberately not added: this plugin has nothing worth attaching to every prompt.

| Option | Default | Effect | |---|---|---| | guard | on | refuse the calls above |

Test: claude plugin validate plugins/ruflo-music, claude plugin test plugins/ruflo-music, bash plugins/ruflo-music/scripts/smoke.sh.

更多類似作品