---
title: "ruflo-music"
url: "https://claudemods.dev/ko/builds/ruflo-music-1bf7ad"
source: "https://github.com/ruvnet/ruflo/tree/main/plugins/ruflo-music"
source_type: "github"
repo: "https://github.com/ruvnet/ruflo/tree/main/plugins/ruflo-music"
author: "ruvnet"
author_handle: "ruvnet"
stars: 82435
category: "오디오 및 멀티미디어"
categories: ["audio"]
tags: ["claude-code", "cognitum-music", "guard", "hooks", "mcp", "music-generation", "plugin", "ruflo"]
permission_level: 2
scan_complete: true
install: "claude plugin marketplace add ruvnet/ruflo\nclaude plugin install ruflo-music"
added: "2026-10-05T08:14:24.023Z"
updated: "2026-11-25T14:44:06Z"
locale: "ko"
content_locale: "ko"
---

# ruflo-music

Cognitum Music(cogmusic MCP)을 통한 AI 음악 생성입니다. 자신의 music.cognitum.one 계정으로 가사/프롬프트를 만들고 트랙을 생성하며 스템을 분리하고 MIDI를 추출하고 마스터링합니다. mod(ADR-445)로서 도구에 대한 강화 전용 가드, /music-mod와 콘솔에 표시되는 상태 파일도 제공합니다.

## Description

# ruflo-music

[Cognitum Music](https://music.cognitum.one)을 통한 AI 음악 생성입니다. 가사/프롬프트 작성, 트랙 생성, 스템 분리, MIDI 추출과 마스터링을 모두 자신의 Cognitum 계정에 대해 `cogmusic` MCP 서버로 수행합니다.

## 개요

`cogmusic` MCP 브리지를 Ruflo 플러그인으로 감싸 2개의 agent, 7개의 skill과 하나의 디스패처 명령을 제공합니다. 대부분의 형제 플러그인과 달리 여기에는 로컬에서 실행되는 CLI 런타임이 없습니다. 실제 생성은 모두 원격 GPU 추론 서비스(MiniMax-Music3)에서 실행되며, 직접 만든 MCP 서버에 연결됩니다. 자신의 계정은 직접 발급한 personal access token으로 인증합니다.

## 사전 요구 사항

- Cognitum Music 계정: [music.cognitum.one](https://music.cognitum.one).
- `music.cognitum.one/mcp`에서 발급한 `cogmcp_...` personal access token(로그인 후 “Generate connection token” 선택). 정확히 한 번만 표시되므로 즉시 복사하세요. 이 플러그인은 토큰을 대신 발급하거나 교체할 수 없습니다.
- `cogmusic@0.1.1` 이상을 MCP 서버로 등록합니다.
  ```bash
  claude mcp add cogmusic --env COGMUSIC_TOKEN=cogmcp_... -- npx -y cogmusic@latest
  ```
  `0.1.0`에는 fetch timeout 재정의가 없으므로 Node의 기본값인 약 5분을 넘겨 실행되는 `create_production` 호출은 실패합니다. 실제 생성은 보통 더 오래 걸립니다. 전체 설정 흐름은 `music-connect` skill을 참고하세요.

## 설치

```bash
claude --plugin-dir plugins/ruflo-music
```

## MCP 통합(도구 6개)

등록하면 `cogmusic`이 도구 6개를 공개합니다.

```bash
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개 스템으로 분리합니다(보컬/드럼/베이스/기타) |
| `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-스템 분리 실행 |
| `music-midi` | 기존 프로덕션에서 MIDI 추출 |
| `music-master` | 기존 프로덕션에 마스터링(LUFS) 단계 실행 |

## Commands

```bash
/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`을 담습니다. `Authorization: Bearer`에 기본 `cogmcp_` token을 사용해 별도의 인증된 `GET`을 수행해야 합니다.
- **스템과 MIDI에는 아직 `audio_url`이 없습니다.** `separate_stems`/`extract_midi`는 생성된 항목을(`get_production`을 통한 `has_stems`/`has_midi`로) 확인하지만, 파생된 오디오/MIDI 파일은 현재 dashboard에서만 확인할 수 있습니다. 기본 트랙에 이미 적용된 PAT-authorized-URL 패턴(Architecture Decisions 참고)은 아직 upstream에서 이 두 엔드포인트로 확장되지 않았습니다.
- **GPU 추론 서비스에는 실제 신뢰성 이력이 있습니다.** 간헐적인 콜드 스타트 실패는 3번의 반복을 거쳐 upstream에서 원인을 규명하고 수정했습니다(ADR-0001의 Related 섹션 참고). 한 번 재시도하면 대부분의 일시적 실패를 해결할 수 있습니다. 모든 생성 계열 skill은 첫 실패를 최종 결과로 취급하지 않고 이 점을 문서화합니다.

## 호환성

- **CLI:** `@claude-flow/cli` v3.6 major+minor로 고정되어 있습니다.
- **Runtime:** `cogmusic@0.1.1+` npm 패키지(stdio↔HTTP MCP 브리지)를 `claude mcp add`로 등록합니다. 로컬 계산은 없으며 생성은 제어할 수 없는 원격 GPU 서비스에서 실행됩니다.
- **검증:** `bash plugins/ruflo-music/scripts/smoke.sh`가 계약입니다.

## Namespace 조정

이 플러그인은 2개의 AgentDB namespace를 소유합니다(kebab-case이며 [ruflo-agentdb ADR-0001 §“Namespace convention”](../ruflo-agentdb/docs/adrs/0001-agentdb-optimization.md)의 규칙을 따름).

| 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
bash plugins/ruflo-music/scripts/smoke.sh
# 예상: “10 passed, 0 failed”
```

## 아키텍처 결정

- [ADR-0001](docs/adrs/0001-music-contract.md): 플러그인 계약. PAT 인증 모델, `audio_url` 전달 방식, namespace 선언과 공개된 신뢰성 상태를 정의합니다.

## 관련 플러그인

- [ruflo-agentdb](../ruflo-agentdb): 이 플러그인이 따르는 namespace 규칙
- [ruflo-neural-trader](../ruflo-neural-trader): 외부 서비스를 감싸는 플러그인 계약의 가장 가까운 형제 사례(로컬 CLI와 원격 PAT 인증 MCP 서버 형태가 맞지 않는 부분은 다르게 처리함)

## 라이선스

MIT

## mod로서

Function-hook mod(ADR-445 패턴, `hooks/register.ts`). 네트워크 통신, 프로세스 생성 또는 모델 호출 없이 다음을 추가합니다.

- **Guard**(강화 전용, 기본 ON): `cogmusic` 호출(create_production, separate_stems, master, extract_midi)이나 memory 쓰기의 prompt/lyrics/payload에 비밀이 있으면 거부합니다(prompt는 music.cognitum.one으로 나가기 때문). 거부 이유에는 값을 넣지 않고 규칙만 표시합니다.
- **`/music-mod`:** 로컬 `status`와 `scan <text>`(가드와 같은 규칙의 비밀 검사). 상태 파일에는 시작한 프로덕션 수도 기록됩니다.
- **상태 파일** `.claude-flow/music-mod/status.json`(`{version:1, updatedMs, guard, checked, blocked, ...}`): 세션 시작 시와 카운터가 바뀔 때 기록됩니다.

각 prompt에 컨텍스트를 일부러 추가하지 않습니다. 모든 prompt에 붙일 만한 내용이 이 플러그인에는 없기 때문입니다.

| Option | Default | Effect |
|---|---|---|
| `guard` | `on` | 위 호출 거부 |

테스트: `claude plugin validate plugins/ruflo-music`, `claude plugin test plugins/ruflo-music`, `bash plugins/ruflo-music/scripts/smoke.sh`.

## Install

```
claude plugin marketplace add ruvnet/ruflo
claude plugin install ruflo-music
```

## Original README

# ruflo-music

AI music generation via [Cognitum Music](https://music.cognitum.one) — 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](https://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.
- `cogmusic@0.1.1` or later registered as an MCP server:
  ```bash
  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

```bash
claude --plugin-dir plugins/ruflo-music
```

## MCP Integration (6 Tools)

`cogmusic` exposes 6 tools once registered:

```bash
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

```bash
/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:** `cogmusic@0.1.1+` 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"](../ruflo-agentdb/docs/adrs/0001-agentdb-optimization.md)):

| 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
bash plugins/ruflo-music/scripts/smoke.sh
# Expected: "10 passed, 0 failed"
```

## Architecture Decisions

- [ADR-0001](docs/adrs/0001-music-contract.md) — plugin contract: PAT auth model, `audio_url` delivery pattern, namespace claims, disclosed reliability posture.

## Related Plugins

- [ruflo-agentdb](../ruflo-agentdb) — namespace convention this plugin follows
- [ruflo-neural-trader](../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`.
