DJ Claude

AI 与智能体

by p-poss

Agents 现在可以一边工作,一边为你、为自己甚至彼此 live code 音乐并实时演奏。

什么是 DJ Claude

Agents 现在可以一边工作,一边为你、为自己甚至彼此 live code 音乐并实时演奏。

README

code
     _  _                _                 _
  __| |(_)        ___  | |  __ _  _   _  __| |  ___
 / _` || |       / __| | | / _` || | | |/ _` | / _ \
| (_| || |  _   | (__  | || (_| || |_| | (_| ||  __/
 \__,_|| | (_)   \___| |_| \__,_| \__,_|\__,_| \___|
      _/ |
     |__/

DJ Claude

The live music engine for AI agents.

npm License: MIT GitHub

<!-- Screenshots --> <!-- ![DJ Claude TUI](docs/screenshots/tui.png) --> <!-- ![DJ Claude Web](docs/screenshots/web.png) -->

About

DJ Claude is the only music MCP server with multi-agent collaboration. Multiple AI agents connect over HTTP and jam together in real-time — one adds drums, another layers bass, a third drops a melody — and everything composes automatically. It works in your terminal, browser, or as a Claude Code plugin with slash commands. No browser tab, no API key, no external services required.

Under the hood, DJ Claude uses Strudel — a live coding environment for music — to generate and play patterns in real time. 20 MCP tools, 3 resources, conductor mode, mix snapshots, 22 presets, and 8 vibes. Agents can make music for you, themselves, and each other while they work.

Why DJ Claude?

  • Multi-agent jam sessions — the first music MCP where multiple agents connect over HTTP and build music together in real-time, each adding layers that compose automatically
  • Zero dependencies — no browser tab, no API key, no external services. Every tool works out of the box
  • Claude Code plugin — one-step install from the marketplace with 20 slash commands
  • Conductor mode — orchestrate a full band from a single directive, with auto-detected templates (jazz combo, rock band, electronic, ambient, and more)
  • Agent-native — 3 MCP resources teach any connected agent the Strudel language so it can compose original music, not just pick from presets

Ways to Play

ModeCommandDescription
Claude Code plugin/plugin install dj-claudeSlash commands + MCP server, one-step install
Web appclaude.djSingle-agent browser experience, no API key needed
Terminal TUInpx dj-claudeInteractive terminal DJ
TUI + Web audionpx dj-claude --browserTUI with browser audio engine for higher quality sound
Headlessnpx dj-claude --headless "lofi"Script and automation friendly, plays and exits (--duration N to set seconds, default 10)
MCP servernpx dj-claude-mcpFor AI agent integration (Cursor, Windsurf, Zed, etc.)
MCP HTTP servernpx dj-claude-mcp-httpMulti-agent jam sessions over HTTP

Terminal audio vs. browser audio: By default, the CLI and MCP server render audio through node-web-audio-api — a Node.js reimplementation of the Web Audio API. It works everywhere with zero setup, but sample playback and effects can sound rougher than a real browser engine. Add --browser (CLI) or set DJ_CLAUDE_BROWSER=1 (MCP) to route audio through your system browser's native Web Audio instead. This opens a background tab and produces noticeably higher quality sound — especially for pads, reverb, and layered patterns.

Quick Start

Prerequisites

  • Node.js >= 18
  • Anthropic API key — optional. Enables AI-generated music from text prompts. Without it, every tool still works via presets, direct Strudel code, or the code/layers parameters

Install & Run

bash
# Set your API key (or add to a .env file)
export ANTHROPIC_API_KEY=sk-ant-...

# Launch the terminal DJ
npx dj-claude

Or install globally:

bash
npm i -g dj-claude
dj-claude

Or go headless for scripting:

bash
npx dj-claude --headless "jazzy lo-fi beats" --duration 30

Claude Code Plugin

The easiest way to use DJ Claude with Claude Code. Installs the MCP server and gives you slash commands.

Install

code
/plugin marketplace add p-poss/dj-claude
/plugin install dj-claude@dj-claude-marketplace

Slash Commands

CommandDescription
/dj-claude:play [prompt]Play music from a description
/dj-claude:play-preset [name]Play from 22 curated patterns
/dj-claude:vibe [mood]Set the vibe — chill, dark, hype, focus, funky, dreamy, weird, epic
/dj-claude:live-mix [prompt]Autonomous DJ set — 5-6 evolving stages in one turn
/dj-claude:jam [role] [prompt]Add a layer to the jam session (drums, bass, melody, etc.)
/dj-claude:jam-clear [role]Remove one or all layers from the jam
/dj-claude:jam-statusShow all active jam layers
/dj-claude:hushStop all music
/dj-claude:now-playingCheck what's currently playing
/dj-claude:strudel [code]Evaluate raw Strudel code directly
/dj-claude:browserSwitch between Node and browser audio backends mid-session
/dj-claude:context [activity]Set coding context so music adapts to your work
/dj-claude:preview [role] [prompt]Preview a jam layer without adding it
/dj-claude:analyzeAnalyze the mix for frequency balance and suggestions
/dj-claude:conduct [directive]Orchestrate a full band from a single directive
/dj-claude:save [name]Save the current mix as a named snapshot
/dj-claude:load [name]Restore a saved mix snapshot
/dj-claude:list-savesList all saved snapshots
/dj-claude:exportExport current Strudel code with header comments
/dj-claude:connect [port]Start HTTP server and configure project for multi-agent jam sessions

Or just ask naturally — Claude will call the right tool:

code
> play some chill lo-fi while I work on this PR
> set the vibe to hype
> hush

Auto-Allow Permissions

By default, Claude Code prompts for permission on every MCP tool call. To let DJ Claude play without interruptions, add this to .claude/settings.json:

json
{
  "permissions": {
    "allow": [
      "mcp__dj-claude__play_music",
      "mcp__dj-claude__play_strudel",
      "mcp__dj-claude__set_vibe",
      "mcp__dj-claude__live_mix",
      "mcp__dj-claude__hush",
      "mcp__dj-claude__now_playing",
      "mcp__dj-claude__jam",
      "mcp__dj-claude__jam_clear",
      "mcp__dj-claude__jam_status",
      "mcp__dj-claude__set_context",
      "mcp__dj-claude__jam_preview",
      "mcp__dj-claude__mix_analysis",
      "mcp__dj-claude__conduct",
      "mcp__dj-claude__conduct_evolve",
      "mcp__dj-claude__snapshot_save",
      "mcp__dj-claude__snapshot_load",
      "mcp__dj-claude__snapshot_list",
      "mcp__dj-claude__export_code",
      "mcp__dj-claude__play_preset",
      "mcp__dj-claude__switch_audio"
    ]
  }
}

MCP Server (Manual Setup)

For the full MCP tool reference, keyless operation guide, and multi-agent details, see docs/MCP.md.

If you prefer manual configuration, or want to use DJ Claude with other MCP clients (Cursor, Windsurf, Zed, etc.), add this to your .mcp.json:

json
{
  "mcpServers": {
    "dj-claude": {
      "command": "npx",
      "args": ["-y", "dj-claude-mcp"]
    }
  }
}

For higher quality audio through the browser's Web Audio engine:

json
{
  "mcpServers": {
    "dj-claude": {
      "command": "npx",
      "args": ["-y", "dj-claude-mcp"],
      "env": {
        "DJ_CLAUDE_BROWSER": "1"
      }
    }
  }
}

MCP Tools

Every tool works without an API key — use the code/layers params to pass Strudel directly, or use play_preset/set_vibe for zero-effort music. Add ANTHROPIC_API_KEY to unlock AI generation from text prompts.

ToolDescriptionKeyless?
play_presetPlay from the curated preset library (22 patterns across mood, genre, activity)Yes
play_musicPlay music — via prompt (AI) or code (direct Strudel)Yes, via code
play_strudelEvaluate raw Strudel/Tidal code directlyYes
set_vibeSet the mood — chill, dark, hype, focus, funky, dreamy, weird, epicYes
live_mixAutonomous DJ set — via prompt (AI) or stages_code (array of Strudel)Yes, via stages_code
jamAdd/update a layer — via prompt (AI) or code (direct Strudel)Yes, via code
jam_clearRemove one or all layers from the jam sessionYes
jam_statusShow all active layers with their role names and codeYes
jam_previewPreview a jam layer without adding it — via prompt or codeYes, via code
conductOrchestrate a full band — via directive (AI) or layers mapYes, via layers
conduct_evolveEvolve layers — via directive (AI) or layers mapYes, via layers
mix_analysisAnalyze the mix for frequency balance, gains, and suggestionsYes
hushStop all music playbackYes
now_playingCheck what's currently playingYes
switch_audioSwitch between Node and browser audio backends at runtimeYes
set_contextSet coding context so music adapts to your activityYes
snapshot_saveSave the current mix as a named snapshotYes
snapshot_loadRestore a previously saved snapshotYes
snapshot_listList all saved snapshotsYes
export_codeExport current Strudel code with header commentsYes

MCP Resources

The server exposes Strudel knowledge as MCP resources so agents can learn the syntax and write their own code:

ResourceDescription
strudel://referenceComplete Strudel syntax reference — core functions, mini-notation, effects, modulation
strudel://rolesMusical role guidance for building jam layers (drums, bass, melody, chords, etc.)
strudel://examplesWorking Strudel patterns from the preset library, organized by mood, genre, and activity

Agents can read these resources, learn the syntax, and then call play_music(code: ...), jam(code: ...), or conduct(layers: ...) — no API key needed.

Keyless Operation

Every tool works without ANTHROPIC_API_KEY. There are three tiers of keyless usage:

1. Zero effort — presets and vibes

code
play_preset(name: "jazz")          # 22 curated patterns
set_vibe(mood: "chill")            # 8 mood presets

2. Direct code — agent writes Strudel

code
play_music(code: 'stack(s("bd*4").gain(0.75), note("c2").s("sawtooth").lpf(300))')
jam(role: "drums", code: 's("bd*4").gain(0.75)')
conduct(layers: { drums: 's("bd*4")', bass: 'note("c1").s("sine")' })

3. Full power — agent learns Strudel from resources

An agent can read strudel://reference to learn the complete syntax, strudel://roles for layer-building guidance, and strudel://examples for working patterns — then compose its own original Strudel code.

This means any AI agent connected via MCP can make music, regardless of whether ANTHROPIC_API_KEY is set. The calling agent IS the LLM.

Multi-Agent Jam Session

Multiple agents can collaborate on music in real time using the HTTP transport and jam tools. Each connected client gets its own MCP session, but they all share the same audio engine and layer state — one agent adds drums while another adds bass, and the layers compose automatically with stack().

Claude Code

Run /dj-claude:connect to auto-start the HTTP server and configure your project in one step:

code
/dj-claude:connect
/dj-claude:connect 8080   # custom port

This starts the HTTP MCP server, writes .mcp.json, and all other Claude Code sessions in the same project auto-connect.

Other agents (Cursor, Windsurf, OpenClaw, etc.)

Start the HTTP server manually:

bash
# Default port 4321
npx dj-claude-mcp-http

# Or with a custom port
DJ_CLAUDE_PORT=8080 npx dj-claude-mcp-http

Then point your MCP client at the endpoint:

json
{
  "mcpServers": {
    "dj-claude-http": {
      "type": "http",
      "url": "http://127.0.0.1:4321/mcp"
    }
  }
}

Jam tool workflow

With AI generation (requires API key):

code
Agent 1: jam(role: "drums", prompt: "four-on-the-floor house kick")
Agent 2: jam(role: "bass", prompt: "deep sub bass in C minor")

With direct code (no API key):

code
Agent 1: jam(role: "drums", code: 's("bd*4").gain(0.75)')
Agent 2: jam(role: "bass", code: 'note("c1 ~ c1 ~").s("sawtooth").lpf(300).gain(0.5)')
Agent 1: jam_status               # see all active layers
Agent 2: jam_clear(role: "bass")  # remove just the bass layer

Conductor Mode

Orchestrate a full band from a single directive — conduct generates multiple layers at once.

With AI generation (requires API key):

code
conduct(directive: "jazz combo in C minor, late night mood")
# → creates drums, bass, chords, melody layers automatically

With direct code (no API key):

code
conduct(layers: {
  drums: 's("bd*4").gain(0.75)',
  bass: 'note("c1 ~ c1 ~").s("sawtooth").lpf(300).gain(0.5)',
  chords: 'note("<[c3,eb3,g3] [ab2,c3,eb3]>/2").s("triangle").gain(0.3)'
})

Band templates are auto-detected from the directive:

  • jazz combo — drums, bass, chords, melody
  • rock band — drums, bass, chords, lead
  • electronic — drums, bass, pads, lead, fx
  • ambient — pads, atmosphere, fx, melody
  • full band — drums, bass, chords, melody, pads, fx
  • minimal — drums, bass, melody
  • orchestral — bass, chords, pads, melody, fx, atmosphere

Use conduct_evolve to evolve all layers through stages:

code
conduct_evolve(directive: "shift darker", stages: 3)
# → evolves each layer 3 times with 15s pauses

# Or provide evolved code directly (no API key):
conduct_evolve(layers: { drums: 's("bd ~ sd ~").gain(0.7)' })

Mix Snapshots

Save and restore your mixes:

code
snapshot_save(name: "verse1")    # save the current mix
snapshot_save(name: "drop")      # save another version
snapshot_list                    # see all saved snapshots
snapshot_load(name: "verse1")    # restore and resume playback
export_code                      # get raw Strudel code with headers

Terminal TUI Features

  • Live pattern visualization — a real-time ASCII pianoroll and drum grid appears between DancingClaude and the code display while music is playing, showing note positions and rhythm patterns synchronized to the audio
  • DancingClaude — animated pixel art that dances to the beat
  • Live code display — shows the current Strudel pattern as it streams in

Keyboard Shortcuts (TUI)

KeyAction
EnterSubmit prompt
qQuit
EscPause / resume music
rRevert to previous pattern

Web App

Visit claude.dj for the single agent browser experience — no API key or install needed.

Features:

  • 5 club themes — Anthropic, Gemini, Codex, Fairlight, OpenClaw
  • NIGHT mode (color inversion), DISCO mode (rainbow hue cycling), RAVE mode (glow + CRT scanlines)
  • LIVE MIX mode — autopilot DJ that automatically evolves the music every ~60 seconds without user input
  • Voice DJ commentary with idle hype phrases (via ElevenLabs TTS)
  • Dancing Claude that follows your cursor
  • Live Strudel code display with export to clipboard
  • Space bar to toggle play/pause

Environment Variables

VariableRequiredDescription
ANTHROPIC_API_KEYNoEnables AI generation from text prompts. Without it, all tools still work — use play_preset, set_vibe, play_strudel, or pass Strudel code via the code/layers/stages_code parameters
ELEVENLABS_API_KEYNo (web only)Enables voice DJ commentary
DJ_CLAUDE_BROWSERNoSet to 1 for browser audio backend in MCP mode
DJ_CLAUDE_PORTNoHTTP server port for multi-agent mode (default: 4321)
DJ_CLAUDE_MODELNoClaude model for CLI/MCP (default: claude-sonnet-4-6)
DJ_CLAUDE_MAX_TOKENSNoMax response tokens for CLI/MCP (default: 16384)

The CLI also loads .env and .env.local files from your project directory automatically.

Architecture

DJ Claude is a Next.js app with a companion CLI package:

  • /app — Next.js web frontend (claude.dj)
  • /cli — Terminal TUI (Ink/React) and MCP server
  • /cli/src/mcp — MCP tool definitions and JSON-RPC server
  • /cli/src/audio — Strudel audio engine (node + browser backends)
  • /cli/src/lib — Shared utilities, Claude API client, prompt generation
  • /plugin — Claude Code plugin (skills, MCP config, marketplace)

Music is generated by Claude composing Strudel live-coding patterns, which are then evaluated in real-time through either the Node node-web-audio-api backend or the browser's native Web Audio API.

Platform Support

Works on macOS, Windows, and Linux. On Linux, the Node audio backend (node-web-audio-api) requires JACK or PipeWire-JACK — vanilla ALSA/PulseAudio alone won't work with the prebuilt binaries. Use --browser mode to bypass this by routing audio through your browser instead.

Creator

Built by Patrick Posshey@patrickposs.com

License

MIT

常见问题

DJ Claude 是什么?

Agents 现在可以一边工作,一边为你、为自己甚至彼此 live code 音乐并实时演奏。

相关 Skills

Claude接口

by anthropics

Universal
热门

面向接入 Claude API、Anthropic SDK 或 Agent SDK 的开发场景,自动识别项目语言并给出对应示例与默认配置,快速搭建 LLM 应用。

想把Claude能力接进应用或智能体,用claude-api上手快、兼容Anthropic与Agent SDK,集成路径清晰又省心

AI 与智能体
未扫描114.1k

RAG架构师

by alirezarezvani

Universal
热门

聚焦生产级RAG系统设计与优化,覆盖文档切块、检索链路、索引构建、召回评估等关键环节,适合搭建可扩展、高准确率的知识库问答与检索增强应用。

面向RAG落地,把知识库、向量检索和生成链路系统串联起来,做架构设计时更清晰,也更少踩坑。

AI 与智能体
未扫描10.2k

计算机视觉

by alirezarezvani

Universal
热门

聚焦目标检测、图像分割与视觉系统落地,覆盖 YOLO、DETR、Mask R-CNN、SAM 等方案,适合定制数据集训练、推理优化及 ONNX/TensorRT 部署。

把目标检测、图像分割到推理部署串成完整工程链路,主流框架与 YOLO、DETR、SAM 等方案都覆盖,落地视觉 AI 会省心很多。

AI 与智能体
未扫描10.2k

相关 MCP Server

顺序思维

编辑精选

by Anthropic

热门

Sequential Thinking 是让 AI 通过动态思维链解决复杂问题的参考服务器。

这个服务器展示了如何让 Claude 像人类一样逐步推理,适合开发者学习 MCP 的思维链实现。但注意它只是个参考示例,别指望直接用在生产环境里。

AI 与智能体
83.4k

知识图谱记忆

编辑精选

by Anthropic

热门

Memory 是一个基于本地知识图谱的持久化记忆系统,让 AI 记住长期上下文。

帮 AI 和智能体补上“记不住”的短板,用本地知识图谱沉淀长期上下文,连续对话更聪明,数据也更可控。

AI 与智能体
83.4k

PraisonAI

编辑精选

by mervinpraison

热门

PraisonAI 是一个支持自反思和多 LLM 的低代码 AI 智能体框架。

如果你需要快速搭建一个能 24/7 运行的 AI 智能体团队来处理复杂任务(比如自动研究或代码生成),PraisonAI 的低代码设计和多平台集成(如 Telegram)让它上手极快。但作为非官方项目,它的生态成熟度可能不如 LangChain 等主流框架,适合愿意尝鲜的开发者。

AI 与智能体
6.8k

评论