live-coding-music-mcp

v4.1.1
@williamzujkowski/live-coding-music-mcp Checked 2 days ago Published 1 month ago

MCP 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…

ParameterTypeDescription
auto_playbooleanStart playback after write (mode=write only, default: false)
codestringCode to append/insert (mode=append/insert)
modestringWhich edit operation to perform (default: write)
patternstringPattern code (mode=write)
positionnumbermode=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.
replacestringReplacement text (mode=replace)
replace_allbooleanmode=replace: replace every occurrence instead of just the first (default false)
searchstringText to replace (mode=replace)
session_idstringOptional session ID (#108). Omit to use default session.
validatebooleanValidate pattern before write (mode=write only, default: true)

get_pattern

Get current pattern code

ParameterTypeDescription
session_idstringOptional 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.

ParameterTypeDescription
action *stringTransport action
session_idstringOptional 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…

ParameterTypeDescription
op *stringWhich transform to apply
amountnumberop=humanize/swing: amount 0-1
factornumberop=stretch: stretch factor
gridstringop=quantize: grid size (e.g. "1/16")
rootstringop=scale: root note (e.g. "C")
scalestringop=scale: scale name (e.g. "minor")
semitonesnumberop=transpose: integer semitones to shift
session_idstringOptional session ID (#108). Omit to use default session.
typestringop=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.

ParameterTypeDescription
action *stringadd or remove the effect
effect *stringEffect name (e.g. lpf, room, delay)
paramsstringEffect parameters (action=add only)
session_idstringOptional session ID (#108). Omit to use default session.

set_tempo

Set BPM. Writes setcpm(bpm/4), assuming one bar of 4/4 per cycle.

ParameterTypeDescription
bpm *numberTempo in BPM
session_idstringOptional 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.

ParameterTypeDescription
dimension *stringWhich dimension to shape along
auto_playbooleanStart playback after shape (default true)
directionstringdimension=refine: faster, slower, louder, quieter, brighter, darker, "more reverb", drier
intensitynumberdimension=mood: intensity 0-1 (default 0.5)
levelnumberdimension=energy: integer level 0-10
session_idstringOptional session ID (#108). Omit to use default session.
target_moodstringdimension=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.

ParameterTypeDescription
role *stringWhich part to generate
barsnumberrole=fill: number of bars (default 1)
complexitynumberrole=drums: complexity 0-1 (default 0.5)
keystringrole=bass: musical key
lengthnumberrole=melody: number of notes (default 8)
rootstringrole=melody: root note
scalestringrole=melody: scale name
session_idstringOptional session ID (#108). Omit to use default session.
stylestringrole=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.

ParameterTypeDescription
query *stringWhich theory query
keystringKey (query=chord_progression)
rootstringRoot note (query=scale; also used as key for chord_progression)
scalestringScale type (query=scale)
session_idstringOptional session ID (#108). Omit to use default session.
stylestringStyle (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.

ParameterTypeDescription
type *stringRhythm type
hitsnumbertype=euclidean: hits count
patternsarraytype=polyrhythm: pattern numbers per layer
session_idstringOptional session ID (#108). Omit to use default session.
soundstringtype=euclidean: sound to use (default bd)
soundsarraytype=polyrhythm: sounds per layer
stepsnumbertype=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: ["…

ParameterTypeDescription
includearrayWhich analyses to return. Default ["all"] preserves pre-consolidation behaviour.
session_idstringOptional session ID (#108). Omit to use default session.

validate_pattern_runtime

Validate pattern with runtime error checking (monitors Strudel console for errors)

ParameterTypeDescription
pattern *stringPattern code to validate
session_idstringOptional session ID (#108). Omit to use default session.
waitMsnumberHow 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)

ParameterTypeDescription
pattern *stringPattern code to validate

analyze_pattern_local

Static analysis (events/cycle, complexity, optional BPM) without browser playback

ParameterTypeDescription
pattern *stringPattern code to analyze

query_pattern_events

Enumerate events the pattern would emit between two cycle indices (max 16 cycles)

ParameterTypeDescription
pattern *stringPattern code to query
endnumberEnd cycle (default 1)
startnumberStart cycle (default 0)

transpile_pattern

Transpile pattern source via StrudelEngine; returns transpiled code or syntax error

ParameterTypeDescription
pattern *stringPattern 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.

ParameterTypeDescription
action *stringWhich on-disk operation to perform
namestringPattern name (required for save/load)
overwritebooleansave 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_idstringOptional session ID (#108). Sources/targets the named session's current pattern; the on-disk catalog is shared across sessions.
tagstringFilter by tag (list only)
tagsarrayTags 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…

ParameterTypeDescription
data *stringFor source=base64: base64-encoded .mid bytes (≤1MB decoded). For source=path: basename of a .mid file under ./patterns/midi/ (path-traversal blocked).
source *stringHow to interpret `data` — raw base64 bytes or a filename under patterns/midi/
barsnumberCap on bars to emit. Default: full file.
drum_mapobjectOptional 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_cyclenumberGrid 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…

ParameterTypeDescription
action *stringWhich history operation to perform
idnumberHistory entry ID (action=restore)
id1numberFirst entry ID (action=compare)
id2numberSecond entry ID (action=compare, default: current pattern)
limitnumberMaximum entries (action=list, default 10)
session_idstringOptional 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…

ParameterTypeDescription
levelstringWhich diagnostic surface to read (default: full)
session_idstringOptional 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.

ParameterTypeDescription
action *stringWindow action
filenamestringaction=screenshot: optional output filename
session_idstringOptional 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.

ParameterTypeDescription
style *stringGenre: 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_playbooleanStart playback immediately (default: true)
get_feedbackbooleanGet AI feedback on the generated pattern (default: false)
keystringMusical key (default: C)
session_idstringOptional session ID (#108). Omit to use default session. compose auto-init only applies to default session — named sessions must already exist.
temponumberBPM (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…

ParameterTypeDescription
task *stringWhich AI task
auto_playbooleantask=jam: start playback after merge (default true)
includeAudiobooleantask=feedback: include audio analysis (default false)
layerstringtask=jam: layer type to generate
rolestringtask=suggest: role the suggested pattern fills (default complement)
session_idstringOptional session ID (#108). Omit to use default session.
stylestringtask=feedback/suggest: style hint
style_hintstringtask=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).

ParameterTypeDescription
action *stringCapture action
durationnumberaction=sample: duration ms (100-60000, default 5000)
formatstringaction=start: audio format (default webm)
maxDurationnumberaction=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_idstringOptional 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" }).

ParameterTypeDescription
durationnumberWindow to record in ms (100-30000, default 5000)
filenamestringOutput filename; reduced to a basename and confined to the export directory
formatstringOutput format (default wav)
outputstringfile (default) writes to disk and returns a path; base64 returns bytes inline
session_idstringOptional 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.

ParameterTypeDescription
bpmnumberTempo in BPM (default: the pattern's own tempo, or 120 if it declares none)
durationnumberExport duration in bars (default: 4)
filenamestringOutput filename (optional, default: pattern.mid)
formatstringOutput format: file or base64 (default: base64)
session_idstringOptional 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…

ParameterTypeDescription
action *stringSession lifecycle action
session_idstringSession identifier (required for create/destroy/switch)