live-coding-music-mcp
v4.1.1MCP server (unofficial, fan project) for AI-assisted live-coding music via strudel.cc.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
init
Initialize Strudel in browser
edit_pattern
Mutate the current session pattern. mode=write replaces the editor contents (default; mirrors the old write tool exactly, including optional pattern validation and auto_play). mode=append concatenates `code` after the current pattern with a newline. mode=insert places `code` at the given line `position`. mode=replace substitutes `search` with `replace` — the first occurrence only, unless replace_all is true. The response reports how many occurrences matched, were replaced, and remain. mode=clear empties the editor. Example: edit_pattern({ mode: "write", pattern: "s(\"bd\")", auto_play: true…
| Parameter | Type | Description |
|---|---|---|
auto_play | boolean | Start playback after write (mode=write only, default: false) |
code | string | Code to append/insert (mode=append/insert) |
mode | string | Which edit operation to perform (default: write) |
pattern | string | Pattern code (mode=write) |
position | number | mode=insert: 0-indexed line to insert BEFORE. 0 puts the code at the top; a value equal to the line count appends. Out of range is an error, not an append. |
replace | string | Replacement text (mode=replace) |
replace_all | boolean | mode=replace: replace every occurrence instead of just the first (default false) |
search | string | Text to replace (mode=replace) |
session_id | string | Optional session ID (#108). Omit to use default session. |
validate | boolean | Validate pattern before write (mode=write only, default: true) |
get_pattern
Get current pattern code
| Parameter | Type | Description |
|---|---|---|
session_id | string | Optional session ID (#108). Omit to use default session. |
playback
Control transport on the current session. action=play starts the editor pattern. action=pause halts the clock where it is, so play resumes mid-cycle. action=stop ends playback. Example: playback({ action: "play" }). For pattern editing use edit_pattern; for tempo use set_tempo.
| Parameter | Type | Description |
|---|---|---|
action * | string | Transport action |
session_id | string | Optional session ID (#108). Omit to use default session. |
transform
Apply a single transform op to the current session pattern. op=transpose shifts notes by `semitones`. op=reverse appends `.rev` to the pattern. op=stretch slows by `factor` (>1 slower, <1 faster). op=quantize snaps to the `grid` (e.g. "1/16"). op=humanize adds rand-nudge timing of `amount` (0-1). op=swing applies `.swing(amount)`. op=scale applies a `root`/`scale` filter to notes. op=vary returns a variation of `type` (subtle/moderate/extreme/glitch/evolving). Example: transform({ op: "transpose", semitones: 7 }). For effects (add/remove) use effect; for mood/energy/refine use shape; for tempo…
| Parameter | Type | Description |
|---|---|---|
op * | string | Which transform to apply |
amount | number | op=humanize/swing: amount 0-1 |
factor | number | op=stretch: stretch factor |
grid | string | op=quantize: grid size (e.g. "1/16") |
root | string | op=scale: root note (e.g. "C") |
scale | string | op=scale: scale name (e.g. "minor") |
semitones | number | op=transpose: integer semitones to shift |
session_id | string | Optional session ID (#108). Omit to use default session. |
type | string | op=vary: variation type (subtle/moderate/extreme/glitch/evolving) |
effect
Add or remove a Strudel effect on the current session pattern. action=add appends `.<effect>(<params>)`. action=remove strips EVERY `.<effect>(...)` call from the pattern, not just the last. Example: effect({ action: "add", effect: "lpf", params: "1000" }). For higher-level effect bundles (mood/energy/refine) use shape; for raw transforms use transform.
| Parameter | Type | Description |
|---|---|---|
action * | string | add or remove the effect |
effect * | string | Effect name (e.g. lpf, room, delay) |
params | string | Effect parameters (action=add only) |
session_id | string | Optional session ID (#108). Omit to use default session. |
set_tempo
Set BPM. Writes setcpm(bpm/4), assuming one bar of 4/4 per cycle.
| Parameter | Type | Description |
|---|---|---|
bpm * | number | Tempo in BPM |
session_id | string | Optional session ID (#108). Omit to use default session. |
shape
Shape the current pattern along one of three high-level dimensions. dimension=mood applies a mood profile (dark/euphoric/melancholic/aggressive/dreamy/peaceful/energetic) with optional intensity 0-1. dimension=energy applies an energy level (integer 0-10). dimension=refine applies a directional refinement: faster/slower/louder/quieter/brighter/darker/"more reverb"/drier. All three auto-play by default. Example: shape({ dimension: "mood", target_mood: "dark", intensity: 0.8 }). For raw transform ops use transform; for explicit effects use effect.
| Parameter | Type | Description |
|---|---|---|
dimension * | string | Which dimension to shape along |
auto_play | boolean | Start playback after shape (default true) |
direction | string | dimension=refine: faster, slower, louder, quieter, brighter, darker, "more reverb", drier |
intensity | number | dimension=mood: intensity 0-1 (default 0.5) |
level | number | dimension=energy: integer level 0-10 |
session_id | string | Optional session ID (#108). Omit to use default session. |
target_mood | string | dimension=mood: target mood |
generate_part
Generate a single instrumental layer and append it to the current session pattern. role=drums takes `style` (e.g. "techno"/"house") and optional `complexity` 0-1. role=bass takes `key` (e.g. "C") + `style`. role=melody takes `root`/`scale` (e.g. C/minor) and optional `length` (notes). role=fill takes `style` and optional `bars`. Example: generate_part({ role: "drums", style: "techno", complexity: 0.7 }). For full compositions use compose; for rhythmic patterns use generate_rhythm; for music-theory queries use music_theory.
| Parameter | Type | Description |
|---|---|---|
role * | string | Which part to generate |
bars | number | role=fill: number of bars (default 1) |
complexity | number | role=drums: complexity 0-1 (default 0.5) |
key | string | role=bass: musical key |
length | number | role=melody: number of notes (default 8) |
root | string | role=melody: root note |
scale | string | role=melody: scale name |
session_id | string | Optional session ID (#108). Omit to use default session. |
style | string | role=drums/bass/fill: musical style |
music_theory
Music-theory queries. query=scale returns the notes of a scale (e.g. "C major scale: C, D, E, F, G, A, B"). query=chord_progression returns a chord progression for the key/style AND writes the resulting chord pattern into the current session. Example: music_theory({ query: "scale", root: "C", scale: "major" }). For pattern generation (drums/bass/melody) use generate_part; for rhythmic patterns use generate_rhythm.
| Parameter | Type | Description |
|---|---|---|
query * | string | Which theory query |
key | string | Key (query=chord_progression) |
root | string | Root note (query=scale; also used as key for chord_progression) |
scale | string | Scale type (query=scale) |
session_id | string | Optional session ID (#108). Omit to use default session. |
style | string | Style (query=chord_progression: pop/jazz/blues/etc) |
generate_rhythm
Generate a rhythmic pattern and append it to the current session. type=euclidean produces a Euclidean rhythm with `hits` evenly distributed across `steps` (optional `sound` param, default "bd"). type=polyrhythm overlays multiple sound layers with given pattern numbers. Example: generate_rhythm({ type: "euclidean", hits: 3, steps: 8, sound: "hh" }). For complete patterns (drums/bass/melody) use generate_part; for whole compositions use compose.
| Parameter | Type | Description |
|---|---|---|
type * | string | Rhythm type |
hits | number | type=euclidean: hits count |
patterns | array | type=polyrhythm: pattern numbers per layer |
session_id | string | Optional session ID (#108). Omit to use default session. |
sound | string | type=euclidean: sound to use (default bd) |
sounds | array | type=polyrhythm: sounds per layer |
steps | number | type=euclidean: total steps |
analyze
Audio analysis on the currently-playing pattern. include=["all"] (default) returns the full spectrum + features object, matching the pre-consolidation behaviour. include=["tempo"] returns only BPM with confidence. include=["key"] returns detected key + scale + confidence. include=["spectrum"] returns FFT features (bass, mid, treble, brightness, etc.). include=["rhythm"] returns rhythm-only analysis (complexity, density, syncopation). Combining values returns an object keyed by category, e.g. analyze({ include: ["tempo", "key"] }) → { tempo: {...}, key: {...} }. Example: analyze({ include: ["…
| Parameter | Type | Description |
|---|---|---|
include | array | Which analyses to return. Default ["all"] preserves pre-consolidation behaviour. |
session_id | string | Optional session ID (#108). Omit to use default session. |
validate_pattern_runtime
Validate pattern with runtime error checking (monitors Strudel console for errors)
| Parameter | Type | Description |
|---|---|---|
pattern * | string | Pattern code to validate |
session_id | string | Optional session ID (#108). Omit to use default session. |
waitMs | number | How long to wait for errors (default 500ms) |
validate_pattern_local
Validate pattern syntax against the local StrudelEngine, which runs in a sandboxed child process (no browser required)
| Parameter | Type | Description |
|---|---|---|
pattern * | string | Pattern code to validate |
analyze_pattern_local
Static analysis (events/cycle, complexity, optional BPM) without browser playback
| Parameter | Type | Description |
|---|---|---|
pattern * | string | Pattern code to analyze |
query_pattern_events
Enumerate events the pattern would emit between two cycle indices (max 16 cycles)
| Parameter | Type | Description |
|---|---|---|
pattern * | string | Pattern code to query |
end | number | End cycle (default 1) |
start | number | Start cycle (default 0) |
transpile_pattern
Transpile pattern source via StrudelEngine; returns transpiled code or syntax error
| Parameter | Type | Description |
|---|---|---|
pattern * | string | Pattern code to transpile |
pattern_store
Persist patterns to disk and read them back. Use action=save to write the current session pattern under a name; action=load to restore a named pattern into the current session; action=list to enumerate the on-disk catalog (optionally filtered by tag). Example: pattern_store({ action: "save", name: "my-jam", tags: ["techno"] }). For session lifecycle (create/destroy/list active sessions) use the session tool — pattern_store deals with on-disk patterns, not runtime sessions.
| Parameter | Type | Description |
|---|---|---|
action * | string | Which on-disk operation to perform |
name | string | Pattern name (required for save/load) |
overwrite | boolean | save only: replace a pattern saved under a DIFFERENT name that maps to the same file (names are lowercased and stripped of punctuation, so "My Jam" and "my-jam" collide). Off by default; the replaced… |
session_id | string | Optional session ID (#108). Sources/targets the named session's current pattern; the on-disk catalog is shared across sessions. |
tag | string | Filter by tag (list only) |
tags | array | Tags to attach (save only) |
import_midi
Convert a .mid file into a playable Strudel pattern (Phase 1: literal transcription, #201). Use source="base64" with data=<base64 string> for inline bytes, or source="path" with data=<basename> to read from the patterns/midi/ directory (path traversal blocked). Drum tracks (MIDI channel 10) emit one s() lane per sample so simultaneous kicks/hats do not collide. Pitched tracks emit note("...").s("piano") with simultaneous notes merged into [a,b,c] chord tokens. Phase 2+ (structural compression, voice separation, LLM idiomatic pass) tracked in separate issues. Example: import_midi({ source: "pat…
| Parameter | Type | Description |
|---|---|---|
data * | string | For source=base64: base64-encoded .mid bytes (≤1MB decoded). For source=path: basename of a .mid file under ./patterns/midi/ (path-traversal blocked). |
source * | string | How to interpret `data` — raw base64 bytes or a filename under patterns/midi/ |
bars | number | Cap on bars to emit. Default: full file. |
drum_map | object | Optional override / extension to the default GM percussion map. Keys are MIDI note numbers (as strings, since JSON object keys), values are Strudel sample names. Example: { "60": "cp", "61": "rim" }.… |
steps_per_cycle | number | Grid resolution per bar (integer 1-64). Default 16. |
history
Navigate or inspect the pattern edit history. action=undo reverts the last edit on the targeted session. action=redo replays a previously-undone edit. action=list returns recent entries with timestamps and previews (limit defaults to 10). action=restore jumps the editor to a specific entry by id (current pattern goes on the undo stack). action=compare diffs two entries by id (or one entry vs current pattern). Example: history({ action: "list", limit: 5 }) — recent edits, newest first. For on-disk saved patterns use pattern_store — history deals with the in-memory edit timeline of the curre…
| Parameter | Type | Description |
|---|---|---|
action * | string | Which history operation to perform |
id | number | History entry ID (action=restore) |
id1 | number | First entry ID (action=compare) |
id2 | number | Second entry ID (action=compare, default: current pattern) |
limit | number | Maximum entries (action=list, default 10) |
session_id | string | Optional session ID (#108). Omit to use default session. Note: undo/redo/history stacks are currently server-wide; only the read/write target changes. |
diagnostics
Inspect server and browser state. level=status returns a quick state snapshot (cache read, <15ms SLA), plus which config.json was read and any warnings from it. level=full returns detailed browser diagnostics including caches, errors, and performance. level=perf returns server-side timing metrics + top bottlenecks. level=memory returns process memory usage. level=errors returns captured console errors and warnings from Strudel. Default level=full preserves the pre-consolidation behaviour. Example: diagnostics({ level: "status" }) — millisecond-cheap. For screenshots use browser_window; for t…
| Parameter | Type | Description |
|---|---|---|
level | string | Which diagnostic surface to read (default: full) |
session_id | string | Optional session ID (#108). Applies to level=status, full, errors. Ignored for perf/memory (server-wide metrics). |
browser_window
Interact with the visible Strudel browser window. action=show brings the window to the foreground. action=screenshot captures the current editor view to disk (optional `filename`). Example: browser_window({ action: "screenshot", filename: "demo.png" }). For diagnostics (status/errors/perf) use diagnostics; for the editor itself use edit_pattern.
| Parameter | Type | Description |
|---|---|---|
action * | string | Window action |
filename | string | action=screenshot: optional output filename |
session_id | string | Optional session ID (#108). Omit to use default session. compose auto-init only applies to default session — named sessions must already exist. |
compose
Generate, write, and play a complete pattern in one step. Auto-initializes default browser if needed.
| Parameter | Type | Description |
|---|---|---|
style * | string | Genre: techno, house, dnb, breakbeat, trap, jungle, ambient, experimental, intelligent_dnb, trip_hop, boom_bap. Anything else (jazz included) gets techno drums, and the response says so. |
auto_play | boolean | Start playback immediately (default: true) |
get_feedback | boolean | Get AI feedback on the generated pattern (default: false) |
key | string | Musical key (default: C) |
session_id | string | Optional session ID (#108). Omit to use default session. compose auto-init only applies to default session — named sessions must already exist. |
tempo | number | BPM (default: genre-appropriate) |
ai_assist
Gemini-backed pattern assistance. task=feedback returns creative critique on the current pattern (optionally with audio analysis). task=suggest analyzes the currently playing audio and suggests a complementary Strudel pattern as text (not auto-executed). task=jam generates a fresh layer (drums/bass/melody/pad/texture) and merges it into the current pattern, then auto-plays. All three share Gemini auth + rate limiting. Example: ai_assist({ task: "jam", layer: "bass" }). Needs GEMINI_API_KEY, or a logged-in claude/agy/codex CLI on PATH (#252). For non-AI pattern generation use generate_part; for…
| Parameter | Type | Description |
|---|---|---|
task * | string | Which AI task |
auto_play | boolean | task=jam: start playback after merge (default true) |
includeAudio | boolean | task=feedback: include audio analysis (default false) |
layer | string | task=jam: layer type to generate |
role | string | task=suggest: role the suggested pattern fills (default complement) |
session_id | string | Optional session ID (#108). Omit to use default session. |
style | string | task=feedback/suggest: style hint |
style_hint | string | task=jam: style guidance |
audio_capture
Record audio output from the live Strudel session. action=start begins streaming capture (optional `format` webm/opus, default webm). action=stop ends the stream and returns base64-encoded audio. action=sample captures a fixed-`duration` window in one call (100-60000ms, default 5000ms). Example: audio_capture({ action: "sample", duration: 3000 }). Audio must be playing for capture to record meaningful data. For MIDI export use export_midi; for runtime diagnostics use diagnostics. Each session has its own recorder, so captures in different sessions do not interfere (#180).
| Parameter | Type | Description |
|---|---|---|
action * | string | Capture action |
duration | number | action=sample: duration ms (100-60000, default 5000) |
format | string | action=start: audio format (default webm) |
maxDuration | number | action=start: stop the recorder automatically after this many ms. Defaults to 600000 (ten minutes); the recording so far is kept and returned by a later stop. |
session_id | string | Optional session ID (#108). Routes the capture to the named session, which has its own recorder — concurrent captures across sessions are safe (#180). |
export_audio
Record a window of live Strudel audio and write it to a file. Returns a path plus what was actually recorded, not a wall of base64 — prefer this over audio_capture when you want the audio to exist somewhere. format=wav (default) decodes to 16-bit PCM a DAW will open; format=webm writes the raw Opus recording. Reports silent captures instead of writing a silent file and claiming success. Audio must already be playing: call playback({ action: "play" }) first. Example: export_audio({ duration: 4000, filename: "take-01" }).
| Parameter | Type | Description |
|---|---|---|
duration | number | Window to record in ms (100-30000, default 5000) |
filename | string | Output filename; reduced to a basename and confined to the export directory |
format | string | Output format (default wav) |
output | string | file (default) writes to disk and returns a path; base64 returns bytes inline |
session_id | string | Optional session ID (#108). Routes the capture to the named session, which has its own recorder — concurrent captures across sessions are safe (#180). |
export_midi
Export current pattern to MIDI file. Parses note(), n(), and chord() functions.
| Parameter | Type | Description |
|---|---|---|
bpm | number | Tempo in BPM (default: the pattern's own tempo, or 120 if it declares none) |
duration | number | Export duration in bars (default: 4) |
filename | string | Output filename (optional, default: pattern.mid) |
format | string | Output format: file or base64 (default: base64) |
session_id | string | Optional session ID (#108). Routes the capture to the named session, which has its own recorder — concurrent captures across sessions are safe (#180). |
session
Manage isolated Strudel browser sessions (multi-session, #108). action=create starts a new named session (sessions share one browser but isolated contexts). action=destroy closes a named session and releases its resources. action=list returns metadata for all active sessions (id, created, last_activity, is_playing, is_default). action=switch changes the default session that subsequent tool calls route to when no session_id is passed. Example: session({ action: "create", session_id: "live-set-1" }). For the on-disk pattern catalog use pattern_store(action=list) — session(action=list) lists *r…
| Parameter | Type | Description |
|---|---|---|
action * | string | Session lifecycle action |
session_id | string | Session identifier (required for create/destroy/switch) |