Skip to main content
Glama
cyber-band-mcp

cyber-band-mcp

by chenzy2006

cyber-band-mcp

An MCP & Multi-Agent Collaborative Cyber Band MIDI Arrangement Engine

English | 中文文档

cyber-band-mcp turns AI coding/agent clients (such as Antigravity, Claude Desktop, or Cursor) into a four-piece cyber band—Drummer, Bassist, Synth, and a Sharp-Tongued Producer—collaborating via the Model Context Protocol (MCP) to compose, audit, argue, revise, and export multi-track Standard MIDI files with an instant browser-based Piano Roll & Tone.js synthesizer workbench.

cyber-band-mcp Workbench Overview


Key Features

  • Structured Score JSON Protocol: Agents never emit raw binary MIDI bytes; all notes are validated through Pydantic v2 (pitch, start_beat, duration_beats, velocity) and compiled into Type 1 SMF .mid files via pretty_midi.

  • Music-Theory & Mix Auditor (audit_arrangement): Detects low-frequency masking between Bass and Chords/Melody, register overflow, kick-bass pocket alignment, flat velocity dynamics, and out-of-key notes.

  • Band Room Chat (post_band_chat): Captures the Producer's harsh critiques and musicians' responses directly inside the project state so you can watch the band argue and iterate in real time.

  • Zero-External-Sample Web Workbench (web_preview/): Pure HTML/CSS/JS + Canvas Piano Roll + native Tone.js synthesizers (MembraneSynth, NoiseSynth, MetalSynth, MonoSynth, PolySynth)—works completely offline without external .mp3/.wav samples.


Related MCP server: MIDI Composition Tools MCP Server

3-Step Quick Start

# 1. Install dependencies with uv
uv sync

# 2. Run the end-to-end multi-agent demo (generates output/cyberpunk_midnight_drive.mid)
uv run python scripts/run_demo_session.py

# 3. Start the CORS-free local preview server
uv run python scripts/dev_preview.py --open

Run unit tests anytime:

uv run pytest -v

Connecting to Antigravity (MCP Configuration)

Add the following server entry to your Antigravity MCP configuration (replace /path/to/cyber-band-mcp with your local repository path):

{
  "mcpServers": {
    "cyber-band-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/cyber-band-mcp",
        "run",
        "cyber-band-mcp"
      ]
    }
  }
}

Exposed MCP Tools

Tool

Owner

Purpose

init_project

Coordinator / Producer

Initialize BPM, time signature, key signature, and total bars.

write_track_notes

Drummer / Bassist / Synth

Submit validated structured JSON notes to drums, bass, chords, or melody.

audit_arrangement

Producer

Run quantitative mix, pocket, dynamics, and key-signature checks.

post_band_chat

All Band Roles

Post Producer feedback, rework orders, or musician replies to the Band Room.

export_midi

Producer

Compile multi-track .mid and .preview.json (blocked if audit fails).


Copy-Paste Prompt: Wake Up the Cyber Band

Paste this prompt into Antigravity after connecting cyber-band-mcp:

You are now the Cyber Band Studio! Use the `cyber-band-mcp` tools to collaborate in 4 roles:
1. Producer: Call `init_project` for an 8-bar, 124 BPM, F# minor cyberpunk synthwave track.
2. Drummer, Bassist, and Synth: Each write your own track (`drums`, `bass`, `chords`, `melody`) via `write_track_notes`, and announce your take in `post_band_chat`.
3. Producer: You MUST call `audit_arrangement` first. Post a sharp, constructive critique via `post_band_chat` pointing out any frequency clashes, flat dynamics, or pocket issues, and order the responsible musician(s) to rewrite.
4. Once `audit_arrangement` returns `passed: true`, call `export_midi` and tell me the exported `.mid` path.

License

MIT

Available Tools

5 tools
audit_arrangementA

毒舌制作人强制调用的编曲质检工具,检测频段冲突、节奏撞车、动态平坦与调外音。

Args: project_id: 目标工程 ID。 strictness: 审计严格程度(lenient / standard / strict),默认 standard。

Returns: 结构化的 AuditReport 字典,包含 passed、score、summary 与 issues。

Inputs: project_id (required), strictness. Returns: object

export_midiA

将工程编译为标准多轨 .mid 文件并输出前端试听 .preview.json。

Args: project_id: 目标工程 ID。 output_dir: 导出目录(相对于工作区根目录),默认 "output"。 filename: 可选输出文件前缀(不含扩展名)。 require_audit_pass: 是否强制要求最近一次审计通过(无 error 冲突),默认 True。

Returns: 导出文件路径与轨道统计信息;若审计未通过且 require_audit_pass=True 则返回拒绝状态。

Inputs: project_id (required), filename, output_dir, require_audit_pass. Returns: object

init_projectA

初始化一个新的赛博乐队编曲工程。

Args: title: 作品名称。 bpm: 全局速度(20.0 - 300.0),默认 120.0。 time_signature: 拍号(如 "4/4"、"3/4"、"6/8"),默认 "4/4"。 key_signature: 调性(如 "C minor"、"F# dorian"),默认 "C minor"。 total_bars: 工程总小节数(1 - 256),默认 8。 project_id: 可选自定义工程 ID;不传则自动生成。

Returns: 包含 project_id、标准化工程配置与初始轨道列表的字典。

Inputs: title (required), bpm, project_id, total_bars, +2 more. Returns: object

post_band_chatB

向乐队群聊流写入发言、制作人吐槽或返工指令,持久化后可在前端工作台展示。

Args: project_id: 目标工程 ID。 role: 发言角色(Drummer / Bassist / Synth / Producer)。 message: 发言正文内容。 reply_to: 可选,被点名或回复的角色。

Returns: 包含最新发言条目与当前总消息数的字典。

Inputs: role (required), message (required), project_id (required), reply_to. Returns: object

write_track_notesA

向指定轨道写入或追加结构化音符 JSON(严禁直接写入二进制 MIDI)。

Args: project_id: 目标工程 ID。 track_name: 轨道名称(drums / bass / chords / melody)。 role: 提交音符的乐手角色(Drummer / Bassist / Synth)。 notes: 音符列表,每项包含 pitch、start_beat、duration_beats、velocity。 mode: 写入模式,"replace" 全量替换,"append" 追加到现有音符后。 program: 可选 General MIDI 音色编号(0-127);drums 轨道自动忽略。

Returns: 写入结果摘要、音符数量、拍数范围与越界警告。

Raises: ValueError: 当角色与轨道分工不匹配或音符字段不合法时抛出。 KeyError: 当 project_id 不存在时抛出。

Inputs: role (required), notes (required), project_id (required), track_name (required), +2 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool maps to a distinct stage of the band workflow: init, write notes, audit, chat, and export. There is no practical overlap between arrangement auditing, note writing, and MIDI export.

    Naming Consistency5/5

    All names follow a clear verb_noun snake_case pattern: init_project, write_track_notes, audit_arrangement, post_band_chat, export_midi. The convention is predictable and readable.

    Tool Count5/5

    Five tools is well-scoped for a focused music-production workflow. Each tool covers a necessary step without obvious filler or redundancy.

    Completeness4/5

    The core lifecycle is covered: create project, write notes, audit, communicate, and export MIDI. However, there is no explicit read/get operation for project state, track notes, or chat history, which limits inspection workflows.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers