KIHACHI Brain
The server exposes Brain/MCP tools for SongSpec generation/review, Ableton/Live planning with approval-gated execution, song memory, orchestration, and a schema-level Lyria audio tool that conflicts with the README.
Check connectivity with
hello.Generate SongSpecs from a genre plus optional key, mood, tempo, and length.
Create a ProjectPlan from a SongSpec, optionally including arrangement.
Translate ProjectPlans into Ableton plans and validate them for Live handoff.
Create approval-gated Live mutation requests and attempt approved execution through the adapter boundary.
Review SongSpecs.
Save SongSpecs/reviews to memory and search memory by genre, query, score, approval, and sort order.
Orchestrate generation, review, memory, and project preparation in one call.
Expose
generate_audiovia a Google Lyria boundary, although the README says Lyria is deprecated and audio generation is unavailable.
Generates audio from ProjectPlan target tracks using Google Lyria.
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., "@KIHACHI Brain Generate a song spec for a lo-fi hip hop beat"
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.
Status
Current milestone
KIHACHI MUSIC AI Studio 統合 / 8小節の実機適用・書き出し検証済み(Live 12.4.5、2026-10-01、RELEASE_ACCEPTANCE)
最短手順は docs/QUICKSTART.md。初回インストールは scripts/インストール.command、詳しい操作は docs/MANUAL.md、macOSアプリのビルドと署名は docs/MAC_APP.md を参照してください。
配布版としての未完了項目と判定条件は docs/RELEASE_ACCEPTANCE.md に記録しています。
KIHACHI Brain
Brain MCP for the KIHACHI MUSIC AI Platform.
KIHACHI MUSIC AI is not an AI music generator.
It is an AI music production platform.
The Brain creates musical plans.
KIHACHI builds them inside Ableton Live.
Memory learns from every song.
Review improves every iteration.
このリポジトリは Brain(FastMCP)です。ジャンル知識から SongSpec と ProjectPlan を作り、承認を経て Ableton Live の Session View と Arrangement View を組み立てます。詳細は docs/BRAIN.md と docs/VISION.md。
Related MCP server: Ableton MCP Extended
制作画面の起動
日常の制作では Cursor や Codex を開く必要はありません。
./scripts/setup.sh # 初回のみ
./scripts/kihachi-studio.command # http://127.0.0.1:8765/または scripts/kihachi-studio.command をダブルクリックします。画面の説明は docs/STUDIO_GUIDE.md、手順と復旧は docs/STUDIO.md、困ったときは docs/TROUBLESHOOTING.md。Ollama は docs/OLLAMA_SETUP.md、Live は docs/ABLETON_SETUP.md。
CLI
uv run kihachi doctor
uv run kihachi create "110 BPM、D# minor。Mutation Funk。Swing 54%。約5分。"
uv run kihachi projects
uv run kihachi inspect <候補ID>
uv run kihachi review <候補ID>
uv run kihachi revise <候補ID> --scope bass --bars 33-49 [--accept]
uv run kihachi approve <候補ID>
uv run kihachi ableton plan|dry-run|execute|verify <候補ID>制作画面・CLI・MCP は同じ StudioRuntime を使います。Live に触れる ableton dry-run / execute / verify は起動中の制作画面を通します。
MCP Gateway
既存の stdio MCP はそのままです。Manus など外部クライアント向けには、同じ FastMCP サーバーを Streamable HTTP でループバック待受します。Ableton Live と AbletonGPT(TCP 9877)は公開しません。
export KIHACHI_MCP_API_TOKEN="$(openssl rand -hex 32)"
uv run kihachi serve --transport streamable-http
# http://127.0.0.1:8787/mcp 健康確認は GET /healthset_tempo と produce_ableton_song は confirm=true が無いと Live を変えません。曲の手順は docs/ABLETON_SONG_PRODUCTION.md。登録とトンネルは docs/MCP_GATEWAY.md と docs/MANUS_MCP.md。
前提
この4点は仕様です。
Google Lyria は廃止済みです。音声生成機能はありません。成果物は編集可能な Live Set です。
Live への変更には人間承認が必要です。承認トークンは帯域外(所有者のみ読めるファイル)で渡します。
既存内容を自動上書きしません。 利用者所有のトラック・Clip・Arrangement 領域は変更しません。
自動再実行しません。読戻し成功まで完了扱いしません。CIでは実機接続しません。
公開 Tool
Tool | 役割 |
| 接続確認 |
| SongSpec を JSON で返す |
| SongSpec から ProjectPlan を JSON で返す |
| ProjectPlan を Ableton 向け構造へ変換 |
| ProjectPlan から決定論的なMIDIクリップ計画を生成 |
| Live へ渡す前の静的検証 |
| Live の接続確認と状態読取り(変更しない) |
| KIHACHI がロードを許可する Live 標準デバイス一覧 |
| Session View の変更計画を作る(実行しない) |
| 承認待ちの Live 実行要求を作る |
| 承認済み要求を1回だけ実行し receipt を返す |
| Live を読み直して receipt を再確認 |
| 検証済み Session を Arrangement へ展開する計画を作る |
| SongSpec を検証し ReviewResult を返す |
| SongSpec とReview結果をMemoryへ保存 |
| ジャンル・全文・Review品質・順位でMemoryを検索 |
| 生成・Review・Memory・Project作成を一括実行 |
| 制作画面と同じ経路で MIDI 候補を返す(Live は変更しない) |
| 制作指示から候補を作って保存する |
| 保存済みの候補の一覧・詳細(SongSpec・構成・トラック・レビュー・履歴) |
| 送る予定のノートを規則でレビューする |
| 指摘・対象・小節範囲だけを局所修正する( |
| 候補を承認する(送信の前提) |
| 送信内容を確認する(Live は変更しない) |
| 承認済み候補を1回だけ送信する( |
| Live から読み戻して計画と比較する |
| AI と環境の状態 |
save_live_set は実装していません。設計のみ docs/issues/ISSUE-0021.md にあります。
詳細は docs/API.md。
必要環境
Python 3.12+
Live 自動操作を使う場合: Ableton Live 11 以降 + Max for Live(必須)
uv sync --group devLive 自動操作は外部 API キーを必要としません。秘密情報はループバック用のセッショントークン1つだけで、起動ごとに生成され、Git には入りません。
Memoryを再起動後も保持する場合は保存先を設定します。未設定ならプロセス内のみです。
export KIHACHI_MEMORY_PATH="$HOME/.kihachi/memory.json"承認記録と使用済み idempotency key を再起動後も保持する場合は次を設定します。未設定ならプロセス内のみです。
export KIHACHI_LIVE_APPROVAL_PATH="$HOME/.kihachi/live-approvals.json"設定例は .env.example を参照してください。
Ableton Live セットアップ
macOSではLiveを終了し、
scripts/Liveデバイスをインストール.commandを開いてLiveのUser Libraryを選びます。実機で保存した.amxdと2つのJSを同梱しています。既存ファイルが異なるときはバックアップしてから導入します。詳しくは docs/ABLETON_SETUP.md。LiveでSetを開き、User Libraryのデバイスをトラックへ1つロードします。
inspect_live_stateでhealth.connectedがtrueになることを確認します。
Python側の通信パスはmacOSとWindowsに対応しています。今回の .amxd 同梱と .command による導入はIntel Mac / Live 12.4.5で検証済みで、Apple SiliconとWindowsでの導入は未検証です。
用途 | macOS | Windows |
ハンドシェイク |
|
|
プロトコル仕様は docs/MAXFORLIVE.md。
実行の流れ
inspect_live_state Live を読む
create_live_mutation_plan 計画を作る(何も変わらない)
request_live_execution 承認トークンをファイルへ書く(何も変わらない)
← ここで人間がファイルを開いてトークンを読む
execute_live_request 1回だけ実行し readback で検証
verify_live_execution Live を読み直して再確認
expand_session_to_arrangement verified のときだけ Arrangement へ展開verified は「全操作が適用され、かつ全操作が読み戻して一致した」ことのみを意味します。partially_applied と verification_failed は verified ではありません。復旧手順は docs/RECOVERY.md。
確認
uv run pytest
uv run ruff check src tests server.py
uv run fastmcp list server.pyfastmcp list の期待値: Tools (29) — 上の表のすべて。
テストは fake transport のみを使い、Ableton Live も Max も起動しません。実機のスモークテストは ./scripts/verify_live.sh(送信前に確認あり)。その他の実機手順は docs/MANUAL_LIVE_TESTS.md。
Python package structure
kihachi-mcp/
├── server.py # 互換エントリ
├── src/kihachi_mcp/ # 実装(ADR-0001)
│ ├── server.py
│ ├── api/
│ ├── models/ # live_state / live_mutation / live_receipt ほか
│ ├── services/ # inspector / planner / gate / executor / bridge
│ └── tools/ # 薄いJSONアダプター
├── maxforlive/
│ ├── kihachi.device.js # Live Object Model 操作
│ └── README.md # パッチ作成とパッケージ化手順
├── tests/
└── docs/
├── BRAIN.md
├── VISION.md
├── DEVELOPMENT.md
├── ROADMAP.md
├── ARCHITECTURE.md
├── API.md
├── MAXFORLIVE.md # プロトコル仕様
├── MANUAL_LIVE_TESTS.md # 手動実機テスト手順
├── RECOVERY.md # 障害時の復旧手順
├── issues/
└── adr/開発ルールは docs/DEVELOPMENT.md。設計は docs/ARCHITECTURE.md。変更履歴は CHANGELOG.md。Live 自動操作の決定は docs/adr/0006-ableton-live-automation.md。
Available Tools
12 toolscreate_ableton_planCreate Ableton PlanC
Translate a ProjectPlan JSON value into an Ableton plan.
Inputs: project_plan (required). Returns: object
create_project_from_songspecCreate Project From SongspecC
Build a ProjectPlan, optionally including its arrangement.
Inputs: songspec (required), include_arrangement. Returns: object
execute_live_requestExecute Live RequestC
Attempt an approved Live request through the configured adapter boundary.
Inputs: request (required), approved. Returns: object
generate_audioGenerate AudioC
Generate one audio target through the configured Google Lyria boundary.
Inputs: output_path (required), project_plan (required), target_track (required), prompt, +1 more. Returns: object
generate_songspecGenerate SongspecB
Generate a SongSpec via Brain, filling omitted values from knowledge.
Inputs: genre (required), key, mood, tempo, +1 more. Returns: object
helloHelloA
Return a simple health-check greeting.
Inputs: no named parameters. Returns: result
orchestrate_songOrchestrate SongC
Run generation, review, memory, and project preparation.
Inputs: genre (required), key, mood, tempo, +2 more. Returns: object
prepare_ableton_handoffPrepare Ableton HandoffA
Validate an Ableton plan before a future Live handoff.
Inputs: project_plan (required). Returns: object
remember_songRemember SongC
Remember a SongSpec and optional ReviewResult.
Inputs: songspec (required), review. Returns: object
request_live_executionRequest Live ExecutionA
Prepare one approval-gated Live mutation request without executing it.
Inputs: project_plan (required). Returns: object
review_songspecReview SongspecC
Review a SongSpec through the Brain review boundary.
Inputs: songspec (required). Returns: object
search_memorySearch MemoryC
Search memory by genre and optional review quality filters.
Inputs: genre, limit, query, sort_by, +2 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools map cleanly to distinct pipeline stages: spec generation, review, audio generation, project planning, Ableton planning, and memory operations. The pairs execute_live_request/request_live_execution and create_ableton_plan/prepare_ableton_handoff create mild ambiguity, but their descriptions clarify intent. Overall, an agent can usually select the right tool without much trouble.
All tools except hello follow a clear snake_case verb_noun pattern using domain-specific objects like songspec, project, plan, audio, and memory. hello is a minor exception, reading more like a interjection than a verb_noun action, but it is semantically a health check. This is very close to fully consistent naming.
Twelve tools is well within the expected range for a focused domain and maps to a coherent music-generation lifecycle. Each tool serves a meaningful role whether that is orchestration, individual pipeline stages, or memory access. There is no obvious bloat or redundancy.
The surface covers the main workflow: generate, review, audio generation, project planning, Ableton planning, approval-gated execution, memory storage/retrieval, and orchestration. Gaps like direct retrieval/update/delete of remembered artifacts or editing existing plans would require workarounds but are not dead ends. Core user journeys are coherent and actionable.
Maintenance
Related MCP Connectors
Autonomous music production for AI agents with MIDI generation, QC and provenance.
Compose, mix, master and export in Logic Pro, REAPER or Ableton Live by talking to an AI engineer.
Browser DAW for AI assistants: build multitrack songs with MIDI, effects, stems and generation.
Veena is an AI DAW with a personal music producer built in. Make songs in your studio from chat.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to control Ableton Live through natural language by querying tracks, analyzing sessions, and exporting stems via AbletonOSC integration.91MIT
- AlicenseAqualityDmaintenanceEnables programmatic control of Ableton Live using natural language to manage session transport, tracks, MIDI clips, and device parameters. It also integrates ElevenLabs for AI-generated audio and provides a high-performance framework for real-time performance tools.16MIT
- FlicenseNot gradedqualityBmaintenanceControl Ableton Live using natural language via Claude Code, with music theory engine for progressions, project persistence, and song cloning.-
- AlicenseNot gradedqualityDmaintenanceBridges AI assistants with Ableton Live, enabling real-time control, offline project analysis, version tracking, and rack/preset parsing for music production workflows.MIT