@mthines/reaper-mcp 0.72.0 → 0.73.0-beta.80.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -37
- package/main.js +135 -33
- package/package.json +1 -1
- package/sidecar/server.py +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
3
|
<picture>
|
|
4
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
5
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/logo-dark.svg">
|
|
5
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/logo.svg" alt="reaper-mcp" width="360">
|
|
6
6
|
</picture>
|
|
7
7
|
|
|
8
8
|
<br><br>
|
|
9
9
|
|
|
10
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
10
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/hero.svg" alt="reaper-mcp — Mix by asking. Type what you hear and an AI mix engineer inside your REAPER session does it." width="100%">
|
|
11
11
|
|
|
12
12
|
<br>
|
|
13
13
|
|
|
@@ -21,7 +21,7 @@ You chat in plain English in Claude Code, by keyboard (or dictation, if you like
|
|
|
21
21
|
[](https://claude.com/claude-code)
|
|
22
22
|
[](https://lorekit.io)
|
|
23
23
|
[](#-install-in-3-steps)
|
|
24
|
-
[](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
24
|
+
[](https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/LICENSE)
|
|
25
25
|
|
|
26
26
|
[**Install in 3 steps**](#-install-in-3-steps) · [See it work](#-just-type-what-you-hear) · [What you get](#-why-producers-use-it) · [Watch it work](#-see-what-your-agent-is-doing) · [Extensions](#-extensions-teach-it-your-plugin) · [FAQ](#-faq)
|
|
27
27
|
|
|
@@ -48,7 +48,7 @@ with your OS if you prefer, it's the same thing to the agent):
|
|
|
48
48
|
|
|
49
49
|
Here's what happens next:
|
|
50
50
|
|
|
51
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
51
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/session-demo.svg" alt="Illustrative session: the mixer saves a snapshot, measures, cuts the guitars where they mask the vocal, compresses the vocal, re-measures and saves an after snapshot." width="100%">
|
|
52
52
|
|
|
53
53
|
It isn't a preset and it isn't a guess. Before it touches anything it **measures your
|
|
54
54
|
actual tracks** (loudness, spectrum, stereo width, dynamics). It makes the change with
|
|
@@ -96,7 +96,7 @@ handling and dynamics to the style. Just tell it what you're making.
|
|
|
96
96
|
With **[LoreKit](#-lorekit-the-knowledge-core)** as its memory, it keeps what it learns
|
|
97
97
|
about your plugins and your taste, so a correction sticks. It also draws on a shared
|
|
98
98
|
plugin library that grows every time someone
|
|
99
|
-
**[contributes](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
99
|
+
**[contributes](https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/knowledge/contributions/README.md)**, you included.
|
|
100
100
|
|
|
101
101
|
</td>
|
|
102
102
|
<td valign="top">
|
|
@@ -113,7 +113,7 @@ or upload anything, and you hear each change as it happens.
|
|
|
113
113
|
|
|
114
114
|
## 🔍 How it works
|
|
115
115
|
|
|
116
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
116
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/how-it-works.svg" alt="You describe what you hear, Claude measures and decides, REAPER changes live. Every change: snapshot, measure, decide, change, re-measure." width="100%">
|
|
117
117
|
|
|
118
118
|
**You stay in charge.** Ask it to explain before it acts, undo anything, or use
|
|
119
119
|
`/critique` for advice without a single change to your project.
|
|
@@ -126,7 +126,7 @@ A mix engineer's value is what they've learned. reaper-mcp keeps all of that in
|
|
|
126
126
|
**[LoreKit](https://lorekit.io)**, a free, open-source memory store for AI agents. It's
|
|
127
127
|
what turns a remote control into an engineer that gets better every session.
|
|
128
128
|
|
|
129
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
129
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/knowledge-core.svg" alt="LoreKit at the center: the mix skills read plugin records and lessons before acting and write back what they learned." width="100%">
|
|
130
130
|
|
|
131
131
|
- 🎛️ **One record per plugin.** What it is, what each knob does, the settings that
|
|
132
132
|
worked and the gotchas. Ask for a plugin it has never seen and it **researches it,
|
|
@@ -141,12 +141,12 @@ what turns a remote control into an engineer that gets better every session.
|
|
|
141
141
|
overwritten. The built-in set comes with the server, read-only, and needs no
|
|
142
142
|
LoreKit account. Connect your own LoreKit to start your layer.
|
|
143
143
|
- 📚 **A built-in plugin library.** FabFilter, Soundtoys, Valhalla, iZotope, Melodyne, the
|
|
144
|
-
REAPER stock plugins and more: see the **[built-in plugin list](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
144
|
+
REAPER stock plugins and more: see the **[built-in plugin list](https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/docs/PLUGINS.md)**, and how
|
|
145
145
|
to add yours.
|
|
146
146
|
- 🤝 **Share what you taught it.** Press **Contribute** in the bridge page's Plugins tab
|
|
147
147
|
and your plugin records become a pull request. Once the maintainer approves it, they're
|
|
148
148
|
built in for every reaper-mcp user and added to the
|
|
149
|
-
[plugin list](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
149
|
+
[plugin list](https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/docs/PLUGINS.md) ([how it works](https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/knowledge/contributions/README.md)).
|
|
150
150
|
Regular contributors can publish straight to built-in, no pull request: ask on
|
|
151
151
|
[Discord](https://discord.gg/Eg8tznuXp4).
|
|
152
152
|
- 🌍 **It follows you.** The memory isn't tied to one project folder. Whatever song
|
|
@@ -161,7 +161,7 @@ what turns a remote control into an engineer that gets better every session.
|
|
|
161
161
|
|
|
162
162
|
## 🚀 Install in 3 steps
|
|
163
163
|
|
|
164
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
164
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/install-steps.svg" alt="1. Get REAPER, Claude Code and Node.js. 2. Paste one command. 3. Click Run on mcp_bridge.lua in REAPER." width="100%">
|
|
165
165
|
|
|
166
166
|
### 1 · Get the apps
|
|
167
167
|
|
|
@@ -241,7 +241,7 @@ instead of just giving advice:
|
|
|
241
241
|
| 🔀 **Routing**: sends, buses, sidechains, hardware outputs | 🎹 **MIDI**: write, edit and analyze notes & CC, live MIDI out | ✂️ **Editing**: split, trim, move, fades, takes, stretch markers |
|
|
242
242
|
| 📍 **Arrangement**: markers, regions, tempo map | 〰️ **Automation**: envelopes, points and pooled automation items | 💾 **Project**: save, render, undo/redo, snapshots, REAPER actions |
|
|
243
243
|
|
|
244
|
-
👉 The main tools by area: **[docs/TOOLS.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
244
|
+
👉 The main tools by area: **[docs/TOOLS.md](https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/docs/TOOLS.md)**
|
|
245
245
|
|
|
246
246
|
### 🎸 Genre-aware out of the box
|
|
247
247
|
|
|
@@ -263,7 +263,7 @@ isn't a knob: a synth's **wavetables**, its **modulation matrix**, a guitar rig'
|
|
|
263
263
|
file**. **Extensions** reach that. They're small add-ons you switch on, and you can have
|
|
264
264
|
Claude build one for the plugin *you* use.
|
|
265
265
|
|
|
266
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
266
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/extensions.svg" alt="Extensions plug into reaper-mcp through a small versioned API: the core on the left, and the Vital, Helix and your-own extensions on the right." width="100%">
|
|
267
267
|
|
|
268
268
|
> 🎹 *"On the Vital on track 2, route LFO 2 to the filter cutoff at 40% and make it a slow triangle."*
|
|
269
269
|
>
|
|
@@ -289,7 +289,7 @@ reaper-mcp extension list # what's installed, and why one can't load
|
|
|
289
289
|
- 🛡️ **A broken extension is skipped**, never a crash, and `reaper-mcp doctor` tells you why.
|
|
290
290
|
- 🧪 **Proven live.** `/new-extension` doesn't finish until the edit shows up in the plugin *and* in the audio.
|
|
291
291
|
|
|
292
|
-
📖 Full guide (the API, Lua handlers, testing, sharing, troubleshooting): **[docs/EXTENSIONS.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
292
|
+
📖 Full guide (the API, Lua handlers, testing, sharing, troubleshooting): **[docs/EXTENSIONS.md](https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/docs/EXTENSIONS.md)**
|
|
293
293
|
|
|
294
294
|
---
|
|
295
295
|
|
|
@@ -305,7 +305,7 @@ reaper-mcp extension list # what's installed, and why one can't load
|
|
|
305
305
|
- 📊 **Bridge status window.** See every action as it happens, with timing and errors,
|
|
306
306
|
in a small window next to REAPER ([see what it shows](#-see-what-your-agent-is-doing)).
|
|
307
307
|
|
|
308
|
-
📖 What it can and can't do to a session, and what isn't covered: **[docs/SAFETY.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
308
|
+
📖 What it can and can't do to a session, and what isn't covered: **[docs/SAFETY.md](https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/docs/SAFETY.md)**.
|
|
309
309
|
|
|
310
310
|
---
|
|
311
311
|
|
|
@@ -315,7 +315,7 @@ You shouldn't have to take its word for it. The **bridge window** opens next to
|
|
|
315
315
|
logs every move the agent makes, as it happens: what it did, how long it took and anything
|
|
316
316
|
that went wrong. With several Claude sessions connected, you can see which one did what.
|
|
317
317
|
|
|
318
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
318
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/bridge-status.png" alt="The MCP Bridge status window: uptime, command count, errors, latency, a commands-per-minute timeline, and a live log of tool calls such as read_track_spectrum, set_track_property and snapshot_save, tagged by session." width="100%">
|
|
319
319
|
|
|
320
320
|
<sub>Demo data. Add <code>?demo</code> to the window's address to explore it without REAPER.</sub>
|
|
321
321
|
|
|
@@ -325,7 +325,7 @@ Every call opens a drawer in plain words (*"midnight-drive wrote new points into
|
|
|
325
325
|
automation on track 5"*) with a picture of the change: **before → after** for edits, a
|
|
326
326
|
readout against your target for measurements.
|
|
327
327
|
|
|
328
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
328
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/bridge-drawer.png" alt="The bridge window with a call open in the drawer: Write automation, with a volume envelope drawn before and after, and the params the agent sent." width="100%">
|
|
329
329
|
|
|
330
330
|
### 📈 What it measured
|
|
331
331
|
|
|
@@ -333,14 +333,14 @@ readout against your target for measurements.
|
|
|
333
333
|
<tr>
|
|
334
334
|
<td width="50%" valign="top">
|
|
335
335
|
|
|
336
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
336
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/views/spectrum.png" alt="The spectrum view: third-octave bands from 25 Hz to 16 kHz as bars, hot bands in amber." width="100%">
|
|
337
337
|
|
|
338
338
|
**Spectrum**<br><sub>Where the energy sits, band by band, judged by perceived loudness. Hot bands turn amber.</sub>
|
|
339
339
|
|
|
340
340
|
</td>
|
|
341
341
|
<td width="50%" valign="top">
|
|
342
342
|
|
|
343
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
343
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/views/loudness.png" alt="The loudness view: integrated LUFS against a target range on a scale, with short-term, momentary and true peak readouts and the change since the previous call." width="100%">
|
|
344
344
|
|
|
345
345
|
**Loudness**<br><sub>LUFS against your target, true peak, and how it moved since the last measurement.</sub>
|
|
346
346
|
|
|
@@ -349,14 +349,14 @@ readout against your target for measurements.
|
|
|
349
349
|
<tr>
|
|
350
350
|
<td width="50%" valign="top">
|
|
351
351
|
|
|
352
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
352
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/views/loudness-curve.png" alt="The loudness curve view: short-term loudness over the length of a song against a target line, with the spans over target shaded." width="100%">
|
|
353
353
|
|
|
354
354
|
**Loudness over time**<br><sub>The whole song's loudness, with the stretches that run over target shaded.</sub>
|
|
355
355
|
|
|
356
356
|
</td>
|
|
357
357
|
<td width="50%" valign="top">
|
|
358
358
|
|
|
359
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
359
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/views/masking.png" alt="The masking view: a heat map of track pairs against frequency bands, with the worst conflicts and which track to cut." width="100%">
|
|
360
360
|
|
|
361
361
|
**Masking**<br><sub>Which tracks fight, at which frequency, and which one should give way.</sub>
|
|
362
362
|
|
|
@@ -365,14 +365,14 @@ readout against your target for measurements.
|
|
|
365
365
|
<tr>
|
|
366
366
|
<td width="50%" valign="top">
|
|
367
367
|
|
|
368
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
368
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/views/stereo-bands.png" alt="The stereo view: correlation per frequency band on a minus one to plus one scale." width="100%">
|
|
369
369
|
|
|
370
370
|
**Stereo, per band**<br><sub>Phase correlation per band. Catches a wide or out-of-phase low end before it hurts.</sub>
|
|
371
371
|
|
|
372
372
|
</td>
|
|
373
373
|
<td width="50%" valign="top">
|
|
374
374
|
|
|
375
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
375
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/views/waveform.png" alt="The waveform view: a rendered track drawn on a decibel scale with its peak, RMS and clipped sample count." width="100%">
|
|
376
376
|
|
|
377
377
|
**Waveform**<br><sub>What a rendered track really looks like, with clipping counted.</sub>
|
|
378
378
|
|
|
@@ -388,14 +388,14 @@ Every edit is drawn **before → after**: new in blue, old dashed or ghosted, re
|
|
|
388
388
|
<tr>
|
|
389
389
|
<td width="50%" valign="top">
|
|
390
390
|
|
|
391
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
391
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/views/mixer.png" alt="The mixer view: every track as a fader with its level in dB, pan, and mute, solo and arm badges, grouped by folder." width="100%">
|
|
392
392
|
|
|
393
393
|
**Mixer**<br><sub>The session as a mixer: folders, levels, pans, mute, solo and arm.</sub>
|
|
394
394
|
|
|
395
395
|
</td>
|
|
396
396
|
<td width="50%" valign="top">
|
|
397
397
|
|
|
398
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
398
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/views/routing.png" alt="The routing view: a signal-flow diagram of a track's sends, receives and hardware outputs, with added, changed and removed routes marked." width="100%">
|
|
399
399
|
|
|
400
400
|
**Routing**<br><sub>Sends, receives and outputs as signal flow. Thicker wire means louder.</sub>
|
|
401
401
|
|
|
@@ -404,14 +404,14 @@ Every edit is drawn **before → after**: new in blue, old dashed or ghosted, re
|
|
|
404
404
|
<tr>
|
|
405
405
|
<td width="50%" valign="top">
|
|
406
406
|
|
|
407
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
407
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/views/automation.png" alt="The automation view: a volume envelope with pooled automation items drawn as blocks tinted by pool." width="100%">
|
|
408
408
|
|
|
409
409
|
**Automation**<br><sub>Envelope points and pooled automation items, before and after.</sub>
|
|
410
410
|
|
|
411
411
|
</td>
|
|
412
412
|
<td width="50%" valign="top">
|
|
413
413
|
|
|
414
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
414
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/views/piano-roll.png" alt="The piano roll view: added notes in blue, unchanged notes in grey, removed notes dashed, and a velocity lane." width="100%">
|
|
415
415
|
|
|
416
416
|
**Piano roll**<br><sub>MIDI edits as a piano roll: added, kept and removed notes, with velocity.</sub>
|
|
417
417
|
|
|
@@ -420,14 +420,14 @@ Every edit is drawn **before → after**: new in blue, old dashed or ghosted, re
|
|
|
420
420
|
<tr>
|
|
421
421
|
<td width="50%" valign="top">
|
|
422
422
|
|
|
423
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
423
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/views/pins.png" alt="The plugin pins view: track channels wired into a compressor's input pins, with a newly connected sidechain highlighted." width="100%">
|
|
424
424
|
|
|
425
425
|
**Plugin pins**<br><sub>Which track channels feed which plugin pins. Here, a sidechain just got wired in.</sub>
|
|
426
426
|
|
|
427
427
|
</td>
|
|
428
428
|
<td width="50%" valign="top">
|
|
429
429
|
|
|
430
|
-
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.
|
|
430
|
+
<img src="https://raw.githubusercontent.com/mthines/reaper-mcp/v0.73.0-beta.80.1/docs/assets/views/render.png" alt="The render view: three rendered versions of a song with a waveform, LUFS, peak and length for each, against a loudness target." width="100%">
|
|
431
431
|
|
|
432
432
|
**Renders**<br><sub>Every rendered file with its LUFS, peak and length against your target.</sub>
|
|
433
433
|
|
|
@@ -456,7 +456,7 @@ messages, audio or MIDI. I respect your privacy 🙏
|
|
|
456
456
|
|
|
457
457
|
You're in control: setup asks before anything is sent, and `reaper-mcp telemetry off`
|
|
458
458
|
turns it off for good — no hard feelings. Everything that's collected, and where it
|
|
459
|
-
goes, is in [TELEMETRY.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
459
|
+
goes, is in [TELEMETRY.md](https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/TELEMETRY.md).
|
|
460
460
|
|
|
461
461
|
---
|
|
462
462
|
|
|
@@ -490,7 +490,7 @@ explains its reasoning so you can push back.
|
|
|
490
490
|
<br>
|
|
491
491
|
Every edit is a single undo step, and the mix skills snapshot before and after a task. Use
|
|
492
492
|
<code>/critique</code> or read-only mode if you only want advice. Saving a copy of your project
|
|
493
|
-
before a big session never hurts. <a href="https://github.com/mthines/reaper-mcp/blob/v0.
|
|
493
|
+
before a big session never hurts. <a href="https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/docs/SAFETY.md">What is and isn't guarded</a>.
|
|
494
494
|
</details>
|
|
495
495
|
|
|
496
496
|
<details>
|
|
@@ -498,7 +498,7 @@ before a big session never hurts. <a href="https://github.com/mthines/reaper-mcp
|
|
|
498
498
|
<br>
|
|
499
499
|
Any plugin REAPER can load (VST, VST3, AU, CLAP, JS). It finds what you have installed
|
|
500
500
|
and reaches for the best tool for each job. The ones it already knows are in the
|
|
501
|
-
<a href="https://github.com/mthines/reaper-mcp/blob/v0.
|
|
501
|
+
<a href="https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/docs/PLUGINS.md">built-in plugin list</a>. When it meets a plugin it doesn't know, it
|
|
502
502
|
researches it, inspects its controls live and saves what it learns to LoreKit. You can
|
|
503
503
|
also teach it one up front with <code>/learn-plugin</code>.
|
|
504
504
|
</details>
|
|
@@ -529,12 +529,12 @@ No. It reads meter values and settings from your running session, not your audio
|
|
|
529
529
|
|
|
530
530
|
## 🛠️ For developers
|
|
531
531
|
|
|
532
|
-
- 📖 **[docs/REFERENCE.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
532
|
+
- 📖 **[docs/REFERENCE.md](https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/docs/REFERENCE.md)**: architecture, install internals, CLI,
|
|
533
533
|
environment variables, telemetry, project structure
|
|
534
|
-
- 🧰 **[docs/TOOLS.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
535
|
-
- 🧩 **[docs/EXTENSIONS.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
536
|
-
- 🧑💻 **[DEVELOPMENT.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
537
|
-
- 🧪 **[docs/TESTING.md](https://github.com/mthines/reaper-mcp/blob/v0.
|
|
534
|
+
- 🧰 **[docs/TOOLS.md](https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/docs/TOOLS.md)**: the main tools by area
|
|
535
|
+
- 🧩 **[docs/EXTENSIONS.md](https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/docs/EXTENSIONS.md)**: write, test and share an extension (the API, Lua handlers, Vital and Helix)
|
|
536
|
+
- 🧑💻 **[DEVELOPMENT.md](https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/DEVELOPMENT.md)**: build, test, run from source, MCP Inspector
|
|
537
|
+
- 🧪 **[docs/TESTING.md](https://github.com/mthines/reaper-mcp/blob/v0.73.0-beta.80.1/docs/TESTING.md)**: end-to-end testing guide
|
|
538
538
|
|
|
539
539
|
```
|
|
540
540
|
Claude Code ⇄ MCP server (TypeScript) ⇄ file IPC ⇄ Lua bridge in REAPER ⇄ ReaScript API + JSFX meters
|
package/main.js
CHANGED
|
@@ -136,6 +136,10 @@ var ALLOWED_SPAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
136
136
|
"reaper.bridge.handler_ms",
|
|
137
137
|
"reaper.bridge.pickup_ms",
|
|
138
138
|
"reaper.bridge.poll_attempts",
|
|
139
|
+
// Whether the bridge answered at startup and, when not, which setup step is missing
|
|
140
|
+
// (a fixed set: connected, stale, never_started, not_installed, no_reaper — never a path)
|
|
141
|
+
"reaper.bridge.connected",
|
|
142
|
+
"reaper.bridge.state",
|
|
139
143
|
// detect_key / detect_chords: where they read from and how sure they were, never the key or chords
|
|
140
144
|
"reaper.key.source",
|
|
141
145
|
"reaper.key.confidence",
|
|
@@ -628,15 +632,89 @@ async function ensureBridgeDir() {
|
|
|
628
632
|
await mkdir(dir, { recursive: true });
|
|
629
633
|
return dir;
|
|
630
634
|
}
|
|
635
|
+
var BRIDGE_NOT_RUNNING_PREFIX = "Bridge not running:";
|
|
631
636
|
function classifyBridgeError(error7) {
|
|
632
637
|
if (error7?.startsWith("Timeout:")) return "timeout";
|
|
638
|
+
if (error7?.startsWith(BRIDGE_NOT_RUNNING_PREFIX)) return "bridge_not_running";
|
|
633
639
|
if (error7?.startsWith("Handler error:")) return "handler_crash";
|
|
634
640
|
if (error7?.startsWith("Unknown command type")) return "unknown_command";
|
|
635
641
|
if (error7?.startsWith("Internal error:")) return "internal_error";
|
|
636
642
|
return "command_failed";
|
|
637
643
|
}
|
|
638
644
|
function isSystemError(type) {
|
|
639
|
-
return type !== "command_failed";
|
|
645
|
+
return type !== "command_failed" && type !== "bridge_not_running";
|
|
646
|
+
}
|
|
647
|
+
var HEARTBEAT_FRESH_MS = 5e3;
|
|
648
|
+
var BRIDGE_DOWN_AFTER_MS = 6e4;
|
|
649
|
+
async function heartbeatAgeMs() {
|
|
650
|
+
try {
|
|
651
|
+
const info = await stat(join3(getBridgeDir(), "heartbeat.json"));
|
|
652
|
+
return Math.max(0, Date.now() - info.mtimeMs);
|
|
653
|
+
} catch {
|
|
654
|
+
return void 0;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
async function exists(path) {
|
|
658
|
+
try {
|
|
659
|
+
await stat(path);
|
|
660
|
+
return true;
|
|
661
|
+
} catch {
|
|
662
|
+
return false;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
async function getBridgeState() {
|
|
666
|
+
const age = await heartbeatAgeMs();
|
|
667
|
+
if (age !== void 0) return { state: age < HEARTBEAT_FRESH_MS ? "connected" : "stale", heartbeatAgeMs: age };
|
|
668
|
+
const resource = getReaperResourcePath();
|
|
669
|
+
if (await exists(join3(resource, "Scripts", "mcp_bridge.lua"))) return { state: "never_started" };
|
|
670
|
+
if (await exists(join3(resource, "reaper.ini"))) return { state: "not_installed" };
|
|
671
|
+
return { state: "no_reaper" };
|
|
672
|
+
}
|
|
673
|
+
var START_BRIDGE = `Start the bridge: in REAPER, open Actions \u2192 Show action list, select "Script: mcp_bridge.lua" and click Run (the first time, use Load ReaScript\u2026 and pick mcp_bridge.lua from REAPER's Scripts folder). It runs until REAPER closes.`;
|
|
674
|
+
function formatAge(ms) {
|
|
675
|
+
const s = Math.round(ms / 1e3);
|
|
676
|
+
if (s < 120) return `${s} s`;
|
|
677
|
+
const min = Math.round(s / 60);
|
|
678
|
+
if (min < 120) return `${min} min`;
|
|
679
|
+
return `${Math.round(min / 60)} h`;
|
|
680
|
+
}
|
|
681
|
+
function bridgeDownMessage(status, resourcePath = getReaperResourcePath()) {
|
|
682
|
+
switch (status.state) {
|
|
683
|
+
case "connected":
|
|
684
|
+
return "The REAPER bridge is running.";
|
|
685
|
+
case "stale":
|
|
686
|
+
return `${BRIDGE_NOT_RUNNING_PREFIX} REAPER has not answered for ${formatAge(status.heartbeatAgeMs ?? 0)}. If REAPER is open and rendering or showing a dialog, finish or close it and try again: running mcp_bridge.lua while the bridge is only busy stops it. If REAPER is closed, start it and try again. If REAPER is open and idle, the bridge stopped. ${START_BRIDGE} Then try again.`;
|
|
687
|
+
case "never_started":
|
|
688
|
+
return `${BRIDGE_NOT_RUNNING_PREFIX} the bridge script is installed but has never run in this REAPER. ${START_BRIDGE} Then try again.`;
|
|
689
|
+
case "not_installed":
|
|
690
|
+
return `${BRIDGE_NOT_RUNNING_PREFIX} the bridge script is not installed in REAPER (no Scripts/mcp_bridge.lua in ${resourcePath}). Run in a terminal: reaper-mcp setup. ${START_BRIDGE}`;
|
|
691
|
+
case "no_reaper":
|
|
692
|
+
return `${BRIDGE_NOT_RUNNING_PREFIX} no REAPER settings in ${resourcePath}: REAPER is not installed there or has never been started. Start REAPER once (or set REAPER_RESOURCE_PATH to the folder REAPER shows under Options \u2192 Show REAPER resource path in explorer/finder), then run in a terminal: reaper-mcp setup. ${START_BRIDGE}`;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
var inFlight = 0;
|
|
696
|
+
var lastAnswerAt = 0;
|
|
697
|
+
async function bridgeDown() {
|
|
698
|
+
if (inFlight > 0) return void 0;
|
|
699
|
+
if (Date.now() - lastAnswerAt < BRIDGE_DOWN_AFTER_MS) return void 0;
|
|
700
|
+
const status = await getBridgeState();
|
|
701
|
+
if (status.state === "connected") return void 0;
|
|
702
|
+
if (status.state === "stale" && (status.heartbeatAgeMs ?? 0) < BRIDGE_DOWN_AFTER_MS) return void 0;
|
|
703
|
+
if (status.state === "stale" && await otherCommandPending()) return void 0;
|
|
704
|
+
return status;
|
|
705
|
+
}
|
|
706
|
+
var PENDING_COMMAND_MAX_AGE_MS = 15 * 6e4;
|
|
707
|
+
async function otherCommandPending() {
|
|
708
|
+
const dir = getBridgeDir();
|
|
709
|
+
try {
|
|
710
|
+
for (const file of await readdir(dir)) {
|
|
711
|
+
if (!file.startsWith("command_") || !file.endsWith(".json")) continue;
|
|
712
|
+
const info = await stat(join3(dir, file)).catch(() => null);
|
|
713
|
+
if (info && Date.now() - info.mtimeMs < PENDING_COMMAND_MAX_AGE_MS) return true;
|
|
714
|
+
}
|
|
715
|
+
} catch {
|
|
716
|
+
}
|
|
717
|
+
return false;
|
|
640
718
|
}
|
|
641
719
|
var NOOP_TRACER = new ProxyTracerProvider().getTracer("noop");
|
|
642
720
|
var UNTRACED_COMMANDS = /* @__PURE__ */ new Set(["_bridge_diagnostics", "_session", "_log_result"]);
|
|
@@ -670,8 +748,26 @@ async function sendCommand(type, params = {}, timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
|
670
748
|
span.end();
|
|
671
749
|
if (!untraced) getCommandDurationHistogram().record((Date.now() - startMs) / 1e3, attrs);
|
|
672
750
|
};
|
|
751
|
+
let counted = false;
|
|
673
752
|
try {
|
|
674
753
|
if (profiling) t["spanSetup"] = now() - t0;
|
|
754
|
+
const down = await bridgeDown();
|
|
755
|
+
if (down) {
|
|
756
|
+
span.setAttribute("reaper.bridge.state", down.state);
|
|
757
|
+
const message = bridgeDownMessage(down);
|
|
758
|
+
if (!untraced) {
|
|
759
|
+
emitLog(
|
|
760
|
+
"warn",
|
|
761
|
+
`Bridge command ${type} not sent: the bridge is not running (${down.state})`,
|
|
762
|
+
{ "rpc.method": type, "error.type": "bridge_not_running", "reaper.bridge.state": down.state },
|
|
763
|
+
{ eventName: "reaper.bridge.command.not_sent" }
|
|
764
|
+
);
|
|
765
|
+
}
|
|
766
|
+
finish("bridge_not_running");
|
|
767
|
+
return { id: randomUUID2(), success: false, error: message, timestamp: Date.now() };
|
|
768
|
+
}
|
|
769
|
+
inFlight++;
|
|
770
|
+
counted = true;
|
|
675
771
|
const tDir = now();
|
|
676
772
|
const dir = await ensureBridgeDir();
|
|
677
773
|
if (profiling) t["ensureDir"] = now() - tDir;
|
|
@@ -704,6 +800,7 @@ async function sendCommand(type, params = {}, timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
|
704
800
|
const tRead = now();
|
|
705
801
|
const data = await readFile(responsePath, "utf-8");
|
|
706
802
|
const response = JSON.parse(data);
|
|
803
|
+
lastAnswerAt = Date.now();
|
|
707
804
|
if (profiling) t["readParse"] = now() - tRead;
|
|
708
805
|
if (profiling) t["pollWait"] = now() - tPoll - (t["readParse"] ?? 0);
|
|
709
806
|
const tCleanup = now();
|
|
@@ -793,19 +890,15 @@ async function sendCommand(type, params = {}, timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
|
793
890
|
});
|
|
794
891
|
finish(errorType);
|
|
795
892
|
throw err;
|
|
893
|
+
} finally {
|
|
894
|
+
if (counted) inFlight--;
|
|
796
895
|
}
|
|
797
896
|
}
|
|
798
897
|
);
|
|
799
898
|
}
|
|
800
899
|
async function isBridgeRunning() {
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
try {
|
|
804
|
-
const info = await stat(heartbeatPath);
|
|
805
|
-
return Date.now() - info.mtimeMs < 5e3;
|
|
806
|
-
} catch {
|
|
807
|
-
return false;
|
|
808
|
-
}
|
|
900
|
+
const age = await heartbeatAgeMs();
|
|
901
|
+
return age !== void 0 && age < HEARTBEAT_FRESH_MS;
|
|
809
902
|
}
|
|
810
903
|
async function cleanupStaleFiles(maxAgeMs = 3e4) {
|
|
811
904
|
const dir = getBridgeDir();
|
|
@@ -4659,7 +4752,7 @@ async function checkPython(pythonBin) {
|
|
|
4659
4752
|
} catch {
|
|
4660
4753
|
const notFound = `Python interpreter not found: ${pythonBin}
|
|
4661
4754
|
Install Python 3.10+ from https://python.org or set the PYTHON_BIN environment variable.
|
|
4662
|
-
Example: PYTHON_BIN=/usr/local/bin/python3.11
|
|
4755
|
+
Example: PYTHON_BIN=/usr/local/bin/python3.11 reaper-mcp setup-sidecar`;
|
|
4663
4756
|
throw new Error(notFound);
|
|
4664
4757
|
}
|
|
4665
4758
|
const version = parsePythonVersion(stdout);
|
|
@@ -5016,6 +5109,10 @@ Removed partial venv so the next setup-sidecar run starts clean.`);
|
|
|
5016
5109
|
}
|
|
5017
5110
|
}
|
|
5018
5111
|
|
|
5112
|
+
// apps/reaper-mcp-server/src/sidecar-hint.ts
|
|
5113
|
+
var SETUP_SIDECAR_COMMAND = "reaper-mcp setup-sidecar";
|
|
5114
|
+
var SETUP_SIDECAR_HINT = `Run in a terminal: ${SETUP_SIDECAR_COMMAND}`;
|
|
5115
|
+
|
|
5019
5116
|
// apps/reaper-mcp-server/src/sidecar.ts
|
|
5020
5117
|
var VENV_BIN2 = platform3() === "win32" ? "Scripts" : "bin";
|
|
5021
5118
|
var VENV_PYTHON_NAME2 = platform3() === "win32" ? "python.exe" : "python";
|
|
@@ -5150,7 +5247,7 @@ var SidecarClientImpl = class {
|
|
|
5150
5247
|
async send(method, params, timeoutMs) {
|
|
5151
5248
|
if (!this.isAvailable()) {
|
|
5152
5249
|
throw new Error(
|
|
5153
|
-
|
|
5250
|
+
`Audio understanding sidecar not installed. ${SETUP_SIDECAR_HINT}`
|
|
5154
5251
|
);
|
|
5155
5252
|
}
|
|
5156
5253
|
await this.ensureRunning();
|
|
@@ -5306,13 +5403,13 @@ var SidecarClientImpl = class {
|
|
|
5306
5403
|
}
|
|
5307
5404
|
}).catch((err) => {
|
|
5308
5405
|
for (const [id, { reject }] of this.pending.entries()) {
|
|
5309
|
-
reject(new Error(`Sidecar restart failed: ${err.message}.
|
|
5406
|
+
reject(new Error(`Sidecar restart failed: ${err.message}. ${SETUP_SIDECAR_HINT}`));
|
|
5310
5407
|
this.pending.delete(id);
|
|
5311
5408
|
}
|
|
5312
5409
|
});
|
|
5313
5410
|
} else {
|
|
5314
5411
|
for (const [id, { reject }] of this.pending.entries()) {
|
|
5315
|
-
reject(new Error(
|
|
5412
|
+
reject(new Error(`Python sidecar unavailable after restart attempt. ${SETUP_SIDECAR_HINT}`));
|
|
5316
5413
|
this.pending.delete(id);
|
|
5317
5414
|
}
|
|
5318
5415
|
}
|
|
@@ -5496,11 +5593,11 @@ function stemsSummary(name, data) {
|
|
|
5496
5593
|
// apps/reaper-mcp-server/src/tools/aesthetics.ts
|
|
5497
5594
|
var DEFAULT_SCORING_LUFS = -18;
|
|
5498
5595
|
var DEFAULT_CLIP_SECONDS = 30;
|
|
5499
|
-
var SIDECAR_NOT_INSTALLED_MSG =
|
|
5596
|
+
var SIDECAR_NOT_INSTALLED_MSG = `Audio understanding sidecar not installed. ${SETUP_SIDECAR_HINT}`;
|
|
5500
5597
|
function registerAestheticsTools(server) {
|
|
5501
5598
|
server.tool(
|
|
5502
5599
|
"analyze_track_aesthetics",
|
|
5503
|
-
"Analyze the perceptual aesthetic quality of a track's audio using Meta's Audiobox Aesthetics model (CC-BY 4.0). Bounces the track to a temp WAV file (post-FX, post-fader) and runs 4-axis perceptual quality scoring: Production Quality (PQ), Production Complexity (PC), Content Enjoyment (CE), Content Usefulness (CU). Returns scores 0-10. The clip is normalized to normalizeLufs (default -18 LUFS) before scoring, so level differences between versions do not bias the scores (CE rises with level; PQ barely moves). PQ (and partly CU) judge mix changes; PC and CE mostly follow the arrangement, so only compare the same time range. Measured noise: re-rendering the same 30 s clip moves PQ by ~0.05, a 10 s clip by ~0.4; treat smaller differences as no change. Requires the Python sidecar (run:
|
|
5600
|
+
"Analyze the perceptual aesthetic quality of a track's audio using Meta's Audiobox Aesthetics model (CC-BY 4.0). Bounces the track to a temp WAV file (post-FX, post-fader) and runs 4-axis perceptual quality scoring: Production Quality (PQ), Production Complexity (PC), Content Enjoyment (CE), Content Usefulness (CU). Returns scores 0-10. The clip is normalized to normalizeLufs (default -18 LUFS) before scoring, so level differences between versions do not bias the scores (CE rises with level; PQ barely moves). PQ (and partly CU) judge mix changes; PC and CE mostly follow the arrangement, so only compare the same time range. Measured noise: re-rendering the same 30 s clip moves PQ by ~0.05, a 10 s clip by ~0.4; treat smaller differences as no change. Requires the Python sidecar (run in a terminal: reaper-mcp setup-sidecar).",
|
|
5504
5601
|
{
|
|
5505
5602
|
trackIndex: z27.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master: the whole mix)"),
|
|
5506
5603
|
startTime: z27.coerce.number().min(0).optional().describe("Start time in seconds (default: 0 or use REAPER time selection)"),
|
|
@@ -5582,7 +5679,7 @@ function registerAestheticsTools(server) {
|
|
|
5582
5679
|
// apps/reaper-mcp-server/src/tools/offline.ts
|
|
5583
5680
|
import { z as z28 } from "zod/v4";
|
|
5584
5681
|
import { basename } from "node:path";
|
|
5585
|
-
var SIDECAR_NOT_INSTALLED_MSG2 =
|
|
5682
|
+
var SIDECAR_NOT_INSTALLED_MSG2 = `Audio understanding sidecar not installed. ${SETUP_SIDECAR_HINT}`;
|
|
5586
5683
|
var MAX_OFFLINE_SECONDS = 900;
|
|
5587
5684
|
var DEFAULT_OFFLINE_SECONDS = 30;
|
|
5588
5685
|
var DEFAULT_ALIGNMENT_SECONDS = 10;
|
|
@@ -5828,7 +5925,7 @@ function registerOfflineTools(server) {
|
|
|
5828
5925
|
// apps/reaper-mcp-server/src/tools/transients.ts
|
|
5829
5926
|
import { z as z29 } from "zod/v4";
|
|
5830
5927
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
5831
|
-
var SIDECAR_NOT_INSTALLED_MSG3 =
|
|
5928
|
+
var SIDECAR_NOT_INSTALLED_MSG3 = `Audio understanding sidecar not installed. ${SETUP_SIDECAR_HINT}`;
|
|
5832
5929
|
var DEFAULT_TRACK_SECONDS = 60;
|
|
5833
5930
|
var DEFAULT_LIMIT = 200;
|
|
5834
5931
|
var MAX_AUTOMATION_POINTS = 2e4;
|
|
@@ -6124,7 +6221,7 @@ import { z as z30 } from "zod/v4";
|
|
|
6124
6221
|
import { homedir as homedir6 } from "node:os";
|
|
6125
6222
|
import { basename as basename2, extname, join as join7 } from "node:path";
|
|
6126
6223
|
import { trace as trace5 } from "@opentelemetry/api";
|
|
6127
|
-
var SIDECAR_NOT_INSTALLED_MSG4 =
|
|
6224
|
+
var SIDECAR_NOT_INSTALLED_MSG4 = `Audio understanding sidecar not installed. ${SETUP_SIDECAR_HINT}`;
|
|
6128
6225
|
var DEFAULT_TRACK_SECONDS2 = 180;
|
|
6129
6226
|
var SEPARATION_TRACK_SECONDS = 60;
|
|
6130
6227
|
var MAX_MASKING_SECONDS = 60;
|
|
@@ -6402,7 +6499,7 @@ function registerMixcheckTools(server) {
|
|
|
6402
6499
|
// apps/reaper-mcp-server/src/tools/mixing.ts
|
|
6403
6500
|
import { z as z31 } from "zod/v4";
|
|
6404
6501
|
import { trace as trace6 } from "@opentelemetry/api";
|
|
6405
|
-
var SIDECAR_NOT_INSTALLED_MSG5 =
|
|
6502
|
+
var SIDECAR_NOT_INSTALLED_MSG5 = `Audio understanding sidecar not installed. ${SETUP_SIDECAR_HINT}`;
|
|
6406
6503
|
var MAX_QUANTIZE_SECONDS = 900;
|
|
6407
6504
|
var error4 = (text7) => ({ content: [{ type: "text", text: `Error: ${text7}` }], isError: true });
|
|
6408
6505
|
var ok = (data) => ({ content: [{ type: "text", text: JSON.stringify(data, null, 2) }] });
|
|
@@ -6749,7 +6846,7 @@ function buildPairs(guideHits, doubleHits, g, opts) {
|
|
|
6749
6846
|
}
|
|
6750
6847
|
|
|
6751
6848
|
// apps/reaper-mcp-server/src/tools/align.ts
|
|
6752
|
-
var SIDECAR_NOT_INSTALLED_MSG6 =
|
|
6849
|
+
var SIDECAR_NOT_INSTALLED_MSG6 = `Audio understanding sidecar not installed. ${SETUP_SIDECAR_HINT}`;
|
|
6753
6850
|
var MAX_ALIGN_SECONDS = 900;
|
|
6754
6851
|
var error5 = (text7) => ({ content: [{ type: "text", text: `Error: ${text7}` }], isError: true });
|
|
6755
6852
|
var ok2 = (data) => ({ content: [{ type: "text", text: JSON.stringify(data, null, 2) }] });
|
|
@@ -7619,7 +7716,7 @@ function registerCompositionTools(server) {
|
|
|
7619
7716
|
} else {
|
|
7620
7717
|
const sidecar = getSidecarClient();
|
|
7621
7718
|
if (!sidecar.isAvailable()) {
|
|
7622
|
-
return fail4(
|
|
7719
|
+
return fail4(`Audio key detection needs the Python sidecar. ${SETUP_SIDECAR_HINT}`);
|
|
7623
7720
|
}
|
|
7624
7721
|
if (path != null) {
|
|
7625
7722
|
const c = await sidecar.chroma({ path, ...start > 0 ? { startTime: start } : {}, ...args.endTime != null ? { endTime: args.endTime } : {} });
|
|
@@ -7716,7 +7813,7 @@ function registerCompositionTools(server) {
|
|
|
7716
7813
|
let engine = "template";
|
|
7717
7814
|
let modelMissing = false;
|
|
7718
7815
|
const sidecar = getSidecarClient();
|
|
7719
|
-
const needSidecar = () => fail4(
|
|
7816
|
+
const needSidecar = () => fail4(`Audio chord detection needs the Python sidecar. ${SETUP_SIDECAR_HINT}`);
|
|
7720
7817
|
const useModel = async () => {
|
|
7721
7818
|
if (engineArg === "template") return false;
|
|
7722
7819
|
const status = await Promise.resolve().then(() => sidecar.chordsStatus()).catch(() => ({ installed: false, message: "The chord model is not installed. Run: reaper-mcp setup-sidecar --with-chords" }));
|
|
@@ -9426,24 +9523,27 @@ async function serve() {
|
|
|
9426
9523
|
startupSpan.setAttribute("reaper.bridge.stale_files_cleaned", cleaned);
|
|
9427
9524
|
log(`Cleaned up ${cleaned} stale bridge files`);
|
|
9428
9525
|
}
|
|
9429
|
-
const
|
|
9430
|
-
const
|
|
9526
|
+
const bridge = await tracer.startActiveSpan("check bridge connection", { kind: SpanKind5.INTERNAL }, async (bridgeSpan) => {
|
|
9527
|
+
const status = await getBridgeState();
|
|
9528
|
+
const running = status.state === "connected";
|
|
9431
9529
|
bridgeSpan.setAttribute("reaper.bridge.connected", running);
|
|
9530
|
+
bridgeSpan.setAttribute("reaper.bridge.state", status.state);
|
|
9432
9531
|
if (!running) {
|
|
9433
|
-
emitLog("warn", "Lua bridge not detected at startup \u2014 commands
|
|
9434
|
-
"reaper.bridge.connected": false
|
|
9532
|
+
emitLog("warn", "Lua bridge not detected at startup \u2014 commands are refused until it is started", {
|
|
9533
|
+
"reaper.bridge.connected": false,
|
|
9534
|
+
"reaper.bridge.state": status.state
|
|
9435
9535
|
});
|
|
9436
|
-
log(
|
|
9437
|
-
log(
|
|
9438
|
-
log('Run "reaper-mcp setup" for installation instructions.');
|
|
9536
|
+
log(`WARNING: Lua bridge does not appear to be running in REAPER (${status.state}).`);
|
|
9537
|
+
log(bridgeDownMessage(status));
|
|
9439
9538
|
} else {
|
|
9440
9539
|
bridgeSpan.setStatus({ code: SpanStatusCode4.OK });
|
|
9441
9540
|
log("Lua bridge detected \u2014 connected to REAPER");
|
|
9442
9541
|
}
|
|
9443
9542
|
bridgeSpan.end();
|
|
9444
|
-
return
|
|
9543
|
+
return status;
|
|
9445
9544
|
});
|
|
9446
|
-
startupSpan.setAttribute("reaper.bridge.connected",
|
|
9545
|
+
startupSpan.setAttribute("reaper.bridge.connected", bridge.state === "connected");
|
|
9546
|
+
startupSpan.setAttribute("reaper.bridge.state", bridge.state);
|
|
9447
9547
|
const server = createServer();
|
|
9448
9548
|
for (const ext of await loadExtensions(server)) {
|
|
9449
9549
|
if (ext.status === "loaded") log(`Extension ${ext.name} ${ext.version ?? ""} loaded (${ext.tools.length} tools)`);
|
|
@@ -9514,8 +9614,10 @@ switch (command) {
|
|
|
9514
9614
|
break;
|
|
9515
9615
|
case "status": {
|
|
9516
9616
|
(async () => {
|
|
9517
|
-
const
|
|
9518
|
-
|
|
9617
|
+
const status = await getBridgeState();
|
|
9618
|
+
const running = status.state === "connected";
|
|
9619
|
+
console.log(`Bridge status: ${running ? "CONNECTED" : `NOT DETECTED (${status.state})`}`);
|
|
9620
|
+
if (!running) console.log(bridgeDownMessage(status));
|
|
9519
9621
|
process.exit(running ? 0 : 1);
|
|
9520
9622
|
})();
|
|
9521
9623
|
break;
|
package/package.json
CHANGED
package/sidecar/server.py
CHANGED
|
@@ -56,7 +56,7 @@ def _ensure_predictor() -> None:
|
|
|
56
56
|
except ImportError as exc:
|
|
57
57
|
_predictor_error = (
|
|
58
58
|
f"audiobox-aesthetics not installed: {exc}. "
|
|
59
|
-
|
|
59
|
+
"Run in a terminal: reaper-mcp setup-sidecar"
|
|
60
60
|
)
|
|
61
61
|
except Exception as exc: # noqa: BLE001
|
|
62
62
|
_predictor_error = f"Failed to initialize predictor: {exc}"
|