reaper-mcp / reaper
CLAUDE.md42 starsChanged 5 days agoMITView on GitHub
Files installed INTO the REAPER DAW by the setup command. These run inside REAPER's scripting environment.
In this repository12 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- knowledge/CLAUDE.mdCLAUDE.md
- changelog-highlightSkill
- critiqueSkill
- editingSkill
- learn-pluginSkill
- make-pluginSkill
- masteringSkill
- mixerSkill
- mix-memorySkill
- new-extensionSkill
- teachSkill
The file
We split this CLAUDE.md into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 61
Always wrap file reads in pcall for resilience
- Distinctive: line 65
Run in REAPER's audio thread (not scripting thread)
- Distinctive: line 68
Must pass audio through unmodified (transparent inserts)
- Very specific: line 76
Check REAPER's real behaviour live before trusting the fake: some calls ignore arguments without an error (e.g.
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
REAPER Scripts
Files installed INTO the REAPER DAW by the setup command. These run inside REAPER's scripting environment.
Files
| File | Language | Purpose |
mcp_bridge.lua | Lua | Persistent bridge: polls for JSON commands, executes ReaScript API, writes responses |
mcp_tracks_lib.lua | Lua | Track structure and routing |
mcp_plan_lib.lua | Lua | run_plan executor, JSON decoder, chunk helpers |
mcp_actions_lib.lua | Lua | Action search/run proxy, selection setters |
mcp_project_lib.lua | Lua | Project ops, render settings, tempo map, markers |
mcp_items_lib.lua | Lua | Items, takes, take FX, FX chains, track templates, stem tracks (insert_stems) |
mcp_recording_lib.lua | Lua | Record inputs, monitoring and modes, punch, fixed lanes, comping |
mcp_arrange_lib.lua | Lua | Copy items, insert/remove time, copy a section, normalize/reverse/glue |
mcp_envelopes_lib.lua | Lua | Envelopes, points (dB through the envelope's scaling), pooled automation items |
mcp_mixing_lib.lua | Lua | Automation mode, FX modulation and pins, monitoring FX, freeze, apply FX, stretch markers and audio quantize |
mcp_render_lib.lua | Lua | Track renders for the analysis tools: cache, multi-track stem pass, macOS focus hand-back |
mcp_midi_lib.lua | Lua | Quantize, transform, MIDI file import, pitch-class profile for detect_key, bar/beat grid + per-segment profiles for detect_chords |
mcp_edit_views_lib.lua | Lua | Status page results and before/after edit views |
mcp_snapshot_lib.lua | Lua | Shared library for snapshot action scripts (path helpers, JSON, restore logic) |
mcp_prefs_lib.lua | Lua | Keeps the page's read-only (lk_ro_) LoreKit token in ~/.config/reaper-mcp/lorekit.json (mode 600) and the feature-flag overrides in flags.json (ExtState flag_overrides / flags_req, the same file the CLI and server read) so every way of opening the page shares them; bridge holds it in ext.prefs (the bridge is at Lua's 200-locals limit: add no top-level local) |
mcp_snapshots_ui_lib.lua | Lua | Status page Snapshots view: lists the folder, runs page restore/save requests through the bridge's dispatcher |
mcp_snapshot_next.lua | Lua | Action: restore next snapshot (bind to key for A/B testing) |
mcp_snapshot_prev.lua | Lua | Action: restore previous snapshot (bind to key for A/B testing) |
mcp_snapshot_quick_save.lua | Lua | Action: save snapshot with auto-name, no dialog |
mcp_analyzer.jsfx | JSFX/EEL2 | Real-time FFT spectrum analyzer, writes to gmem[] |
mcp_lufs_meter.jsfx | JSFX/EEL2 | LUFS loudness metering |
mcp_correlation_meter.jsfx | JSFX/EEL2 | Stereo correlation and width analysis |
mcp_crest_factor.jsfx | JSFX/EEL2 | Crest factor (peak-to-RMS) measurement |
mcp_gain_trace.jsfx | JSFX/EEL2 | Pre/post gain trace for pumping/ducking: pair it around a chain (Mode pre/post, same Slot), read p5/p1/std after playback. No 1e9-style literals (EEL2 rejects them; jsfx-lint.test.ts checks) |
mcp_ui.jsfx-inc | JSFX/EEL2 | The @gfx toolkit generated plugins inline (write_jsfx pastes it into their @init). Canonical source: edit here, never in a generated plugin. Globals are ui_-prefixed; sliders must be unnamed; no 1e9-style literals |
install.sh | Shell | Manual install helper |
Lua Bridge (mcp_bridge.lua)
How It Works
- Runs as a persistent
reaper.defer()loop (polls every ~30ms) - Reads
command_{uuid}.jsonfrom bridge directory - Dispatches to handler function in the
handlerstable - Writes
response_{uuid}.jsonwith results - Writes
heartbeat.jsonevery 1s for liveness detection (removed on exit). At start, a fresh heartbeat in the folder means another bridge serves it: the new one waits up to 6 s (a restarting bridge stops writing it) and then stands down with a console message, because two bridges on one folder would split the commands between two REAPERs. A second REAPER needs its own resource folder (reaper-mcp instance create). The whole startup lives inrun_bridge()since the main chunk is at the 200-locals limit - Publishes a status feed to ExtState
MCPBridge/statusfor the web status page (apps/bridge-ui)
Adding a Handler
handlers["command_type"] = function(params)
local result = reaper.SomeApiCall(params.paramName)
return { field = result }
endThe command type string must exactly match CommandType in libs/protocol/src/commands.ts.
Key Constraints
- REAPER Lua is sandboxed: no sockets, no HTTP, no stdin/stdout — file-based IPC only
- JSON parsing: uses
CF_Json_Parseif available (REAPER 7+), falls back to custom Lua parser - Track indices are 0-based (same as ReaScript)
- Volume values: bridge converts between dB (MCP protocol) and linear (ReaScript internally)
- Always wrap file reads in
pcallfor resilience
JSFX Meters
- Run in REAPER's audio thread (not scripting thread)
- Communicate with Lua via
gmem[]shared memory - Each JSFX uses a unique gmem namespace (e.g.,
MCPAnalyzer,MCPLufsMeter) - Must pass audio through unmodified (transparent inserts)
- Auto-inserted by corresponding MCP tools (
read_track_spectrum,read_track_lufs, etc.)
Testing
- Lua runs in tests through wasmoon (Lua 5.4 in WebAssembly) against a fake
reaperAPI: the*_lib.luafiles are pure (they take the API as an argument) and are tested in*-lib.test.ts; the whole bridge runs inbridge-*.test.ts. Put new logic in a lib, not inmcp_bridge.lua(its main chunk is at Lua's 200-locals limit) - Check REAPER's real behaviour live before trusting the fake: some calls ignore arguments without an error
(e.g.
SetEnvelopePointExwith a flagged automation item index), and the fake should model what you saw - Server-side tests stub
sendCommand()inbridge.ts
Installation
Files are copied to {REAPER_RESOURCE_PATH}/Scripts/ by:
node dist/apps/reaper-mcp-server/main.js setup(programmatic)install.sh(manual)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

