@mthines/reaper-mcp 0.71.0-beta.87.1 → 0.72.0
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 +526 -17
- package/bridge-ui/mcp_bridge.html +4 -4
- package/claude/agents/plugin-researcher.md +20 -0
- package/claude/knowledge/reference/memory-protocol.md +9 -4
- package/claude/skills/learn-plugin/SKILL.md +1 -1
- package/claude/skills/mastering/SKILL.md +2 -1
- package/claude/skills/mixer/SKILL.md +2 -1
- package/main.js +964 -802
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -144,7 +144,23 @@ var ALLOWED_SPAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
144
144
|
"reaper.chords.engine",
|
|
145
145
|
// opt-in/opt-out counts: on or off, and where the choice was made
|
|
146
146
|
"reaper.telemetry.consent.state",
|
|
147
|
-
"reaper.telemetry.consent.source"
|
|
147
|
+
"reaper.telemetry.consent.source",
|
|
148
|
+
// report_plugin_research: how a plugin research run went, as closed values and capped
|
|
149
|
+
// counts (tools/plugin-research.ts). Never the plugin's name, and nothing that singles
|
|
150
|
+
// one out in combination: no exact parameter count, no built-in or extension flag.
|
|
151
|
+
"reaper.plugin_research.outcome",
|
|
152
|
+
"reaper.plugin_research.caller",
|
|
153
|
+
"reaper.plugin_research.batch_size",
|
|
154
|
+
"reaper.plugin_research.params_probed",
|
|
155
|
+
"reaper.plugin_research.open_questions",
|
|
156
|
+
"reaper.plugin_research.sources",
|
|
157
|
+
"reaper.plugin_research.cleaned_up",
|
|
158
|
+
"reaper.plugin_research.duration_s",
|
|
159
|
+
"reaper.plugin.category",
|
|
160
|
+
"reaper.plugin.style",
|
|
161
|
+
"reaper.plugin.format",
|
|
162
|
+
"reaper.plugin.instrument",
|
|
163
|
+
"reaper.plugin.params_total"
|
|
148
164
|
]);
|
|
149
165
|
var AnonymizingSpanExporter = class {
|
|
150
166
|
constructor(inner) {
|
|
@@ -227,9 +243,14 @@ function readInstallId(dir = join2(homedir2(), ".reaper-mcp")) {
|
|
|
227
243
|
}
|
|
228
244
|
}
|
|
229
245
|
var sdk = null;
|
|
246
|
+
var startedMode;
|
|
247
|
+
function activeTelemetryMode() {
|
|
248
|
+
return startedMode ?? resolveTelemetry().mode;
|
|
249
|
+
}
|
|
230
250
|
async function initTelemetry() {
|
|
231
251
|
if (sdk) return;
|
|
232
252
|
const decision = resolveTelemetry();
|
|
253
|
+
startedMode = decision.mode;
|
|
233
254
|
if (decision.mode === "off") {
|
|
234
255
|
console.error(`[reaper-mcp] Telemetry off (${decision.reason})`);
|
|
235
256
|
return;
|
|
@@ -910,18 +931,149 @@ function stopPollers() {
|
|
|
910
931
|
}
|
|
911
932
|
|
|
912
933
|
// apps/reaper-mcp-server/src/tools/project.ts
|
|
913
|
-
import { z as
|
|
934
|
+
import { z as z3 } from "zod/v4";
|
|
914
935
|
|
|
915
936
|
// apps/reaper-mcp-server/src/tools/structure.ts
|
|
937
|
+
import { z as z2 } from "zod/v4";
|
|
938
|
+
|
|
939
|
+
// apps/reaper-mcp-server/src/tools/plugin-research.ts
|
|
916
940
|
import { z } from "zod/v4";
|
|
917
|
-
|
|
918
|
-
var
|
|
919
|
-
var
|
|
920
|
-
var
|
|
941
|
+
import { trace as trace2 } from "@opentelemetry/api";
|
|
942
|
+
var OUTCOMES = ["new", "refined", "not_installed", "load_failed", "no_lorekit"];
|
|
943
|
+
var CALLERS = ["learn-plugin", "mixer", "mastering", "other"];
|
|
944
|
+
var PLUGIN_CATEGORIES = [
|
|
945
|
+
"eq",
|
|
946
|
+
"compressor",
|
|
947
|
+
"limiter",
|
|
948
|
+
"saturator",
|
|
949
|
+
"reverb",
|
|
950
|
+
"delay",
|
|
951
|
+
"gate",
|
|
952
|
+
"de-esser",
|
|
953
|
+
"amp-sim",
|
|
954
|
+
"channel-strip",
|
|
955
|
+
"analyzer",
|
|
956
|
+
"stereo-imager",
|
|
957
|
+
"multiband",
|
|
958
|
+
"pitch-correction",
|
|
959
|
+
"instrument",
|
|
960
|
+
"synth",
|
|
961
|
+
"drums",
|
|
962
|
+
"drum-sampler",
|
|
963
|
+
"composition",
|
|
964
|
+
"restoration",
|
|
965
|
+
"stem-separator",
|
|
966
|
+
"midi-utility",
|
|
967
|
+
"utility"
|
|
968
|
+
];
|
|
969
|
+
var PLUGIN_STYLES = ["transparent", "character", "vintage", "modern", "surgical"];
|
|
970
|
+
var FX_FORMATS = ["VST", "VST3", "AU", "CLAP", "JS", "LV2", "DX"];
|
|
971
|
+
var MAX_COUNT = { batch: 20, probed: 64, questions: 20, sources: 10 };
|
|
972
|
+
var SCRATCH_TRACK = /^\[MCP\] plugin-research (\S.*)$/;
|
|
973
|
+
var MAX_RUN_MS = 2 * 60 * 60 * 1e3;
|
|
974
|
+
var MAX_OPEN_RUNS = 50;
|
|
975
|
+
var runStarts = /* @__PURE__ */ new Map();
|
|
976
|
+
function noteScratchTrack(name, now = Date.now()) {
|
|
977
|
+
const tag = name?.trim().match(SCRATCH_TRACK)?.[1]?.trim();
|
|
978
|
+
if (!tag) return;
|
|
979
|
+
runStarts.delete(tag);
|
|
980
|
+
if (runStarts.size >= MAX_OPEN_RUNS) runStarts.delete(runStarts.keys().next().value);
|
|
981
|
+
runStarts.set(tag, now);
|
|
982
|
+
}
|
|
983
|
+
function runSeconds(tag, now = Date.now()) {
|
|
984
|
+
const key = tag?.trim();
|
|
985
|
+
const start = key ? runStarts.get(key) : void 0;
|
|
986
|
+
if (key) runStarts.delete(key);
|
|
987
|
+
if (start === void 0 || now < start || now - start > MAX_RUN_MS) return void 0;
|
|
988
|
+
return Math.round((now - start) / 1e3);
|
|
989
|
+
}
|
|
990
|
+
function given(value) {
|
|
991
|
+
return value?.trim() ? value : void 0;
|
|
992
|
+
}
|
|
993
|
+
function closed(allowed, value) {
|
|
994
|
+
const candidate = value?.split(",")[0]?.trim().toLowerCase();
|
|
995
|
+
return candidate !== void 0 && allowed.includes(candidate) ? candidate : "other";
|
|
996
|
+
}
|
|
997
|
+
function fxFormat(prefix) {
|
|
998
|
+
const label = prefix?.trim().replace(/:$/, "").toUpperCase() ?? "";
|
|
999
|
+
const instrument = /^(VST3?|AU|CLAP|LV2|DX)I$/.test(label);
|
|
1000
|
+
const base = instrument ? label.slice(0, -1) : label;
|
|
1001
|
+
const format = FX_FORMATS.includes(base) ? base : "other";
|
|
1002
|
+
return { format, instrument };
|
|
1003
|
+
}
|
|
1004
|
+
function fxAttributes(prefix) {
|
|
1005
|
+
const { format, instrument } = fxFormat(prefix);
|
|
1006
|
+
return { "reaper.plugin.format": format, "reaper.plugin.instrument": instrument };
|
|
1007
|
+
}
|
|
1008
|
+
function knownCount(value) {
|
|
1009
|
+
const count = typeof value === "string" ? value.trim() ? Number(value) : NaN : value ?? NaN;
|
|
1010
|
+
return Number.isInteger(count) && count >= 0 ? count : void 0;
|
|
1011
|
+
}
|
|
1012
|
+
function paramsBucket(total) {
|
|
1013
|
+
if (total === void 0) return void 0;
|
|
1014
|
+
if (total <= 0) return "none";
|
|
1015
|
+
if (total <= 15) return "1-15";
|
|
1016
|
+
if (total <= 63) return "16-63";
|
|
1017
|
+
if (total <= 255) return "64-255";
|
|
1018
|
+
return "256+";
|
|
1019
|
+
}
|
|
1020
|
+
function registerPluginResearchTools(server) {
|
|
1021
|
+
server.tool(
|
|
1022
|
+
"report_plugin_research",
|
|
1023
|
+
"Call once at the end of a plugin research run (the plugin-researcher's last step), after cleaning up the scratch track, also when the run stopped early. Records how the run went in pseudonymous usage telemetry as fixed values and counts \u2014 never the plugin's name. The result shows exactly what was sent. Changes nothing in REAPER.",
|
|
1024
|
+
{
|
|
1025
|
+
outcome: z.string().describe("new: a new record; refined: an existing record of yours, or an overlay on a built-in one; not_installed: no installed FX matched; load_failed: add_fx failed; no_lorekit: LoreKit not connected, nothing saved"),
|
|
1026
|
+
category: z.string().optional().describe(`The record's category (e.g. "compressor"); the first one if it has several`),
|
|
1027
|
+
style: z.string().optional().describe("The record's style: transparent, character, vintage, modern or surgical"),
|
|
1028
|
+
format: z.string().optional().describe(`The format prefix of the FX name: VST, VST3, AU, CLAP, JS, LV2, DX, with an instrument's "i" (VST3i) as REAPER shows it`),
|
|
1029
|
+
// not z.coerce: it turns "" and null into 0, which would be sent as a real "none"
|
|
1030
|
+
paramsTotal: z.union([z.number(), z.string()]).nullable().optional().describe("How many parameters get_fx_parameters listed (sent only as a range); leave out when not known"),
|
|
1031
|
+
paramsProbed: z.coerce.number().int().min(0).optional().describe("Parameters probed live in Step 4 (0 if not inspected)"),
|
|
1032
|
+
openQuestions: z.coerce.number().int().min(0).optional().describe("Open questions in the report, preference included"),
|
|
1033
|
+
sources: z.coerce.number().int().min(0).optional().describe("Web sources the record cites"),
|
|
1034
|
+
cleanedUp: z.boolean().optional().describe("The scratch track was deleted and nothing else changed (false: report it first)"),
|
|
1035
|
+
caller: z.string().optional().describe(`Who dispatched the research: the prompt's "Dispatched by" line \u2014 learn-plugin, mixer or mastering (default other)`),
|
|
1036
|
+
batchSize: z.coerce.number().int().min(1).optional().describe(`Plugins researched in the same request: the prompt's "Batch" line (default 1)`),
|
|
1037
|
+
scratchTag: z.string().optional().describe('The <TAG> of your "[MCP] plugin-research <TAG>" track, so the server can time the run. Never sent.')
|
|
1038
|
+
},
|
|
1039
|
+
async (args) => {
|
|
1040
|
+
const category = given(args.category);
|
|
1041
|
+
const style = given(args.style);
|
|
1042
|
+
const format = given(args.format);
|
|
1043
|
+
const seconds2 = runSeconds(args.scratchTag);
|
|
1044
|
+
const bucket = paramsBucket(knownCount(args.paramsTotal));
|
|
1045
|
+
const attributes = {
|
|
1046
|
+
"reaper.plugin_research.outcome": closed(OUTCOMES, args.outcome.trim().toLowerCase() === "overlay" ? "refined" : args.outcome),
|
|
1047
|
+
"reaper.plugin_research.caller": args.caller === void 0 ? "other" : closed(CALLERS, args.caller),
|
|
1048
|
+
"reaper.plugin_research.batch_size": Math.min(args.batchSize ?? 1, MAX_COUNT.batch),
|
|
1049
|
+
"reaper.plugin_research.params_probed": Math.min(args.paramsProbed ?? 0, MAX_COUNT.probed),
|
|
1050
|
+
"reaper.plugin_research.open_questions": Math.min(args.openQuestions ?? 0, MAX_COUNT.questions),
|
|
1051
|
+
"reaper.plugin_research.sources": Math.min(args.sources ?? 0, MAX_COUNT.sources),
|
|
1052
|
+
...args.cleanedUp !== void 0 ? { "reaper.plugin_research.cleaned_up": args.cleanedUp } : {},
|
|
1053
|
+
...seconds2 !== void 0 ? { "reaper.plugin_research.duration_s": seconds2 } : {},
|
|
1054
|
+
// given but unknown → "other"; not given → left out, so a missing value never reads as one
|
|
1055
|
+
...category ? { "reaper.plugin.category": closed(PLUGIN_CATEGORIES, category) } : {},
|
|
1056
|
+
...style ? { "reaper.plugin.style": closed(PLUGIN_STYLES, style) } : {},
|
|
1057
|
+
...format ? fxAttributes(format) : {},
|
|
1058
|
+
...bucket ? { "reaper.plugin.params_total": bucket } : {}
|
|
1059
|
+
};
|
|
1060
|
+
trace2.getActiveSpan()?.setAttributes(attributes);
|
|
1061
|
+
const mode = activeTelemetryMode();
|
|
1062
|
+
const result = { telemetry: mode, sent: mode === "off" ? {} : attributes };
|
|
1063
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
1064
|
+
}
|
|
1065
|
+
);
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
// apps/reaper-mcp-server/src/tools/structure.ts
|
|
1069
|
+
var trackRef = z2.union([z2.number().int().min(-1), z2.string().min(1)]).describe('Track: 0-based index (-1 = master), exact name, "{GUID}", or "master". A digit string means a track name first, then the index.');
|
|
1070
|
+
var sendCategory = z2.enum(["send", "receive", "hardware"]).optional().describe("send (default): the track's sends; receive: its receives (the same objects, seen from the other end); hardware: its hardware outputs");
|
|
1071
|
+
var sendMode = z2.enum(["post-fader", "pre-fx", "post-fx"]).optional().describe("post-fader (default for new sends), pre-fx (sidechain feeds, cue mixes), post-fx (pre-fader)");
|
|
1072
|
+
var channelPair = (what) => z2.coerce.number().int().min(1).max(127).optional().describe(`${what}: first channel of a stereo pair, 1-based (1 = 1/2, 3 = 3/4 for a sidechain)`);
|
|
921
1073
|
var sendLevel = {
|
|
922
|
-
volume:
|
|
923
|
-
pan:
|
|
924
|
-
mute:
|
|
1074
|
+
volume: z2.coerce.number().optional().describe("Level in dB (0 = unity)"),
|
|
1075
|
+
pan: z2.coerce.number().min(-1).max(1).optional().describe("Pan from -1 (left) to 1 (right)"),
|
|
1076
|
+
mute: z2.boolean().optional().describe("Mute the send"),
|
|
925
1077
|
mode: sendMode
|
|
926
1078
|
};
|
|
927
1079
|
async function run(command2, params) {
|
|
@@ -936,10 +1088,14 @@ function registerStructureTools(server) {
|
|
|
936
1088
|
"add_track",
|
|
937
1089
|
"Insert a new track (default: at the end). Returns its index, name and GUID.",
|
|
938
1090
|
{
|
|
939
|
-
name:
|
|
940
|
-
index:
|
|
1091
|
+
name: z2.string().optional().describe("Track name"),
|
|
1092
|
+
index: z2.coerce.number().int().min(0).optional().describe("0-based position to insert at (default: after the last track)")
|
|
941
1093
|
},
|
|
942
|
-
async (params) =>
|
|
1094
|
+
async (params) => {
|
|
1095
|
+
const added = await run("add_track", params);
|
|
1096
|
+
if (!("isError" in added)) noteScratchTrack(params.name);
|
|
1097
|
+
return added;
|
|
1098
|
+
}
|
|
943
1099
|
);
|
|
944
1100
|
server.tool(
|
|
945
1101
|
"delete_track",
|
|
@@ -952,7 +1108,7 @@ function registerStructureTools(server) {
|
|
|
952
1108
|
"Move a track to a new 0-based position; the other tracks shift around it. The user's track selection is kept.",
|
|
953
1109
|
{
|
|
954
1110
|
track: trackRef,
|
|
955
|
-
toIndex:
|
|
1111
|
+
toIndex: z2.coerce.number().int().min(0).describe("0-based position the track ends up at")
|
|
956
1112
|
},
|
|
957
1113
|
async (params) => run("move_track", params)
|
|
958
1114
|
);
|
|
@@ -961,9 +1117,9 @@ function registerStructureTools(server) {
|
|
|
961
1117
|
'Make a track a folder parent, the last track of a folder, or a normal track; optionally collapse the folder. Folders nest by position: tracks after a folder parent belong to it until a track marked "last".',
|
|
962
1118
|
{
|
|
963
1119
|
track: trackRef,
|
|
964
|
-
mode:
|
|
965
|
-
depth:
|
|
966
|
-
collapsed:
|
|
1120
|
+
mode: z2.enum(["folder", "normal", "last"]).optional().describe("folder: opens a folder at this track; last: closes the innermost open folder here; normal: neither"),
|
|
1121
|
+
depth: z2.coerce.number().int().min(-8).max(1).optional().describe("Raw I_FOLDERDEPTH instead of mode (1 opens a folder, -N closes N levels)"),
|
|
1122
|
+
collapsed: z2.coerce.number().int().min(0).max(2).optional().describe("Folder view: 0 = open, 1 = small, 2 = collapsed")
|
|
967
1123
|
},
|
|
968
1124
|
async (params) => run("set_track_folder", params)
|
|
969
1125
|
);
|
|
@@ -972,10 +1128,10 @@ function registerStructureTools(server) {
|
|
|
972
1128
|
"Rename, color, set the channel count, or switch the master/parent send of a track. Everything is validated before anything is written.",
|
|
973
1129
|
{
|
|
974
1130
|
track: trackRef,
|
|
975
|
-
name:
|
|
976
|
-
color:
|
|
977
|
-
channels:
|
|
978
|
-
masterSend:
|
|
1131
|
+
name: z2.string().optional().describe("New track name"),
|
|
1132
|
+
color: z2.string().optional().describe('"#RRGGBB", or "none" to clear the custom color'),
|
|
1133
|
+
channels: z2.coerce.number().int().min(2).max(128).optional().describe("Track channel count, even (4 lets the track receive a sidechain on 3/4)"),
|
|
1134
|
+
masterSend: z2.boolean().optional().describe("Send this track to the master/parent track")
|
|
979
1135
|
},
|
|
980
1136
|
async (params) => run("set_track_info", params)
|
|
981
1137
|
);
|
|
@@ -984,9 +1140,9 @@ function registerStructureTools(server) {
|
|
|
984
1140
|
"Put a track in (or take it out of) a REAPER track group with given roles. Roles: volume_lead/follow, vca_lead/follow, pan_lead/follow, mute_lead/follow, solo_lead/follow, recarm_lead/follow, polarity_lead/follow, automode_lead/follow. A VCA: one track vca_lead, the others vca_follow.",
|
|
985
1141
|
{
|
|
986
1142
|
track: trackRef,
|
|
987
|
-
group:
|
|
988
|
-
roles:
|
|
989
|
-
enable:
|
|
1143
|
+
group: z2.coerce.number().int().min(1).max(64).describe("Group number, 1-64"),
|
|
1144
|
+
roles: z2.array(z2.string().min(1)).min(1).max(16).describe('Roles to set, e.g. ["vca_follow", "mute_follow"]'),
|
|
1145
|
+
enable: z2.boolean().optional().describe("true (default) adds the roles; false removes them")
|
|
990
1146
|
},
|
|
991
1147
|
async ({ roles, ...rest }) => run("set_track_group", { ...rest, roles: JSON.stringify(roles) })
|
|
992
1148
|
);
|
|
@@ -1009,8 +1165,8 @@ function registerRoutingSetters(server) {
|
|
|
1009
1165
|
"Route a track straight to an audio interface output (outputChannel is 1-based; mono uses one channel).",
|
|
1010
1166
|
{
|
|
1011
1167
|
track: trackRef,
|
|
1012
|
-
outputChannel:
|
|
1013
|
-
mono:
|
|
1168
|
+
outputChannel: z2.coerce.number().int().min(1).max(512).optional().describe("First output channel, 1-based (default 1)"),
|
|
1169
|
+
mono: z2.boolean().optional().describe("Use one output channel instead of a stereo pair"),
|
|
1014
1170
|
...sendLevel
|
|
1015
1171
|
},
|
|
1016
1172
|
async (params) => run("add_hardware_output", params)
|
|
@@ -1021,12 +1177,12 @@ function registerRoutingSetters(server) {
|
|
|
1021
1177
|
{
|
|
1022
1178
|
track: trackRef,
|
|
1023
1179
|
category: sendCategory,
|
|
1024
|
-
index:
|
|
1180
|
+
index: z2.coerce.number().int().min(0).describe("0-based index within the category"),
|
|
1025
1181
|
...sendLevel,
|
|
1026
1182
|
srcChannel: channelPair("Source channels"),
|
|
1027
1183
|
destChannel: channelPair("Destination channels (sends and receives)"),
|
|
1028
|
-
outputChannel:
|
|
1029
|
-
mono:
|
|
1184
|
+
outputChannel: z2.coerce.number().int().min(1).max(512).optional().describe("Output channel (hardware outputs)"),
|
|
1185
|
+
mono: z2.boolean().optional().describe("Mono hardware output (applied together with outputChannel)")
|
|
1030
1186
|
},
|
|
1031
1187
|
async (params) => run("set_send", params)
|
|
1032
1188
|
);
|
|
@@ -1036,7 +1192,7 @@ function registerRoutingSetters(server) {
|
|
|
1036
1192
|
{
|
|
1037
1193
|
track: trackRef,
|
|
1038
1194
|
category: sendCategory,
|
|
1039
|
-
index:
|
|
1195
|
+
index: z2.coerce.number().int().min(0).describe("0-based index within the category")
|
|
1040
1196
|
},
|
|
1041
1197
|
async (params) => run("remove_send", params)
|
|
1042
1198
|
);
|
|
@@ -1087,8 +1243,8 @@ function registerProjectOpsTools(server) {
|
|
|
1087
1243
|
"save_project",
|
|
1088
1244
|
"Save the REAPER project. Without a path, saves it where it already lives. With path (an absolute .rpp file in an existing directory) it writes a copy there: the open project keeps its own path (savedAsCopy: true), so a never-saved project stays unsaved. Never opens a dialog: a never-saved project without path is refused; an existing different file is refused unless overwrite is true.",
|
|
1089
1245
|
{
|
|
1090
|
-
path:
|
|
1091
|
-
overwrite:
|
|
1246
|
+
path: z3.string().optional().describe("Absolute .rpp path to write a copy to"),
|
|
1247
|
+
overwrite: z3.boolean().optional().describe("Replace an existing file at path")
|
|
1092
1248
|
},
|
|
1093
1249
|
async ({ path, overwrite: overwrite2 }) => reply(await sendCommand("save_project", { path, overwrite: overwrite2 }))
|
|
1094
1250
|
);
|
|
@@ -1102,42 +1258,42 @@ function registerProjectOpsTools(server) {
|
|
|
1102
1258
|
"set_render_settings",
|
|
1103
1259
|
"Set any of the project render settings; returns them as read back. All fields are validated before any is written, so an invalid request changes nothing. Covers what is rendered (source: master, stems of the selected tracks, master + stems, selected tracks via the master, the selected media items alone or through the master, the region render matrix), the encoding (bit depth, MP3 bitrate, dither), loudness normalization with a limiter, and embedded metadata.",
|
|
1104
1260
|
{
|
|
1105
|
-
outputDirectory:
|
|
1106
|
-
filePattern:
|
|
1107
|
-
format:
|
|
1108
|
-
secondaryFormat:
|
|
1109
|
-
source:
|
|
1110
|
-
regionMatrix:
|
|
1111
|
-
regionIndex:
|
|
1112
|
-
tracks:
|
|
1261
|
+
outputDirectory: z3.string().optional().describe("Absolute output directory"),
|
|
1262
|
+
filePattern: z3.string().optional().describe("File name pattern without extension; REAPER wildcards like $project, $track, $region allowed"),
|
|
1263
|
+
format: z3.enum(["wav", "aiff", "flac", "mp3", "ogg", "opus"]).optional().describe("Output format"),
|
|
1264
|
+
secondaryFormat: z3.enum(["none", "wav", "aiff", "flac", "mp3", "ogg", "opus"]).optional().describe("Second file written by the same render; none disables it"),
|
|
1265
|
+
source: z3.enum(["master", "stems", "master_and_stems", "selected_via_master", "region_matrix", "selected_items", "selected_items_via_master"]).optional().describe("What is rendered: master mix; stems = one file per selected track (pick them with render_project tracks); master_and_stems; selected_via_master = the selected tracks through the master; region_matrix = the tracks set per region in regionMatrix (needs bounds all_regions or selected_regions); selected_items = one file per selected media item; selected_items_via_master = the selected items through the master (select them with set_selected_items)"),
|
|
1266
|
+
regionMatrix: z3.array(z3.object({
|
|
1267
|
+
regionIndex: z3.coerce.number().int().describe("Region number as list_regions reports it"),
|
|
1268
|
+
tracks: z3.array(trackRef).describe('Tracks this region renders: index, name, "{GUID}" or "master"; replaces the row')
|
|
1113
1269
|
})).optional().describe("Region render matrix rows (source region_matrix); each listed region renders exactly these tracks"),
|
|
1114
|
-
bounds:
|
|
1115
|
-
startTime:
|
|
1116
|
-
endTime:
|
|
1117
|
-
sampleRate:
|
|
1118
|
-
channels:
|
|
1119
|
-
bitDepth:
|
|
1120
|
-
mp3Bitrate:
|
|
1121
|
-
dither:
|
|
1122
|
-
noiseShaping:
|
|
1123
|
-
normalize:
|
|
1124
|
-
normalizeTarget:
|
|
1125
|
-
normalizeOnlyTooLoud:
|
|
1126
|
-
limit:
|
|
1127
|
-
limitCeiling:
|
|
1128
|
-
limitTruePeak:
|
|
1129
|
-
metadata:
|
|
1130
|
-
title:
|
|
1131
|
-
artist:
|
|
1132
|
-
album:
|
|
1133
|
-
genre:
|
|
1134
|
-
year:
|
|
1135
|
-
isrc:
|
|
1136
|
-
comment:
|
|
1137
|
-
description:
|
|
1270
|
+
bounds: z3.enum(["custom", "project", "time_selection", "all_regions", "selected_items", "selected_regions"]).optional().describe("What to render"),
|
|
1271
|
+
startTime: z3.coerce.number().min(0).optional().describe("Custom bounds start (seconds)"),
|
|
1272
|
+
endTime: z3.coerce.number().min(0).optional().describe("Custom bounds end (seconds)"),
|
|
1273
|
+
sampleRate: z3.coerce.number().int().min(0).optional().describe("Output sample rate; 0 = project rate"),
|
|
1274
|
+
channels: z3.coerce.number().int().min(1).max(64).optional().describe("Output channel count"),
|
|
1275
|
+
bitDepth: z3.enum(["16", "24", "32", "32f"]).optional().describe("Bit depth of the primary format: wav 16/24/32/32f (float), aiff and flac 16/24"),
|
|
1276
|
+
mp3Bitrate: z3.coerce.number().int().optional().describe("MP3 constant bitrate in kbps (32-320); format must be mp3"),
|
|
1277
|
+
dither: z3.boolean().optional().describe("Dither the master and stems (use when reducing to 16 bit)"),
|
|
1278
|
+
noiseShaping: z3.boolean().optional().describe("Noise shaping with the dither"),
|
|
1279
|
+
normalize: z3.enum(["off", "lufs_i", "rms", "peak", "true_peak", "lufs_m_max", "lufs_s_max"]).optional().describe("Normalize every rendered file to normalizeTarget by this measure"),
|
|
1280
|
+
normalizeTarget: z3.coerce.number().optional().describe("Normalize target in dB (LUFS for lufs_*; dBFS for peak/true_peak), -70 to 0"),
|
|
1281
|
+
normalizeOnlyTooLoud: z3.boolean().optional().describe("Only turn down files louder than the target"),
|
|
1282
|
+
limit: z3.boolean().optional().describe("Brickwall-limit the render at limitCeiling"),
|
|
1283
|
+
limitCeiling: z3.coerce.number().optional().describe("Limiter ceiling in dB, -30 to 0 (e.g. -1)"),
|
|
1284
|
+
limitTruePeak: z3.boolean().optional().describe("Limit on true peak instead of sample peak"),
|
|
1285
|
+
metadata: z3.object({
|
|
1286
|
+
title: z3.string().optional(),
|
|
1287
|
+
artist: z3.string().optional(),
|
|
1288
|
+
album: z3.string().optional(),
|
|
1289
|
+
genre: z3.string().optional(),
|
|
1290
|
+
year: z3.string().optional(),
|
|
1291
|
+
isrc: z3.string().optional(),
|
|
1292
|
+
comment: z3.string().optional(),
|
|
1293
|
+
description: z3.string().optional()
|
|
1138
1294
|
}).optional().describe('Embedded metadata, written to ID3 (MP3), INFO/BWF/AXML (WAV) and Vorbis (FLAC/OGG) at once; "" clears a field. Turns embedding on'),
|
|
1139
|
-
metadataRaw:
|
|
1140
|
-
embedMetadata:
|
|
1295
|
+
metadataRaw: z3.record(z3.string(), z3.string()).optional().describe('Exact REAPER metadata keys, e.g. {"ID3:TCOM": "Composer"}; "" clears'),
|
|
1296
|
+
embedMetadata: z3.boolean().optional().describe("Embed the stored metadata in rendered files")
|
|
1141
1297
|
},
|
|
1142
1298
|
async ({ regionMatrix, metadata, metadataRaw, ...params }) => reply(await sendCommand("set_render_settings", { ...params, ...json({ regionMatrix, metadata, metadataRaw }) }))
|
|
1143
1299
|
);
|
|
@@ -1145,9 +1301,9 @@ function registerProjectOpsTools(server) {
|
|
|
1145
1301
|
"render_project",
|
|
1146
1302
|
"Render the project with its current render settings (set them with set_render_settings) and return the files written, each measured: duration, integrated LUFS, true peak and sample peak. Synchronous: REAPER is busy until the render finishes, so keep renders short. Refused when a target file already exists (REAPER would ask) unless overwrite is true, when bounds is time_selection with no time selection, and when the format or secondary format is an encoder outside wav/aiff/flac/mp3/ogg/opus (they can open a dialog).",
|
|
1147
1303
|
{
|
|
1148
|
-
overwrite:
|
|
1149
|
-
tracks:
|
|
1150
|
-
analyze:
|
|
1304
|
+
overwrite: z3.boolean().optional().describe("Delete existing target files before rendering"),
|
|
1305
|
+
tracks: z3.array(trackRef).optional().describe('For source stems / master_and_stems / selected_via_master: the tracks to render (index, name or "{GUID}"), selected for this render only'),
|
|
1306
|
+
analyze: z3.boolean().optional().describe("Measure each file written (default true; up to 16 files)")
|
|
1151
1307
|
},
|
|
1152
1308
|
async ({ overwrite: overwrite2, tracks: tracks2, analyze }) => reply(await sendCommand("render_project", { overwrite: overwrite2, analyze, ...json({ tracks: tracks2 }) }, RENDER_TIMEOUT_MS))
|
|
1153
1309
|
);
|
|
@@ -1155,13 +1311,13 @@ function registerProjectOpsTools(server) {
|
|
|
1155
1311
|
"render_versions",
|
|
1156
1312
|
`Render alternate versions in one call (instrumental, a cappella, TV mix, clean): for each version the listed tracks are muted on top of the current mutes, the file pattern gets "-<name>" (or the version's own filePattern), and the project renders with the current settings. Every track, name and target is checked before the first render; mutes and the file pattern are restored afterwards, also when a render fails. Each file comes back measured like render_project.`,
|
|
1157
1313
|
{
|
|
1158
|
-
versions:
|
|
1159
|
-
name:
|
|
1160
|
-
mute:
|
|
1161
|
-
filePattern:
|
|
1314
|
+
versions: z3.array(z3.object({
|
|
1315
|
+
name: z3.string().describe("Version name, used in the file name: letters, digits, space, - _ ."),
|
|
1316
|
+
mute: z3.array(trackRef).optional().describe('Tracks muted in this version (index, name, "{GUID}")'),
|
|
1317
|
+
filePattern: z3.string().optional().describe('File pattern for this version instead of "<pattern>-<name>"')
|
|
1162
1318
|
})).min(1).max(16).describe("The versions to render, in order"),
|
|
1163
|
-
overwrite:
|
|
1164
|
-
analyze:
|
|
1319
|
+
overwrite: z3.boolean().optional().describe("Replace existing target files"),
|
|
1320
|
+
analyze: z3.boolean().optional().describe("Measure each file written (default true)")
|
|
1165
1321
|
},
|
|
1166
1322
|
async ({ versions, overwrite: overwrite2, analyze }) => reply(await sendCommand("render_versions", { overwrite: overwrite2, analyze, ...json({ versions }) }, RENDER_TIMEOUT_MS * 4))
|
|
1167
1323
|
);
|
|
@@ -1175,20 +1331,20 @@ function registerProjectOpsTools(server) {
|
|
|
1175
1331
|
"set_project_settings",
|
|
1176
1332
|
"Set any of: sampleRate, useProjectSampleRate, title, author, notes, repeat, metronome. Returns the settings as read back. metronome is a global REAPER option (it is not stored in the project and undo does not revert it). Invalid values change nothing.",
|
|
1177
1333
|
{
|
|
1178
|
-
sampleRate:
|
|
1179
|
-
useProjectSampleRate:
|
|
1180
|
-
title:
|
|
1181
|
-
author:
|
|
1182
|
-
notes:
|
|
1183
|
-
repeat:
|
|
1184
|
-
metronome:
|
|
1334
|
+
sampleRate: z3.coerce.number().int().min(8e3).max(768e3).optional().describe("Project sample rate (Hz)"),
|
|
1335
|
+
useProjectSampleRate: z3.boolean().optional().describe("Force the project sample rate (may reconfigure the audio device)"),
|
|
1336
|
+
title: z3.string().optional().describe("Project title (metadata)"),
|
|
1337
|
+
author: z3.string().optional().describe("Project author (metadata)"),
|
|
1338
|
+
notes: z3.string().optional().describe("Project notes (replaces them)"),
|
|
1339
|
+
repeat: z3.boolean().optional().describe("Repeat / loop playback of the time selection"),
|
|
1340
|
+
metronome: z3.boolean().optional().describe("Metronome on/off")
|
|
1185
1341
|
},
|
|
1186
1342
|
async (params) => reply(await sendCommand("set_project_settings", params))
|
|
1187
1343
|
);
|
|
1188
1344
|
}
|
|
1189
1345
|
|
|
1190
1346
|
// apps/reaper-mcp-server/src/tools/tracks.ts
|
|
1191
|
-
import { z as
|
|
1347
|
+
import { z as z4 } from "zod/v4";
|
|
1192
1348
|
var COMPACT_FIELDS = ["index", "name", "parentIndex", "depth", "volume", "pan", "mute", "solo", "fxCount"];
|
|
1193
1349
|
function compactTrack(t) {
|
|
1194
1350
|
const out2 = {};
|
|
@@ -1223,11 +1379,11 @@ function registerTrackTools(server) {
|
|
|
1223
1379
|
"list_tracks",
|
|
1224
1380
|
"List tracks in the current REAPER project with name, index, volume, mute/solo state, and folder structure. In large sessions filter it: parent (a folder track \u2014 returns everything inside it), nameContains, compact (index, name, parentIndex, depth, volume, pan, mute, solo, fxCount only), offset/limit. With no params it returns every track as before; with any, it returns { total, offset, returned, hasMore, tracks }.",
|
|
1225
1381
|
{
|
|
1226
|
-
parent:
|
|
1227
|
-
nameContains:
|
|
1228
|
-
compact:
|
|
1229
|
-
offset:
|
|
1230
|
-
limit:
|
|
1382
|
+
parent: z4.union([z4.coerce.number().int().min(0), z4.string().min(1)]).optional().describe("Folder track (index or exact name) \u2014 return only the tracks inside it, at any depth"),
|
|
1383
|
+
nameContains: z4.string().min(1).optional().describe("Only tracks whose name contains this (case-insensitive)"),
|
|
1384
|
+
compact: z4.boolean().optional().describe("Only index, name, parentIndex, depth, volume, pan, mute, solo, fxCount"),
|
|
1385
|
+
offset: z4.coerce.number().int().min(0).optional().describe("Skip this many matching tracks (default 0)"),
|
|
1386
|
+
limit: z4.coerce.number().int().min(1).max(500).optional().describe("Return at most this many tracks")
|
|
1231
1387
|
},
|
|
1232
1388
|
async (params) => {
|
|
1233
1389
|
const res = await sendCommand("list_tracks");
|
|
@@ -1259,7 +1415,7 @@ function registerTrackTools(server) {
|
|
|
1259
1415
|
server.tool(
|
|
1260
1416
|
"get_track_properties",
|
|
1261
1417
|
"Get detailed properties of a specific track including volume, pan, mute, solo, and FX chain",
|
|
1262
|
-
{ trackIndex:
|
|
1418
|
+
{ trackIndex: z4.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)") },
|
|
1263
1419
|
async ({ trackIndex: trackIndex5 }) => {
|
|
1264
1420
|
const res = await sendCommand("get_track_properties", { trackIndex: trackIndex5 });
|
|
1265
1421
|
if (!res.success) {
|
|
@@ -1272,9 +1428,9 @@ function registerTrackTools(server) {
|
|
|
1272
1428
|
"set_track_property",
|
|
1273
1429
|
"Set a track property: volume (dB), pan (-1.0 to 1.0), mute/solo/recordArm/phase (0/1), input (REAPER input index), playOffsetMs (track playback offset in ms, negative = earlier; use with measure_track_alignment)",
|
|
1274
1430
|
{
|
|
1275
|
-
trackIndex:
|
|
1276
|
-
property:
|
|
1277
|
-
value:
|
|
1431
|
+
trackIndex: z4.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)"),
|
|
1432
|
+
property: z4.enum(["volume", "pan", "mute", "solo", "recordArm", "phase", "input", "playOffsetMs"]).describe("Property to set: volume (dB), pan (-1.0\u20131.0), mute/solo/recordArm/phase (0 or 1), input (REAPER input index, -1=no input), playOffsetMs (ms, -500..500)"),
|
|
1433
|
+
value: z4.coerce.number().describe("Value: volume in dB, pan -1.0\u20131.0, mute/solo/recordArm/phase 0 or 1, input = REAPER input index")
|
|
1278
1434
|
},
|
|
1279
1435
|
async ({ trackIndex: trackIndex5, property, value }) => {
|
|
1280
1436
|
if (property === "playOffsetMs" && Math.abs(value) > 500) {
|
|
@@ -1290,15 +1446,15 @@ function registerTrackTools(server) {
|
|
|
1290
1446
|
}
|
|
1291
1447
|
|
|
1292
1448
|
// apps/reaper-mcp-server/src/tools/fx.ts
|
|
1293
|
-
import { z as
|
|
1449
|
+
import { z as z5 } from "zod/v4";
|
|
1294
1450
|
function registerFxTools(server) {
|
|
1295
1451
|
server.tool(
|
|
1296
1452
|
"add_fx",
|
|
1297
1453
|
`Add an FX plugin to a track by name (e.g. "ReaEQ", "JS: Schwa's Spectral Analyzer", "VST: Pro-Q 3")`,
|
|
1298
1454
|
{
|
|
1299
|
-
trackIndex:
|
|
1300
|
-
fxName:
|
|
1301
|
-
position:
|
|
1455
|
+
trackIndex: z5.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)"),
|
|
1456
|
+
fxName: z5.string().describe("FX plugin name (partial match supported)"),
|
|
1457
|
+
position: z5.coerce.number().int().optional().describe("0-based slot to insert at (0 = first); -1 or omit to append")
|
|
1302
1458
|
},
|
|
1303
1459
|
async ({ trackIndex: trackIndex5, fxName, position }) => {
|
|
1304
1460
|
const res = await sendCommand("add_fx", { trackIndex: trackIndex5, fxName, position: position ?? -1 });
|
|
@@ -1312,8 +1468,8 @@ function registerFxTools(server) {
|
|
|
1312
1468
|
"remove_fx",
|
|
1313
1469
|
"Remove an FX plugin from a track by its index in the FX chain",
|
|
1314
1470
|
{
|
|
1315
|
-
trackIndex:
|
|
1316
|
-
fxIndex:
|
|
1471
|
+
trackIndex: z5.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)"),
|
|
1472
|
+
fxIndex: z5.coerce.number().int().min(0).describe("Zero-based FX index in the chain")
|
|
1317
1473
|
},
|
|
1318
1474
|
async ({ trackIndex: trackIndex5, fxIndex: fxIndex3 }) => {
|
|
1319
1475
|
const res = await sendCommand("remove_fx", { trackIndex: trackIndex5, fxIndex: fxIndex3 });
|
|
@@ -1327,12 +1483,12 @@ function registerFxTools(server) {
|
|
|
1327
1483
|
"get_fx_parameters",
|
|
1328
1484
|
"List parameters of an FX plugin with current values and ranges. Supports filtering by name pattern, changed-only filter, and pagination. For a quick summary of active EQ bands or compressor settings, use analyze_fx instead.",
|
|
1329
1485
|
{
|
|
1330
|
-
trackIndex:
|
|
1331
|
-
fxIndex:
|
|
1332
|
-
namePattern:
|
|
1333
|
-
changedOnly:
|
|
1334
|
-
offset:
|
|
1335
|
-
limit:
|
|
1486
|
+
trackIndex: z5.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)"),
|
|
1487
|
+
fxIndex: z5.coerce.number().int().min(0).describe("Zero-based FX index in the chain"),
|
|
1488
|
+
namePattern: z5.string().optional().describe('Filter params by name (case-insensitive substring match, e.g. "Gain", "Band 1")'),
|
|
1489
|
+
changedOnly: z5.boolean().optional().describe("Only return params that appear non-default (value differs from minimum or formatted value suggests activity)"),
|
|
1490
|
+
offset: z5.coerce.number().int().min(0).optional().describe("Skip first N matching params (default 0)"),
|
|
1491
|
+
limit: z5.coerce.number().int().min(1).optional().describe("Max params to return (default all)")
|
|
1336
1492
|
},
|
|
1337
1493
|
async ({ trackIndex: trackIndex5, fxIndex: fxIndex3, namePattern, changedOnly, offset, limit }) => {
|
|
1338
1494
|
const res = await sendCommand("get_fx_parameters", {
|
|
@@ -1353,8 +1509,8 @@ function registerFxTools(server) {
|
|
|
1353
1509
|
"analyze_fx",
|
|
1354
1510
|
"Analyze an FX plugin and return a compact summary: FX name, preset, and notable (non-default) parameters. For EQ plugins, detects active bands with frequency/gain/Q/shape. For compressors, extracts threshold/ratio/attack/release/makeup. Use this before get_fx_parameters to understand what a plugin is doing without reading 500+ parameters.",
|
|
1355
1511
|
{
|
|
1356
|
-
trackIndex:
|
|
1357
|
-
fxIndex:
|
|
1512
|
+
trackIndex: z5.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)"),
|
|
1513
|
+
fxIndex: z5.coerce.number().int().min(0).describe("Zero-based FX index in the chain")
|
|
1358
1514
|
},
|
|
1359
1515
|
async ({ trackIndex: trackIndex5, fxIndex: fxIndex3 }) => {
|
|
1360
1516
|
const res = await sendCommand("analyze_fx", { trackIndex: trackIndex5, fxIndex: fxIndex3 });
|
|
@@ -1368,10 +1524,10 @@ function registerFxTools(server) {
|
|
|
1368
1524
|
"set_fx_parameter",
|
|
1369
1525
|
"Set a specific FX parameter value (normalized 0.0\u20131.0 for most plugins; use the parameter maxValue from get_fx_parameters when it is above 1)",
|
|
1370
1526
|
{
|
|
1371
|
-
trackIndex:
|
|
1372
|
-
fxIndex:
|
|
1373
|
-
paramIndex:
|
|
1374
|
-
value:
|
|
1527
|
+
trackIndex: z5.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)"),
|
|
1528
|
+
fxIndex: z5.coerce.number().int().min(0).describe("Zero-based FX index in the chain"),
|
|
1529
|
+
paramIndex: z5.coerce.number().int().min(0).describe("Zero-based parameter index"),
|
|
1530
|
+
value: z5.coerce.number().describe("Parameter value: normalized 0.0\u20131.0 for most plugins; a few use their own range (ReaComp Threshold/Wet/Dry 0\u20132 linear gain, JSFX raw slider values). Check minValue/maxValue from get_fx_parameters")
|
|
1375
1531
|
},
|
|
1376
1532
|
async ({ trackIndex: trackIndex5, fxIndex: fxIndex3, paramIndex, value }) => {
|
|
1377
1533
|
const res = await sendCommand("set_fx_parameter", { trackIndex: trackIndex5, fxIndex: fxIndex3, paramIndex, value });
|
|
@@ -1385,9 +1541,9 @@ function registerFxTools(server) {
|
|
|
1385
1541
|
"set_fx_enabled",
|
|
1386
1542
|
"Enable or disable (bypass) an FX plugin on a track",
|
|
1387
1543
|
{
|
|
1388
|
-
trackIndex:
|
|
1389
|
-
fxIndex:
|
|
1390
|
-
enabled:
|
|
1544
|
+
trackIndex: z5.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)"),
|
|
1545
|
+
fxIndex: z5.coerce.number().int().min(0).describe("Zero-based FX index in the chain"),
|
|
1546
|
+
enabled: z5.coerce.number().int().min(0).max(1).describe("1 = enabled, 0 = disabled (bypassed)")
|
|
1391
1547
|
},
|
|
1392
1548
|
async ({ trackIndex: trackIndex5, fxIndex: fxIndex3, enabled }) => {
|
|
1393
1549
|
const res = await sendCommand("set_fx_enabled", { trackIndex: trackIndex5, fxIndex: fxIndex3, enabled });
|
|
@@ -1401,9 +1557,9 @@ function registerFxTools(server) {
|
|
|
1401
1557
|
"set_fx_offline",
|
|
1402
1558
|
"Set an FX plugin online or offline. Offline FX uses no CPU but preserves settings.",
|
|
1403
1559
|
{
|
|
1404
|
-
trackIndex:
|
|
1405
|
-
fxIndex:
|
|
1406
|
-
offline:
|
|
1560
|
+
trackIndex: z5.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)"),
|
|
1561
|
+
fxIndex: z5.coerce.number().int().min(0).describe("Zero-based FX index in the chain"),
|
|
1562
|
+
offline: z5.coerce.number().int().min(0).max(1).describe("1 = offline, 0 = online")
|
|
1407
1563
|
},
|
|
1408
1564
|
async ({ trackIndex: trackIndex5, fxIndex: fxIndex3, offline }) => {
|
|
1409
1565
|
const res = await sendCommand("set_fx_offline", { trackIndex: trackIndex5, fxIndex: fxIndex3, offline });
|
|
@@ -1416,7 +1572,7 @@ function registerFxTools(server) {
|
|
|
1416
1572
|
}
|
|
1417
1573
|
|
|
1418
1574
|
// apps/reaper-mcp-server/src/tools/meters.ts
|
|
1419
|
-
import { z as
|
|
1575
|
+
import { z as z6 } from "zod/v4";
|
|
1420
1576
|
|
|
1421
1577
|
// apps/reaper-mcp-server/src/tools/spectrum.ts
|
|
1422
1578
|
var CENTRES = [
|
|
@@ -1526,7 +1682,7 @@ function registerMeterTools(server) {
|
|
|
1526
1682
|
"read_track_meters",
|
|
1527
1683
|
"Read real-time peak and RMS levels (in dB) for a track. Returns L/R peak and RMS values.",
|
|
1528
1684
|
{
|
|
1529
|
-
trackIndex:
|
|
1685
|
+
trackIndex: z6.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)")
|
|
1530
1686
|
},
|
|
1531
1687
|
async ({ trackIndex: trackIndex5 }) => {
|
|
1532
1688
|
const res = await sendCommand("read_track_meters", { trackIndex: trackIndex5 });
|
|
@@ -1540,9 +1696,9 @@ function registerMeterTools(server) {
|
|
|
1540
1696
|
"read_track_spectrum",
|
|
1541
1697
|
"Read the real-time frequency spectrum of a track while audio plays. Auto-inserts the MCP Spectrum Analyzer JSFX if not present. Returns 1/3-octave bands (25 Hz-16 kHz, ~0.5 s smoothed), each with raw `db` and K-weighted `kDb` (the BS.1770 weighting LUFS uses). Judge on `kDb`, never `db` (raw levels overstate the lows and understate 2-5 kHz), and compare a band only with the same band on another track or a reference. Pre-fader (the analyzer sits in the track FX chain); each read is a ~0.5 s snapshot, so read several times. Raw FFT bins only with includeBins.",
|
|
1542
1698
|
{
|
|
1543
|
-
trackIndex:
|
|
1544
|
-
fftSize:
|
|
1545
|
-
includeBins:
|
|
1699
|
+
trackIndex: z6.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)"),
|
|
1700
|
+
fftSize: z6.coerce.number().int().optional().describe("FFT size (default 4096). Options: 512, 1024, 2048, 4096, 8192"),
|
|
1701
|
+
includeBins: z6.boolean().optional().describe("Also return every raw FFT bin (large: fftSize/2 values)")
|
|
1546
1702
|
},
|
|
1547
1703
|
async ({ trackIndex: trackIndex5, fftSize, includeBins }) => {
|
|
1548
1704
|
let res = await sendCommand("read_track_spectrum", { trackIndex: trackIndex5, fftSize: fftSize ?? 4096 });
|
|
@@ -1560,7 +1716,7 @@ function registerMeterTools(server) {
|
|
|
1560
1716
|
}
|
|
1561
1717
|
|
|
1562
1718
|
// apps/reaper-mcp-server/src/tools/transport.ts
|
|
1563
|
-
import { z as
|
|
1719
|
+
import { z as z7 } from "zod/v4";
|
|
1564
1720
|
function registerTransportTools(server) {
|
|
1565
1721
|
server.tool(
|
|
1566
1722
|
"play",
|
|
@@ -1614,7 +1770,7 @@ function registerTransportTools(server) {
|
|
|
1614
1770
|
"set_cursor_position",
|
|
1615
1771
|
"Move the edit cursor to a specific position in seconds from project start",
|
|
1616
1772
|
{
|
|
1617
|
-
position:
|
|
1773
|
+
position: z7.coerce.number().min(0).describe("Position in seconds from project start")
|
|
1618
1774
|
},
|
|
1619
1775
|
async ({ position }) => {
|
|
1620
1776
|
const res = await sendCommand("set_cursor_position", { position });
|
|
@@ -1627,13 +1783,13 @@ function registerTransportTools(server) {
|
|
|
1627
1783
|
}
|
|
1628
1784
|
|
|
1629
1785
|
// apps/reaper-mcp-server/src/tools/discovery.ts
|
|
1630
|
-
import { z as
|
|
1786
|
+
import { z as z8 } from "zod/v4";
|
|
1631
1787
|
function registerDiscoveryTools(server) {
|
|
1632
1788
|
server.tool(
|
|
1633
1789
|
"list_available_fx",
|
|
1634
1790
|
"Enumerate all installed FX plugins in REAPER (VST, VST3, JS, CLAP, AU) with an optional category filter",
|
|
1635
1791
|
{
|
|
1636
|
-
category:
|
|
1792
|
+
category: z8.string().optional().describe('Optional filter: e.g. "VST", "VST3", "JS", "AU", "CLAP"')
|
|
1637
1793
|
},
|
|
1638
1794
|
async ({ category }) => {
|
|
1639
1795
|
const res = await sendCommand("list_available_fx", { category });
|
|
@@ -1647,7 +1803,7 @@ function registerDiscoveryTools(server) {
|
|
|
1647
1803
|
"search_fx",
|
|
1648
1804
|
"Search installed FX plugins by name (case-insensitive substring match)",
|
|
1649
1805
|
{
|
|
1650
|
-
query:
|
|
1806
|
+
query: z8.string().min(1).describe("Search term to match against FX plugin names")
|
|
1651
1807
|
},
|
|
1652
1808
|
async ({ query }) => {
|
|
1653
1809
|
const res = await sendCommand("search_fx", { query });
|
|
@@ -1660,14 +1816,14 @@ function registerDiscoveryTools(server) {
|
|
|
1660
1816
|
}
|
|
1661
1817
|
|
|
1662
1818
|
// apps/reaper-mcp-server/src/tools/presets.ts
|
|
1663
|
-
import { z as
|
|
1819
|
+
import { z as z9 } from "zod/v4";
|
|
1664
1820
|
function registerPresetTools(server) {
|
|
1665
1821
|
server.tool(
|
|
1666
1822
|
"get_fx_preset_list",
|
|
1667
1823
|
"List all available presets for a specific FX plugin on a track. Reads names by loading each preset, then restores the FX state; a MIDI plugin (e.g. ReaControlMIDI) may send each preset's messages while listing. Lists over 256 (generic program slots) are not enumerated (truncated: true).",
|
|
1668
1824
|
{
|
|
1669
|
-
trackIndex:
|
|
1670
|
-
fxIndex:
|
|
1825
|
+
trackIndex: z9.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)"),
|
|
1826
|
+
fxIndex: z9.coerce.number().int().min(0).describe("Zero-based FX index in the chain")
|
|
1671
1827
|
},
|
|
1672
1828
|
async ({ trackIndex: trackIndex5, fxIndex: fxIndex3 }) => {
|
|
1673
1829
|
const res = await sendCommand("get_fx_preset_list", { trackIndex: trackIndex5, fxIndex: fxIndex3 });
|
|
@@ -1681,9 +1837,9 @@ function registerPresetTools(server) {
|
|
|
1681
1837
|
"set_fx_preset",
|
|
1682
1838
|
"Apply a named preset to an FX plugin on a track",
|
|
1683
1839
|
{
|
|
1684
|
-
trackIndex:
|
|
1685
|
-
fxIndex:
|
|
1686
|
-
presetName:
|
|
1840
|
+
trackIndex: z9.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)"),
|
|
1841
|
+
fxIndex: z9.coerce.number().int().min(0).describe("Zero-based FX index in the chain"),
|
|
1842
|
+
presetName: z9.string().min(1).describe("Exact preset name to apply")
|
|
1687
1843
|
},
|
|
1688
1844
|
async ({ trackIndex: trackIndex5, fxIndex: fxIndex3, presetName }) => {
|
|
1689
1845
|
const res = await sendCommand("set_fx_preset", { trackIndex: trackIndex5, fxIndex: fxIndex3, presetName });
|
|
@@ -1696,18 +1852,18 @@ function registerPresetTools(server) {
|
|
|
1696
1852
|
}
|
|
1697
1853
|
|
|
1698
1854
|
// apps/reaper-mcp-server/src/tools/snapshots.ts
|
|
1699
|
-
import { z as
|
|
1855
|
+
import { z as z10 } from "zod/v4";
|
|
1700
1856
|
function registerSnapshotTools(server) {
|
|
1701
1857
|
server.tool(
|
|
1702
1858
|
"snapshot_save",
|
|
1703
1859
|
"Save the current mixer state as a named snapshot. Stored in .reaper-mcp/snapshots/ alongside the project file (falls back to global bridge dir for unsaved projects). By default captures ALL tracks' volumes, pans, mutes, solos, FX bypass/offline states, full FX parameter values, preset names, track names/colors, and send levels. Pass trackIndices to scope the snapshot to specific tracks (e.g. just the master bus for an A/B that never touches other tracks). Pass fullChunk (or rely on its default-on when scoped) to capture exact track state chunks, which faithfully reproduce each plugin's internal state on restore \u2014 including plugins whose tone is driven by internal snapshots (e.g. Helix Native) that parameter-value capture cannot reproduce. Response includes storageLocation, scoped, fullChunk, and tracksCaptured.",
|
|
1704
1860
|
{
|
|
1705
|
-
name:
|
|
1706
|
-
description:
|
|
1707
|
-
includeFxParams:
|
|
1708
|
-
maxParamsPerFx:
|
|
1709
|
-
trackIndices:
|
|
1710
|
-
fullChunk:
|
|
1861
|
+
name: z10.string().min(1).describe('Unique snapshot name (e.g. "before-compression", "v1-mix")'),
|
|
1862
|
+
description: z10.string().optional().describe("Optional human-readable description"),
|
|
1863
|
+
includeFxParams: z10.boolean().optional().default(true).describe("Include FX parameter values in snapshot (default true). Only applies to non-chunk capture."),
|
|
1864
|
+
maxParamsPerFx: z10.coerce.number().int().min(1).max(2e3).optional().default(500).describe("Max parameters to capture per FX plugin (default 500). Only applies to non-chunk capture."),
|
|
1865
|
+
trackIndices: z10.array(z10.coerce.number().int().min(0)).optional().describe("Restrict the snapshot to these 0-based track indices. Omit to capture all tracks. Restoring a scoped snapshot only affects the listed tracks."),
|
|
1866
|
+
fullChunk: z10.boolean().optional().describe("Capture exact track state chunks (complete FX internal state, e.g. Helix Native snapshots) instead of parameter values. Defaults to true when trackIndices is set, false otherwise (whole-project chunk snapshots are large).")
|
|
1711
1867
|
},
|
|
1712
1868
|
async ({ name, description, includeFxParams, maxParamsPerFx, trackIndices, fullChunk }) => {
|
|
1713
1869
|
const res = await sendCommand("snapshot_save", { name, description, includeFxParams, maxParamsPerFx, trackIndices, fullChunk });
|
|
@@ -1721,9 +1877,9 @@ function registerSnapshotTools(server) {
|
|
|
1721
1877
|
"snapshot_restore",
|
|
1722
1878
|
"Restore a previously saved mixer snapshot by name. Reads from .reaper-mcp/snapshots/ alongside the project file (falls back to global bridge dir for unsaved projects). For chunk-based snapshots (saved with fullChunk), restores each captured track exactly via its state chunk \u2014 reproducing complete FX internal state (incl. plugin internal snapshots like Helix Native) and affecting only the tracks the snapshot captured. For parameter-based snapshots, restores volumes, pans, mutes, solos, FX bypass states, and FX parameters (parameters only when the plugin name matches, to avoid applying wrong values).",
|
|
1723
1879
|
{
|
|
1724
|
-
name:
|
|
1725
|
-
restoreTrackMeta:
|
|
1726
|
-
restoreSendLevels:
|
|
1880
|
+
name: z10.string().min(1).describe("Name of the snapshot to restore"),
|
|
1881
|
+
restoreTrackMeta: z10.boolean().optional().default(false).describe("Also restore track names and colors (default false)"),
|
|
1882
|
+
restoreSendLevels: z10.boolean().optional().default(true).describe("Restore send volume/pan/mute for existing sends (default true)")
|
|
1727
1883
|
},
|
|
1728
1884
|
async ({ name, restoreTrackMeta, restoreSendLevels }) => {
|
|
1729
1885
|
const res = await sendCommand("snapshot_restore", { name, restoreTrackMeta, restoreSendLevels });
|
|
@@ -1749,7 +1905,7 @@ function registerSnapshotTools(server) {
|
|
|
1749
1905
|
"snapshot_delete",
|
|
1750
1906
|
"Delete a named mixer snapshot. Removes the snapshot file from .reaper-mcp/snapshots/ alongside the project file (or global bridge dir for unsaved projects). This action is permanent and cannot be undone.",
|
|
1751
1907
|
{
|
|
1752
|
-
name:
|
|
1908
|
+
name: z10.string().min(1).describe("Name of the snapshot to delete")
|
|
1753
1909
|
},
|
|
1754
1910
|
async ({ name }) => {
|
|
1755
1911
|
const res = await sendCommand("snapshot_delete", { name });
|
|
@@ -1763,9 +1919,9 @@ function registerSnapshotTools(server) {
|
|
|
1763
1919
|
"snapshot_edit",
|
|
1764
1920
|
"Rename a mixer snapshot and/or change its description. The saved mixer state is kept. A new name whose file belongs to another snapshot is refused.",
|
|
1765
1921
|
{
|
|
1766
|
-
name:
|
|
1767
|
-
newName:
|
|
1768
|
-
description:
|
|
1922
|
+
name: z10.string().min(1).describe("Name of the snapshot to edit"),
|
|
1923
|
+
newName: z10.string().min(1).optional().describe("New name; omit to keep the name"),
|
|
1924
|
+
description: z10.string().optional().describe('New description; omit to keep it, "" clears it')
|
|
1769
1925
|
},
|
|
1770
1926
|
async ({ name, newName, description }) => {
|
|
1771
1927
|
const res = await sendCommand("snapshot_edit", { name, newName, description });
|
|
@@ -1778,13 +1934,13 @@ function registerSnapshotTools(server) {
|
|
|
1778
1934
|
}
|
|
1779
1935
|
|
|
1780
1936
|
// apps/reaper-mcp-server/src/tools/routing.ts
|
|
1781
|
-
import { z as
|
|
1937
|
+
import { z as z11 } from "zod/v4";
|
|
1782
1938
|
function registerRoutingTools(server) {
|
|
1783
1939
|
server.tool(
|
|
1784
1940
|
"get_track_routing",
|
|
1785
1941
|
"Get sends, receives, and parent/folder information for a track \u2014 useful for understanding bus structure",
|
|
1786
1942
|
{
|
|
1787
|
-
trackIndex:
|
|
1943
|
+
trackIndex: z11.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)")
|
|
1788
1944
|
},
|
|
1789
1945
|
async ({ trackIndex: trackIndex5 }) => {
|
|
1790
1946
|
const res = await sendCommand("get_track_routing", { trackIndex: trackIndex5 });
|
|
@@ -1797,7 +1953,7 @@ function registerRoutingTools(server) {
|
|
|
1797
1953
|
}
|
|
1798
1954
|
|
|
1799
1955
|
// apps/reaper-mcp-server/src/tools/analysis.ts
|
|
1800
|
-
import { z as
|
|
1956
|
+
import { z as z12 } from "zod/v4";
|
|
1801
1957
|
function sleep3(ms) {
|
|
1802
1958
|
return new Promise((resolve4) => setTimeout(resolve4, ms));
|
|
1803
1959
|
}
|
|
@@ -1812,8 +1968,8 @@ function registerAnalysisTools(server) {
|
|
|
1812
1968
|
"read_track_lufs",
|
|
1813
1969
|
"Read ITU-R BS.1770 loudness data for a track. Auto-inserts the MCP LUFS Meter JSFX if not present. Returns integrated, short-term (3s), and momentary (400ms) LUFS plus true inter-sample peak levels. Audio must be playing to accumulate data. The meter sits in the track FX chain, so it reads pre-fader: add the track volume (dB) for its level in the mix. Compare tracks in LU against the mix bus over the same section.",
|
|
1814
1970
|
{
|
|
1815
|
-
trackIndex:
|
|
1816
|
-
targetLufs:
|
|
1971
|
+
trackIndex: z12.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)"),
|
|
1972
|
+
targetLufs: z12.coerce.number().min(-60).max(0).optional().describe("The integrated loudness you are working to, in LUFS, from the task (e.g. -14 for streaming, -23 for EBU R128 broadcast). Optional; shown against the reading on the bridge page, never changes the measurement")
|
|
1817
1973
|
},
|
|
1818
1974
|
async ({ trackIndex: trackIndex5, targetLufs }) => {
|
|
1819
1975
|
const res = await sendCommand("read_track_lufs", { trackIndex: trackIndex5, ...targetLufs === void 0 ? {} : { targetLufs } });
|
|
@@ -1827,7 +1983,7 @@ function registerAnalysisTools(server) {
|
|
|
1827
1983
|
"read_track_correlation",
|
|
1828
1984
|
"Read stereo field correlation and M/S analysis for a track. Auto-inserts the MCP Correlation Meter JSFX if not present. Returns correlation coefficient (-1 to +1), stereo width, and mid/side levels. Audio must be playing to accumulate data.",
|
|
1829
1985
|
{
|
|
1830
|
-
trackIndex:
|
|
1986
|
+
trackIndex: z12.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)")
|
|
1831
1987
|
},
|
|
1832
1988
|
async ({ trackIndex: trackIndex5 }) => {
|
|
1833
1989
|
const res = await sendCommand("read_track_correlation", { trackIndex: trackIndex5 });
|
|
@@ -1841,7 +1997,7 @@ function registerAnalysisTools(server) {
|
|
|
1841
1997
|
"read_track_crest",
|
|
1842
1998
|
"Read crest factor (peak-to-RMS ratio) for a track. Auto-inserts the MCP Crest Factor Meter JSFX if not present. Returns crest factor in dB (higher = more dynamic, lower = over-compressed), peak hold level, and RMS level. Audio must be playing to accumulate data.",
|
|
1843
1999
|
{
|
|
1844
|
-
trackIndex:
|
|
2000
|
+
trackIndex: z12.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)")
|
|
1845
2001
|
},
|
|
1846
2002
|
async ({ trackIndex: trackIndex5 }) => {
|
|
1847
2003
|
const res = await sendCommand("read_track_crest", { trackIndex: trackIndex5 });
|
|
@@ -1855,14 +2011,14 @@ function registerAnalysisTools(server) {
|
|
|
1855
2011
|
"measure_tracks",
|
|
1856
2012
|
"Play audio and collect analysis measurements (LUFS, crest factor, correlation, spectrum) for one or more tracks in a single call. Handles playback start/stop automatically. LUFS and spectrum (1/3-octave bands) support multi-track; crest/correlation use global gmem and are only reliable for single-track measurement. First call may be slower due to JSFX meter auto-insertion. Readings are pre-fader (meters sit in each track FX chain): add each track volume to compare tracks; a folder/bus reads its children post-fader. Use this to balance tracks in LU and compare spectra on `kDb`. Afterwards it removes the MCP meters on the measured tracks (also ones an earlier call left) unless keepMeters. A meter that received no audio (muted, frozen or silent track, nothing in range) is reported under errors, not as numbers. For whole-song, folder or master numbers without playback, prefer analyze_track_offline.",
|
|
1857
2013
|
{
|
|
1858
|
-
trackIndices:
|
|
1859
|
-
metrics:
|
|
1860
|
-
durationSeconds:
|
|
1861
|
-
startPosition:
|
|
1862
|
-
fftSize:
|
|
1863
|
-
stopWhenDone:
|
|
1864
|
-
targetLufs:
|
|
1865
|
-
keepMeters:
|
|
2014
|
+
trackIndices: z12.array(z12.coerce.number().int().min(-1)).min(1).max(8).describe("Track indices to measure (max 8; -1 = master track)"),
|
|
2015
|
+
metrics: z12.array(z12.enum(["lufs", "crest", "correlation", "spectrum"])).min(1).describe("Which metrics to collect"),
|
|
2016
|
+
durationSeconds: z12.coerce.number().min(1).max(30).default(5).describe("How long to play for measurement (seconds)"),
|
|
2017
|
+
startPosition: z12.coerce.number().min(0).optional().describe("Project position to seek to before playing (seconds)"),
|
|
2018
|
+
fftSize: z12.coerce.number().int().optional().default(4096).describe("FFT size for spectrum analysis"),
|
|
2019
|
+
stopWhenDone: z12.boolean().optional().default(true).describe("Stop playback after measuring"),
|
|
2020
|
+
targetLufs: z12.coerce.number().min(-60).max(0).optional().describe("The integrated loudness you are working to, in LUFS, from the task (e.g. -14 for streaming, -23 for EBU R128 broadcast). Optional; shown against the reading on the bridge page, never changes the measurement"),
|
|
2021
|
+
keepMeters: z12.boolean().optional().default(false).describe("Leave the MCP meter JSFX on the tracks (default: remove them afterwards)")
|
|
1866
2022
|
},
|
|
1867
2023
|
async ({ trackIndices, metrics: metrics2, durationSeconds, startPosition, fftSize, stopWhenDone, targetLufs, keepMeters }) => {
|
|
1868
2024
|
try {
|
|
@@ -1973,15 +2129,15 @@ function registerAnalysisTools(server) {
|
|
|
1973
2129
|
}
|
|
1974
2130
|
|
|
1975
2131
|
// apps/reaper-mcp-server/src/tools/midi.ts
|
|
1976
|
-
import { z as
|
|
2132
|
+
import { z as z13 } from "zod/v4";
|
|
1977
2133
|
function registerMidiTools(server) {
|
|
1978
2134
|
server.tool(
|
|
1979
2135
|
"create_midi_item",
|
|
1980
2136
|
"Create an empty MIDI item on a track at a given time range (seconds). Use this before inserting notes.",
|
|
1981
2137
|
{
|
|
1982
|
-
trackIndex:
|
|
1983
|
-
startPosition:
|
|
1984
|
-
endPosition:
|
|
2138
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2139
|
+
startPosition: z13.coerce.number().min(0).describe("Start position in seconds from project start"),
|
|
2140
|
+
endPosition: z13.coerce.number().min(0).describe("End position in seconds from project start")
|
|
1985
2141
|
},
|
|
1986
2142
|
async ({ trackIndex: trackIndex5, startPosition, endPosition }) => {
|
|
1987
2143
|
const res = await sendCommand("create_midi_item", { trackIndex: trackIndex5, startPosition, endPosition });
|
|
@@ -1995,7 +2151,7 @@ function registerMidiTools(server) {
|
|
|
1995
2151
|
"list_midi_items",
|
|
1996
2152
|
"List all MIDI items on a track with position, length, and note/CC counts. ccCount counts CC messages only; channelEventCount and channelEventCounts include pitch bend, program change and pressure events",
|
|
1997
2153
|
{
|
|
1998
|
-
trackIndex:
|
|
2154
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index")
|
|
1999
2155
|
},
|
|
2000
2156
|
async ({ trackIndex: trackIndex5 }) => {
|
|
2001
2157
|
const res = await sendCommand("list_midi_items", { trackIndex: trackIndex5 });
|
|
@@ -2009,10 +2165,10 @@ function registerMidiTools(server) {
|
|
|
2009
2165
|
"get_midi_notes",
|
|
2010
2166
|
"Get MIDI notes in a MIDI item. Supports pagination with offset/limit for large items. For a high-level overview of a large MIDI item, use analyze_midi instead. Returns pitch (0-127, 60=C4), velocity (0-127), position and duration in beats from item start.",
|
|
2011
2167
|
{
|
|
2012
|
-
trackIndex:
|
|
2013
|
-
itemIndex:
|
|
2014
|
-
offset:
|
|
2015
|
-
limit:
|
|
2168
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2169
|
+
itemIndex: z13.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2170
|
+
offset: z13.coerce.number().min(0).optional().describe("Skip first N notes (default 0)"),
|
|
2171
|
+
limit: z13.coerce.number().min(1).optional().describe("Max notes to return (default all). Use with offset to paginate large items.")
|
|
2016
2172
|
},
|
|
2017
2173
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, offset, limit }) => {
|
|
2018
2174
|
const res = await sendCommand("get_midi_notes", { trackIndex: trackIndex5, itemIndex: itemIndex2, offset, limit });
|
|
@@ -2026,8 +2182,8 @@ function registerMidiTools(server) {
|
|
|
2026
2182
|
"analyze_midi",
|
|
2027
2183
|
"Analyze a MIDI item and return summary statistics computed in REAPER. Much more efficient than get_midi_notes for large items. Returns per-pitch stats (count, velocity min/max/avg/stddev), velocity histogram, and machine gun detection (consecutive identical velocities). Use this first to understand the MIDI data before reading individual notes.",
|
|
2028
2184
|
{
|
|
2029
|
-
trackIndex:
|
|
2030
|
-
itemIndex:
|
|
2185
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2186
|
+
itemIndex: z13.coerce.number().min(0).describe("0-based item index on the track")
|
|
2031
2187
|
},
|
|
2032
2188
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2 }) => {
|
|
2033
2189
|
const res = await sendCommand("analyze_midi", { trackIndex: trackIndex5, itemIndex: itemIndex2 });
|
|
@@ -2041,13 +2197,13 @@ function registerMidiTools(server) {
|
|
|
2041
2197
|
"insert_midi_note",
|
|
2042
2198
|
"Insert a single MIDI note. Pitch: 0-127 (60=C4/Middle C, 48=C3, 72=C5). Velocity: 1-127 (64=medium, 100=strong, 127=max). Position/duration in beats from item start (1.0=quarter, 0.5=eighth, 0.25=sixteenth).",
|
|
2043
2199
|
{
|
|
2044
|
-
trackIndex:
|
|
2045
|
-
itemIndex:
|
|
2046
|
-
pitch:
|
|
2047
|
-
velocity:
|
|
2048
|
-
startPosition:
|
|
2049
|
-
duration:
|
|
2050
|
-
channel:
|
|
2200
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2201
|
+
itemIndex: z13.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2202
|
+
pitch: z13.coerce.number().min(0).max(127).describe("MIDI note number (60=C4/Middle C)"),
|
|
2203
|
+
velocity: z13.coerce.number().min(1).max(127).describe("Note velocity (1-127)"),
|
|
2204
|
+
startPosition: z13.coerce.number().min(0).describe("Start position in beats from item start"),
|
|
2205
|
+
duration: z13.coerce.number().min(0).describe("Duration in beats (1.0=quarter note)"),
|
|
2206
|
+
channel: z13.coerce.number().min(0).max(15).optional().describe("MIDI channel 0-15 (default 0)")
|
|
2051
2207
|
},
|
|
2052
2208
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, pitch, velocity, startPosition, duration, channel }) => {
|
|
2053
2209
|
const res = await sendCommand("insert_midi_note", {
|
|
@@ -2069,14 +2225,14 @@ function registerMidiTools(server) {
|
|
|
2069
2225
|
"insert_midi_notes",
|
|
2070
2226
|
"Batch insert multiple MIDI notes in a single call. Pass a native array of note objects. Each note: { pitch, velocity, startPosition, duration, channel? }. Positions/durations in beats from item start (1.0=quarter, 0.5=eighth).",
|
|
2071
2227
|
{
|
|
2072
|
-
trackIndex:
|
|
2073
|
-
itemIndex:
|
|
2074
|
-
notes:
|
|
2075
|
-
pitch:
|
|
2076
|
-
velocity:
|
|
2077
|
-
startPosition:
|
|
2078
|
-
duration:
|
|
2079
|
-
channel:
|
|
2228
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2229
|
+
itemIndex: z13.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2230
|
+
notes: z13.array(z13.object({
|
|
2231
|
+
pitch: z13.coerce.number().min(0).max(127).describe("MIDI note number (60=C4/Middle C)"),
|
|
2232
|
+
velocity: z13.coerce.number().min(1).max(127).describe("Note velocity (1-127)"),
|
|
2233
|
+
startPosition: z13.coerce.number().min(0).describe("Start position in beats from item start"),
|
|
2234
|
+
duration: z13.coerce.number().min(0).describe("Duration in beats (1.0=quarter note)"),
|
|
2235
|
+
channel: z13.coerce.number().min(0).max(15).optional().describe("MIDI channel 0-15 (default 0)")
|
|
2080
2236
|
})).describe("Array of notes to insert")
|
|
2081
2237
|
},
|
|
2082
2238
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, notes }) => {
|
|
@@ -2091,14 +2247,14 @@ function registerMidiTools(server) {
|
|
|
2091
2247
|
"edit_midi_note",
|
|
2092
2248
|
"Edit an existing MIDI note by index. Only provided fields are changed. Positions/durations in beats from item start.",
|
|
2093
2249
|
{
|
|
2094
|
-
trackIndex:
|
|
2095
|
-
itemIndex:
|
|
2096
|
-
noteIndex:
|
|
2097
|
-
pitch:
|
|
2098
|
-
velocity:
|
|
2099
|
-
startPosition:
|
|
2100
|
-
duration:
|
|
2101
|
-
channel:
|
|
2250
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2251
|
+
itemIndex: z13.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2252
|
+
noteIndex: z13.coerce.number().min(0).describe("0-based note index"),
|
|
2253
|
+
pitch: z13.coerce.number().min(0).max(127).optional().describe("New pitch (0-127)"),
|
|
2254
|
+
velocity: z13.coerce.number().min(1).max(127).optional().describe("New velocity (1-127)"),
|
|
2255
|
+
startPosition: z13.coerce.number().min(0).optional().describe("New start position in beats from item start"),
|
|
2256
|
+
duration: z13.coerce.number().min(0).optional().describe("New duration in beats"),
|
|
2257
|
+
channel: z13.coerce.number().min(0).max(15).optional().describe("New MIDI channel (0-15)")
|
|
2102
2258
|
},
|
|
2103
2259
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, noteIndex, pitch, velocity, startPosition, duration, channel }) => {
|
|
2104
2260
|
const res = await sendCommand("edit_midi_note", {
|
|
@@ -2121,15 +2277,15 @@ function registerMidiTools(server) {
|
|
|
2121
2277
|
"edit_midi_notes",
|
|
2122
2278
|
"Batch edit multiple MIDI notes in a single call. Much more efficient than calling edit_midi_note repeatedly. Pass a native array of edit objects, each with noteIndex and any fields to change (pitch, velocity, startPosition, duration, channel). Only provided fields are changed.",
|
|
2123
2279
|
{
|
|
2124
|
-
trackIndex:
|
|
2125
|
-
itemIndex:
|
|
2126
|
-
edits:
|
|
2127
|
-
noteIndex:
|
|
2128
|
-
pitch:
|
|
2129
|
-
velocity:
|
|
2130
|
-
startPosition:
|
|
2131
|
-
duration:
|
|
2132
|
-
channel:
|
|
2280
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2281
|
+
itemIndex: z13.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2282
|
+
edits: z13.array(z13.object({
|
|
2283
|
+
noteIndex: z13.coerce.number().min(0).describe("0-based note index to edit"),
|
|
2284
|
+
pitch: z13.coerce.number().min(0).max(127).optional().describe("New pitch (0-127)"),
|
|
2285
|
+
velocity: z13.coerce.number().min(1).max(127).optional().describe("New velocity (1-127)"),
|
|
2286
|
+
startPosition: z13.coerce.number().min(0).optional().describe("New start position in beats from item start"),
|
|
2287
|
+
duration: z13.coerce.number().min(0).optional().describe("New duration in beats"),
|
|
2288
|
+
channel: z13.coerce.number().min(0).max(15).optional().describe("New MIDI channel (0-15)")
|
|
2133
2289
|
})).describe("Array of note edits to apply")
|
|
2134
2290
|
},
|
|
2135
2291
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, edits }) => {
|
|
@@ -2144,9 +2300,9 @@ function registerMidiTools(server) {
|
|
|
2144
2300
|
"delete_midi_note",
|
|
2145
2301
|
"Delete a MIDI note by index from a MIDI item",
|
|
2146
2302
|
{
|
|
2147
|
-
trackIndex:
|
|
2148
|
-
itemIndex:
|
|
2149
|
-
noteIndex:
|
|
2303
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2304
|
+
itemIndex: z13.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2305
|
+
noteIndex: z13.coerce.number().min(0).describe("0-based note index to delete")
|
|
2150
2306
|
},
|
|
2151
2307
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, noteIndex }) => {
|
|
2152
2308
|
const res = await sendCommand("delete_midi_note", { trackIndex: trackIndex5, itemIndex: itemIndex2, noteIndex });
|
|
@@ -2160,9 +2316,9 @@ function registerMidiTools(server) {
|
|
|
2160
2316
|
"get_midi_cc",
|
|
2161
2317
|
"Get CC (continuous controller) events from a MIDI item. Optionally filter by CC number (e.g. 1=modulation, 7=volume, 10=pan, 11=expression, 64=sustain).",
|
|
2162
2318
|
{
|
|
2163
|
-
trackIndex:
|
|
2164
|
-
itemIndex:
|
|
2165
|
-
ccNumber:
|
|
2319
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2320
|
+
itemIndex: z13.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2321
|
+
ccNumber: z13.coerce.number().min(0).max(127).optional().describe("Optional: filter by CC number (0-127)")
|
|
2166
2322
|
},
|
|
2167
2323
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, ccNumber }) => {
|
|
2168
2324
|
const res = await sendCommand("get_midi_cc", { trackIndex: trackIndex5, itemIndex: itemIndex2, ccNumber });
|
|
@@ -2176,12 +2332,12 @@ function registerMidiTools(server) {
|
|
|
2176
2332
|
"insert_midi_cc",
|
|
2177
2333
|
"Insert a CC (continuous controller) event. Common CC numbers: 1=modulation, 7=volume, 10=pan, 11=expression, 64=sustain, 74=filter cutoff.",
|
|
2178
2334
|
{
|
|
2179
|
-
trackIndex:
|
|
2180
|
-
itemIndex:
|
|
2181
|
-
ccNumber:
|
|
2182
|
-
value:
|
|
2183
|
-
position:
|
|
2184
|
-
channel:
|
|
2335
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2336
|
+
itemIndex: z13.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2337
|
+
ccNumber: z13.coerce.number().min(0).max(127).describe("CC number (0-127)"),
|
|
2338
|
+
value: z13.coerce.number().min(0).max(127).describe("CC value (0-127)"),
|
|
2339
|
+
position: z13.coerce.number().min(0).describe("Position in beats from item start"),
|
|
2340
|
+
channel: z13.coerce.number().min(0).max(15).optional().describe("MIDI channel 0-15 (default 0)")
|
|
2185
2341
|
},
|
|
2186
2342
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, ccNumber, value, position, channel }) => {
|
|
2187
2343
|
const res = await sendCommand("insert_midi_cc", {
|
|
@@ -2202,9 +2358,9 @@ function registerMidiTools(server) {
|
|
|
2202
2358
|
"delete_midi_cc",
|
|
2203
2359
|
"Delete a CC event from a MIDI item by the ccIndex get_midi_cc returned. ccIndex counts every channel event (pitch bend, program change and pressure too), so CC indexes can skip numbers; only pass an index get_midi_cc listed",
|
|
2204
2360
|
{
|
|
2205
|
-
trackIndex:
|
|
2206
|
-
itemIndex:
|
|
2207
|
-
ccIndex:
|
|
2361
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2362
|
+
itemIndex: z13.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2363
|
+
ccIndex: z13.coerce.number().min(0).describe("0-based channel-event index to delete (ccIndex from get_midi_cc)")
|
|
2208
2364
|
},
|
|
2209
2365
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, ccIndex }) => {
|
|
2210
2366
|
const res = await sendCommand("delete_midi_cc", { trackIndex: trackIndex5, itemIndex: itemIndex2, ccIndex });
|
|
@@ -2218,8 +2374,8 @@ function registerMidiTools(server) {
|
|
|
2218
2374
|
"get_midi_item_properties",
|
|
2219
2375
|
"Get detailed properties of a MIDI item including position, length, note count, CC count (CC messages only), channel-event counts by type, mute state, and loop setting",
|
|
2220
2376
|
{
|
|
2221
|
-
trackIndex:
|
|
2222
|
-
itemIndex:
|
|
2377
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2378
|
+
itemIndex: z13.coerce.number().min(0).describe("0-based item index on the track")
|
|
2223
2379
|
},
|
|
2224
2380
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2 }) => {
|
|
2225
2381
|
const res = await sendCommand("get_midi_item_properties", { trackIndex: trackIndex5, itemIndex: itemIndex2 });
|
|
@@ -2233,12 +2389,12 @@ function registerMidiTools(server) {
|
|
|
2233
2389
|
"set_midi_item_properties",
|
|
2234
2390
|
"Set MIDI item properties: position (seconds), length (seconds), mute, loop source",
|
|
2235
2391
|
{
|
|
2236
|
-
trackIndex:
|
|
2237
|
-
itemIndex:
|
|
2238
|
-
position:
|
|
2239
|
-
length:
|
|
2240
|
-
mute:
|
|
2241
|
-
loopSource:
|
|
2392
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2393
|
+
itemIndex: z13.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2394
|
+
position: z13.coerce.number().min(0).optional().describe("New position in seconds from project start"),
|
|
2395
|
+
length: z13.coerce.number().min(0).optional().describe("New length in seconds"),
|
|
2396
|
+
mute: z13.coerce.number().min(0).max(1).optional().describe("Mute state (0=unmuted, 1=muted)"),
|
|
2397
|
+
loopSource: z13.coerce.number().min(0).max(1).optional().describe("Loop source (0=no loop, 1=loop)")
|
|
2242
2398
|
},
|
|
2243
2399
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, position, length, mute, loopSource }) => {
|
|
2244
2400
|
const res = await sendCommand("set_midi_item_properties", {
|
|
@@ -2259,10 +2415,10 @@ function registerMidiTools(server) {
|
|
|
2259
2415
|
"send_midi_cc",
|
|
2260
2416
|
"Send a MIDI CC (continuous controller) event in real-time to a track's MIDI output. Auto-inserts the MCP MIDI Emitter JSFX if not present. Common CC numbers: 1=modulation, 7=volume, 10=pan, 11=expression, 64=sustain, 74=filter cutoff.",
|
|
2261
2417
|
{
|
|
2262
|
-
trackIndex:
|
|
2263
|
-
cc:
|
|
2264
|
-
value:
|
|
2265
|
-
channel:
|
|
2418
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2419
|
+
cc: z13.coerce.number().min(0).max(127).describe("CC number (0-127)"),
|
|
2420
|
+
value: z13.coerce.number().min(0).max(127).describe("CC value (0-127)"),
|
|
2421
|
+
channel: z13.coerce.number().min(0).max(15).optional().describe("MIDI channel 0-15 (default 0)")
|
|
2266
2422
|
},
|
|
2267
2423
|
async ({ trackIndex: trackIndex5, cc, value, channel }) => {
|
|
2268
2424
|
const res = await sendCommand("send_midi_cc", { trackIndex: trackIndex5, cc, value, channel: channel ?? 0 });
|
|
@@ -2276,11 +2432,11 @@ function registerMidiTools(server) {
|
|
|
2276
2432
|
"send_midi_pc",
|
|
2277
2433
|
"Send a MIDI program change in real-time, optionally preceded by bank select (CC0 MSB + CC32 LSB). Auto-inserts the MCP MIDI Emitter JSFX if not present.",
|
|
2278
2434
|
{
|
|
2279
|
-
trackIndex:
|
|
2280
|
-
program:
|
|
2281
|
-
channel:
|
|
2282
|
-
bankMsb:
|
|
2283
|
-
bankLsb:
|
|
2435
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2436
|
+
program: z13.coerce.number().min(0).max(127).describe("Program number (0-127)"),
|
|
2437
|
+
channel: z13.coerce.number().min(0).max(15).optional().describe("MIDI channel 0-15 (default 0)"),
|
|
2438
|
+
bankMsb: z13.coerce.number().min(0).max(127).optional().describe("Bank select MSB (CC0, 0-127) \u2014 omit if no bank select needed"),
|
|
2439
|
+
bankLsb: z13.coerce.number().min(0).max(127).optional().describe("Bank select LSB (CC32, 0-127) \u2014 omit if no bank select needed")
|
|
2284
2440
|
},
|
|
2285
2441
|
async ({ trackIndex: trackIndex5, program, channel, bankMsb, bankLsb }) => {
|
|
2286
2442
|
const res = await sendCommand("send_midi_pc", { trackIndex: trackIndex5, program, channel: channel ?? 0, bankMsb, bankLsb });
|
|
@@ -2294,11 +2450,11 @@ function registerMidiTools(server) {
|
|
|
2294
2450
|
"send_midi_note",
|
|
2295
2451
|
"Send a MIDI note-on in real-time to a track's MIDI output. If durationMs is provided, a note-off is automatically scheduled after that many milliseconds. Auto-inserts the MCP MIDI Emitter JSFX if not present.",
|
|
2296
2452
|
{
|
|
2297
|
-
trackIndex:
|
|
2298
|
-
pitch:
|
|
2299
|
-
velocity:
|
|
2300
|
-
channel:
|
|
2301
|
-
durationMs:
|
|
2453
|
+
trackIndex: z13.coerce.number().min(0).describe("0-based track index"),
|
|
2454
|
+
pitch: z13.coerce.number().min(0).max(127).describe("MIDI note number (0-127, 60=C4/Middle C)"),
|
|
2455
|
+
velocity: z13.coerce.number().min(1).max(127).describe("Note velocity (1-127)"),
|
|
2456
|
+
channel: z13.coerce.number().min(0).max(15).optional().describe("MIDI channel 0-15 (default 0)"),
|
|
2457
|
+
durationMs: z13.coerce.number().min(1).int().optional().describe("Note duration in milliseconds (\u22651) \u2014 if provided, schedules an automatic note-off")
|
|
2302
2458
|
},
|
|
2303
2459
|
async ({ trackIndex: trackIndex5, pitch, velocity, channel, durationMs }) => {
|
|
2304
2460
|
const res = await sendCommand("send_midi_note", { trackIndex: trackIndex5, pitch, velocity, channel: channel ?? 0, durationMs });
|
|
@@ -2311,13 +2467,13 @@ function registerMidiTools(server) {
|
|
|
2311
2467
|
}
|
|
2312
2468
|
|
|
2313
2469
|
// apps/reaper-mcp-server/src/tools/media.ts
|
|
2314
|
-
import { z as
|
|
2470
|
+
import { z as z14 } from "zod/v4";
|
|
2315
2471
|
function registerMediaTools(server) {
|
|
2316
2472
|
server.tool(
|
|
2317
2473
|
"list_media_items",
|
|
2318
2474
|
"List all media items on a track with position, length, name, volume, mute state, and whether it is MIDI or audio",
|
|
2319
2475
|
{
|
|
2320
|
-
trackIndex:
|
|
2476
|
+
trackIndex: z14.coerce.number().min(0).describe("0-based track index")
|
|
2321
2477
|
},
|
|
2322
2478
|
async ({ trackIndex: trackIndex5 }) => {
|
|
2323
2479
|
const res = await sendCommand("list_media_items", { trackIndex: trackIndex5 });
|
|
@@ -2331,8 +2487,8 @@ function registerMediaTools(server) {
|
|
|
2331
2487
|
"get_media_item_properties",
|
|
2332
2488
|
"Get detailed properties of a media item: position, length, volume, fades, play rate, take info, source file",
|
|
2333
2489
|
{
|
|
2334
|
-
trackIndex:
|
|
2335
|
-
itemIndex:
|
|
2490
|
+
trackIndex: z14.coerce.number().min(0).describe("0-based track index"),
|
|
2491
|
+
itemIndex: z14.coerce.number().min(0).describe("0-based item index on the track")
|
|
2336
2492
|
},
|
|
2337
2493
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2 }) => {
|
|
2338
2494
|
const res = await sendCommand("get_media_item_properties", { trackIndex: trackIndex5, itemIndex: itemIndex2 });
|
|
@@ -2346,15 +2502,15 @@ function registerMediaTools(server) {
|
|
|
2346
2502
|
"set_media_item_properties",
|
|
2347
2503
|
"Set media item properties: position (seconds), length (seconds), volume (dB), mute, fade in/out lengths, play rate",
|
|
2348
2504
|
{
|
|
2349
|
-
trackIndex:
|
|
2350
|
-
itemIndex:
|
|
2351
|
-
position:
|
|
2352
|
-
length:
|
|
2353
|
-
volume:
|
|
2354
|
-
mute:
|
|
2355
|
-
fadeInLength:
|
|
2356
|
-
fadeOutLength:
|
|
2357
|
-
playRate:
|
|
2505
|
+
trackIndex: z14.coerce.number().min(0).describe("0-based track index"),
|
|
2506
|
+
itemIndex: z14.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2507
|
+
position: z14.coerce.number().min(0).optional().describe("New position in seconds"),
|
|
2508
|
+
length: z14.coerce.number().min(0).optional().describe("New length in seconds"),
|
|
2509
|
+
volume: z14.coerce.number().optional().describe("New volume in dB (0 = unity gain)"),
|
|
2510
|
+
mute: z14.coerce.number().min(0).max(1).optional().describe("Mute state (0=unmuted, 1=muted)"),
|
|
2511
|
+
fadeInLength: z14.coerce.number().min(0).optional().describe("Fade-in length in seconds"),
|
|
2512
|
+
fadeOutLength: z14.coerce.number().min(0).optional().describe("Fade-out length in seconds"),
|
|
2513
|
+
playRate: z14.coerce.number().min(0.1).max(10).optional().describe("Playback rate (1.0=normal, 0.5=half, 2.0=double)")
|
|
2358
2514
|
},
|
|
2359
2515
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, position, length, volume, mute, fadeInLength, fadeOutLength, playRate }) => {
|
|
2360
2516
|
const res = await sendCommand("set_media_item_properties", {
|
|
@@ -2378,16 +2534,16 @@ function registerMediaTools(server) {
|
|
|
2378
2534
|
"set_media_items_properties",
|
|
2379
2535
|
"Batch set properties on multiple media items in a single call. Much more efficient than calling set_media_item_properties repeatedly. Pass a native array of item objects, each with trackIndex, itemIndex, and any properties to change.",
|
|
2380
2536
|
{
|
|
2381
|
-
items:
|
|
2382
|
-
trackIndex:
|
|
2383
|
-
itemIndex:
|
|
2384
|
-
position:
|
|
2385
|
-
length:
|
|
2386
|
-
volume:
|
|
2387
|
-
mute:
|
|
2388
|
-
fadeInLength:
|
|
2389
|
-
fadeOutLength:
|
|
2390
|
-
playRate:
|
|
2537
|
+
items: z14.array(z14.object({
|
|
2538
|
+
trackIndex: z14.coerce.number().min(0).describe("0-based track index"),
|
|
2539
|
+
itemIndex: z14.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2540
|
+
position: z14.coerce.number().min(0).optional().describe("New position in seconds"),
|
|
2541
|
+
length: z14.coerce.number().min(0).optional().describe("New length in seconds"),
|
|
2542
|
+
volume: z14.coerce.number().optional().describe("New volume in dB (0 = unity gain)"),
|
|
2543
|
+
mute: z14.coerce.number().min(0).max(1).optional().describe("Mute state (0=unmuted, 1=muted)"),
|
|
2544
|
+
fadeInLength: z14.coerce.number().min(0).optional().describe("Fade-in length in seconds"),
|
|
2545
|
+
fadeOutLength: z14.coerce.number().min(0).optional().describe("Fade-out length in seconds"),
|
|
2546
|
+
playRate: z14.coerce.number().min(0.1).max(10).optional().describe("Playback rate (1.0=normal)")
|
|
2391
2547
|
})).describe("Array of item property updates to apply")
|
|
2392
2548
|
},
|
|
2393
2549
|
async ({ items }) => {
|
|
@@ -2402,9 +2558,9 @@ function registerMediaTools(server) {
|
|
|
2402
2558
|
"split_media_item",
|
|
2403
2559
|
"Split a media item at a given position (absolute project time in seconds). Returns info about both resulting items.",
|
|
2404
2560
|
{
|
|
2405
|
-
trackIndex:
|
|
2406
|
-
itemIndex:
|
|
2407
|
-
position:
|
|
2561
|
+
trackIndex: z14.coerce.number().min(0).describe("0-based track index"),
|
|
2562
|
+
itemIndex: z14.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2563
|
+
position: z14.coerce.number().min(0).describe("Split position in seconds (absolute project time)")
|
|
2408
2564
|
},
|
|
2409
2565
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, position }) => {
|
|
2410
2566
|
const res = await sendCommand("split_media_item", { trackIndex: trackIndex5, itemIndex: itemIndex2, position });
|
|
@@ -2418,8 +2574,8 @@ function registerMediaTools(server) {
|
|
|
2418
2574
|
"delete_media_item",
|
|
2419
2575
|
"Delete a media item from a track",
|
|
2420
2576
|
{
|
|
2421
|
-
trackIndex:
|
|
2422
|
-
itemIndex:
|
|
2577
|
+
trackIndex: z14.coerce.number().min(0).describe("0-based track index"),
|
|
2578
|
+
itemIndex: z14.coerce.number().min(0).describe("0-based item index on the track")
|
|
2423
2579
|
},
|
|
2424
2580
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2 }) => {
|
|
2425
2581
|
const res = await sendCommand("delete_media_item", { trackIndex: trackIndex5, itemIndex: itemIndex2 });
|
|
@@ -2433,10 +2589,10 @@ function registerMediaTools(server) {
|
|
|
2433
2589
|
"move_media_item",
|
|
2434
2590
|
"Move a media item to a new position and/or a different track",
|
|
2435
2591
|
{
|
|
2436
|
-
trackIndex:
|
|
2437
|
-
itemIndex:
|
|
2438
|
-
newPosition:
|
|
2439
|
-
newTrackIndex:
|
|
2592
|
+
trackIndex: z14.coerce.number().min(0).describe("0-based track index (current track)"),
|
|
2593
|
+
itemIndex: z14.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2594
|
+
newPosition: z14.coerce.number().min(0).optional().describe("New position in seconds"),
|
|
2595
|
+
newTrackIndex: z14.coerce.number().min(0).optional().describe("Move to this track (0-based index)")
|
|
2440
2596
|
},
|
|
2441
2597
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, newPosition, newTrackIndex }) => {
|
|
2442
2598
|
const res = await sendCommand("move_media_item", { trackIndex: trackIndex5, itemIndex: itemIndex2, newPosition, newTrackIndex });
|
|
@@ -2450,10 +2606,10 @@ function registerMediaTools(server) {
|
|
|
2450
2606
|
"trim_media_item",
|
|
2451
2607
|
"Trim a media item edges. Positive trimStart trims from the beginning (makes item shorter/later). Positive trimEnd trims from the end (makes item shorter). Negative values extend.",
|
|
2452
2608
|
{
|
|
2453
|
-
trackIndex:
|
|
2454
|
-
itemIndex:
|
|
2455
|
-
trimStart:
|
|
2456
|
-
trimEnd:
|
|
2609
|
+
trackIndex: z14.coerce.number().min(0).describe("0-based track index"),
|
|
2610
|
+
itemIndex: z14.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2611
|
+
trimStart: z14.coerce.number().optional().describe("Seconds to trim from start (positive=trim in, negative=extend)"),
|
|
2612
|
+
trimEnd: z14.coerce.number().optional().describe("Seconds to trim from end (positive=trim in, negative=extend)")
|
|
2457
2613
|
},
|
|
2458
2614
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, trimStart, trimEnd }) => {
|
|
2459
2615
|
const res = await sendCommand("trim_media_item", { trackIndex: trackIndex5, itemIndex: itemIndex2, trimStart, trimEnd });
|
|
@@ -2467,10 +2623,10 @@ function registerMediaTools(server) {
|
|
|
2467
2623
|
"add_stretch_marker",
|
|
2468
2624
|
"Add a stretch marker to a media item for time-stretching audio. Position is within the item (seconds from item start). Source position is the corresponding position in the original audio.",
|
|
2469
2625
|
{
|
|
2470
|
-
trackIndex:
|
|
2471
|
-
itemIndex:
|
|
2472
|
-
position:
|
|
2473
|
-
sourcePosition:
|
|
2626
|
+
trackIndex: z14.coerce.number().min(0).describe("0-based track index"),
|
|
2627
|
+
itemIndex: z14.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2628
|
+
position: z14.coerce.number().min(0).describe("Position within the item in seconds (from item start)"),
|
|
2629
|
+
sourcePosition: z14.coerce.number().min(0).optional().describe("Position in source audio in seconds (defaults to same as position)")
|
|
2474
2630
|
},
|
|
2475
2631
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, position, sourcePosition }) => {
|
|
2476
2632
|
const res = await sendCommand("add_stretch_marker", { trackIndex: trackIndex5, itemIndex: itemIndex2, position, sourcePosition });
|
|
@@ -2484,8 +2640,8 @@ function registerMediaTools(server) {
|
|
|
2484
2640
|
"get_stretch_markers",
|
|
2485
2641
|
"List all stretch markers in a media item with their positions and source positions",
|
|
2486
2642
|
{
|
|
2487
|
-
trackIndex:
|
|
2488
|
-
itemIndex:
|
|
2643
|
+
trackIndex: z14.coerce.number().min(0).describe("0-based track index"),
|
|
2644
|
+
itemIndex: z14.coerce.number().min(0).describe("0-based item index on the track")
|
|
2489
2645
|
},
|
|
2490
2646
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2 }) => {
|
|
2491
2647
|
const res = await sendCommand("get_stretch_markers", { trackIndex: trackIndex5, itemIndex: itemIndex2 });
|
|
@@ -2499,9 +2655,9 @@ function registerMediaTools(server) {
|
|
|
2499
2655
|
"delete_stretch_marker",
|
|
2500
2656
|
"Delete a stretch marker by index from a media item",
|
|
2501
2657
|
{
|
|
2502
|
-
trackIndex:
|
|
2503
|
-
itemIndex:
|
|
2504
|
-
markerIndex:
|
|
2658
|
+
trackIndex: z14.coerce.number().min(0).describe("0-based track index"),
|
|
2659
|
+
itemIndex: z14.coerce.number().min(0).describe("0-based item index on the track"),
|
|
2660
|
+
markerIndex: z14.coerce.number().min(0).describe("0-based stretch marker index")
|
|
2505
2661
|
},
|
|
2506
2662
|
async ({ trackIndex: trackIndex5, itemIndex: itemIndex2, markerIndex }) => {
|
|
2507
2663
|
const res = await sendCommand("delete_stretch_marker", { trackIndex: trackIndex5, itemIndex: itemIndex2, markerIndex });
|
|
@@ -2514,7 +2670,7 @@ function registerMediaTools(server) {
|
|
|
2514
2670
|
}
|
|
2515
2671
|
|
|
2516
2672
|
// apps/reaper-mcp-server/src/tools/selection.ts
|
|
2517
|
-
import { z as
|
|
2673
|
+
import { z as z15 } from "zod/v4";
|
|
2518
2674
|
function registerSelectionTools(server) {
|
|
2519
2675
|
server.tool(
|
|
2520
2676
|
"get_selected_tracks",
|
|
@@ -2544,8 +2700,8 @@ function registerSelectionTools(server) {
|
|
|
2544
2700
|
"set_time_selection",
|
|
2545
2701
|
"Set the time selection (loop selection) to a start and end position in seconds",
|
|
2546
2702
|
{
|
|
2547
|
-
start:
|
|
2548
|
-
end:
|
|
2703
|
+
start: z15.coerce.number().min(0).describe("Start position in seconds"),
|
|
2704
|
+
end: z15.coerce.number().min(0).describe("End position in seconds")
|
|
2549
2705
|
},
|
|
2550
2706
|
async ({ start, end }) => {
|
|
2551
2707
|
const res = await sendCommand("set_time_selection", { start, end });
|
|
@@ -2555,12 +2711,12 @@ function registerSelectionTools(server) {
|
|
|
2555
2711
|
return { content: [{ type: "text", text: `Time selection set: ${start}s - ${end}s` }] };
|
|
2556
2712
|
}
|
|
2557
2713
|
);
|
|
2558
|
-
const selectionMode =
|
|
2714
|
+
const selectionMode = z15.enum(["replace", "add"]).optional().describe("replace (default): select exactly these; add: keep the current selection");
|
|
2559
2715
|
server.tool(
|
|
2560
2716
|
"set_selected_tracks",
|
|
2561
2717
|
'Select tracks by 0-based index, exact name, or "{GUID}" \u2014 usually before run_action, since most actions act on the selection. Every track is resolved first: an unknown or ambiguous one changes nothing. Returns the selection afterwards.',
|
|
2562
2718
|
{
|
|
2563
|
-
tracks:
|
|
2719
|
+
tracks: z15.array(z15.union([z15.number().int().min(-1), z15.string().min(1)])).min(1).max(1e3).describe('Tracks to select: index (-1 or "master" = master track), exact name, or "{GUID}". A digit string means a track name first, then the index.'),
|
|
2564
2720
|
mode: selectionMode
|
|
2565
2721
|
},
|
|
2566
2722
|
async ({ tracks: tracks2, mode }) => {
|
|
@@ -2575,9 +2731,9 @@ function registerSelectionTools(server) {
|
|
|
2575
2731
|
"set_selected_items",
|
|
2576
2732
|
"Select media items by track and item index (as list_media_items reports them) \u2014 usually before run_action. Every item is resolved first: a missing one changes nothing. Returns the selection afterwards.",
|
|
2577
2733
|
{
|
|
2578
|
-
items:
|
|
2579
|
-
trackIndex:
|
|
2580
|
-
itemIndex:
|
|
2734
|
+
items: z15.array(z15.object({
|
|
2735
|
+
trackIndex: z15.coerce.number().int().min(0).describe("0-based track index"),
|
|
2736
|
+
itemIndex: z15.coerce.number().int().min(0).describe("0-based item index on that track")
|
|
2581
2737
|
})).min(1).max(1e3),
|
|
2582
2738
|
mode: selectionMode
|
|
2583
2739
|
},
|
|
@@ -2592,8 +2748,8 @@ function registerSelectionTools(server) {
|
|
|
2592
2748
|
}
|
|
2593
2749
|
|
|
2594
2750
|
// apps/reaper-mcp-server/src/tools/recording.ts
|
|
2595
|
-
import { z as
|
|
2596
|
-
import { trace as
|
|
2751
|
+
import { z as z16 } from "zod/v4";
|
|
2752
|
+
import { trace as trace3 } from "@opentelemetry/api";
|
|
2597
2753
|
var MAX_COMP_RANGES = 200;
|
|
2598
2754
|
var TRACK_MODES = [
|
|
2599
2755
|
"input",
|
|
@@ -2614,20 +2770,20 @@ var TRACK_MODES = [
|
|
|
2614
2770
|
"input_midi",
|
|
2615
2771
|
"midi_latch_replace"
|
|
2616
2772
|
];
|
|
2617
|
-
var recordInput =
|
|
2618
|
-
|
|
2619
|
-
kind:
|
|
2620
|
-
channel:
|
|
2621
|
-
stereo:
|
|
2773
|
+
var recordInput = z16.discriminatedUnion("kind", [
|
|
2774
|
+
z16.object({
|
|
2775
|
+
kind: z16.literal("audio"),
|
|
2776
|
+
channel: z16.coerce.number().int().min(1).describe("First input channel, 1-based"),
|
|
2777
|
+
stereo: z16.boolean().optional().describe("Stereo pair: this channel and the next")
|
|
2622
2778
|
}),
|
|
2623
|
-
|
|
2624
|
-
kind:
|
|
2625
|
-
device:
|
|
2626
|
-
channel:
|
|
2779
|
+
z16.object({
|
|
2780
|
+
kind: z16.literal("midi"),
|
|
2781
|
+
device: z16.union([z16.coerce.number().int().min(0).max(61), z16.enum(["all", "vkb"])]).optional().describe('MIDI input index from get_record_setup, "all" (default) or "vkb" (virtual keyboard)'),
|
|
2782
|
+
channel: z16.coerce.number().int().min(0).max(16).optional().describe("0 = all channels (default), 1-16")
|
|
2627
2783
|
}),
|
|
2628
|
-
|
|
2784
|
+
z16.object({ kind: z16.literal("none") })
|
|
2629
2785
|
]).describe('Record input: { kind: "audio", channel, stereo }, { kind: "midi", device, channel } or { kind: "none" }');
|
|
2630
|
-
var laneNumber =
|
|
2786
|
+
var laneNumber = z16.preprocess((v) => typeof v === "string" && v.trim() !== "" ? Number(v) : v, z16.number().int().min(0));
|
|
2631
2787
|
function reply2(res) {
|
|
2632
2788
|
if (!res.success) return { content: [{ type: "text", text: `Error: ${res.error}` }], isError: true };
|
|
2633
2789
|
return { content: [{ type: "text", text: JSON.stringify(res.data, null, 2) }] };
|
|
@@ -2636,12 +2792,12 @@ function registerRecordingTools(server) {
|
|
|
2636
2792
|
server.tool(
|
|
2637
2793
|
"get_record_setup",
|
|
2638
2794
|
'Recording setup: the global record mode (normal, time_selection auto-punch, selected_items auto-punch) with the punch range, the record path, every armed track (or every track with all) with its input ("In 3/4", "MIDI: all inputs"), monitoring, record mode and input FX count, and the audio and MIDI inputs that exist. Read this before arming or recording.',
|
|
2639
|
-
{ all:
|
|
2795
|
+
{ all: z16.boolean().optional().describe("List every track, not only the armed ones (max 64)") },
|
|
2640
2796
|
async ({ all }) => {
|
|
2641
2797
|
const res = await sendCommand("get_record_setup", { all });
|
|
2642
2798
|
if (res.success) {
|
|
2643
2799
|
const d = res.data;
|
|
2644
|
-
const span =
|
|
2800
|
+
const span = trace3.getActiveSpan();
|
|
2645
2801
|
span?.setAttribute("reaper.record.mode", String(d["mode"]));
|
|
2646
2802
|
span?.setAttribute("reaper.record.armed_count", Number(d["armedCount"] ?? d["tracks"]?.length ?? 0));
|
|
2647
2803
|
}
|
|
@@ -2652,20 +2808,20 @@ function registerRecordingTools(server) {
|
|
|
2652
2808
|
"set_track_record",
|
|
2653
2809
|
"Arm tracks and set their record input, monitoring (off, on, auto = tape style), record mode and monitor-items, for up to 64 tracks in one undo point. Every track and input is checked first (an input the audio device does not have, an unknown MIDI device): a refused call changes nothing. Returns each track's record state and warnings (a MIDI mode on an audio input, an armed track with no input). Modes: input (default), midi_overdub/midi_replace for MIDI, stereo_out/mono_out to print the track output.",
|
|
2654
2810
|
{
|
|
2655
|
-
tracks:
|
|
2811
|
+
tracks: z16.array(z16.object({
|
|
2656
2812
|
track: trackRef,
|
|
2657
|
-
arm:
|
|
2813
|
+
arm: z16.boolean().optional(),
|
|
2658
2814
|
input: recordInput.optional(),
|
|
2659
|
-
monitor:
|
|
2660
|
-
mode:
|
|
2661
|
-
monitorItems:
|
|
2815
|
+
monitor: z16.enum(["off", "on", "auto"]).optional().describe("Input monitoring; auto = only while armed and stopped or recording (tape style)"),
|
|
2816
|
+
mode: z16.enum(TRACK_MODES).optional().describe("Record mode (I_RECMODE)"),
|
|
2817
|
+
monitorItems: z16.boolean().optional().describe('Play existing items while monitoring (track "monitor track media when recording")')
|
|
2662
2818
|
})).min(1).max(64)
|
|
2663
2819
|
},
|
|
2664
2820
|
async ({ tracks: tracks2 }) => {
|
|
2665
2821
|
const res = await sendCommand("set_track_record", { tracks: JSON.stringify(tracks2) });
|
|
2666
2822
|
if (res.success) {
|
|
2667
2823
|
const rows = res.data["tracks"] ?? [];
|
|
2668
|
-
|
|
2824
|
+
trace3.getActiveSpan()?.setAttribute("reaper.record.armed_count", rows.filter((t) => t["armed"]).length);
|
|
2669
2825
|
}
|
|
2670
2826
|
return reply2(res);
|
|
2671
2827
|
}
|
|
@@ -2674,14 +2830,14 @@ function registerRecordingTools(server) {
|
|
|
2674
2830
|
"set_record_mode",
|
|
2675
2831
|
"Set the global record mode: normal, time_selection (auto-punch: records only inside the time selection; give punchStart/punchEnd to set it) or selected_items (auto-punch on the selected items). Optionally the record path (a folder relative to the project, or absolute). All input is checked first; one undo point.",
|
|
2676
2832
|
{
|
|
2677
|
-
mode:
|
|
2678
|
-
punchStart:
|
|
2679
|
-
punchEnd:
|
|
2680
|
-
recordPath:
|
|
2833
|
+
mode: z16.enum(["normal", "time_selection", "selected_items"]).optional(),
|
|
2834
|
+
punchStart: z16.coerce.number().min(0).optional().describe("Punch-in, seconds (needs mode time_selection)"),
|
|
2835
|
+
punchEnd: z16.coerce.number().min(0).optional().describe("Punch-out, seconds"),
|
|
2836
|
+
recordPath: z16.string().min(1).optional().describe('Where new recordings go, e.g. "Audio"')
|
|
2681
2837
|
},
|
|
2682
2838
|
async (params) => {
|
|
2683
2839
|
const res = await sendCommand("set_record_mode", params);
|
|
2684
|
-
if (res.success)
|
|
2840
|
+
if (res.success) trace3.getActiveSpan()?.setAttribute("reaper.record.mode", String(res.data["mode"]));
|
|
2685
2841
|
return reply2(res);
|
|
2686
2842
|
}
|
|
2687
2843
|
);
|
|
@@ -2691,7 +2847,7 @@ function registerRecordingTools(server) {
|
|
|
2691
2847
|
{ track: trackRef },
|
|
2692
2848
|
async ({ track }) => {
|
|
2693
2849
|
const res = await sendCommand("get_track_lanes", { track });
|
|
2694
|
-
if (res.success)
|
|
2850
|
+
if (res.success) trace3.getActiveSpan()?.setAttribute("reaper.lanes.count", Number(res.data["laneCount"] ?? 0));
|
|
2695
2851
|
return reply2(res);
|
|
2696
2852
|
}
|
|
2697
2853
|
);
|
|
@@ -2700,10 +2856,10 @@ function registerRecordingTools(server) {
|
|
|
2700
2856
|
"Fixed lanes on a track: turn them on/off, set the lane count, name lanes and choose what plays \u2014 one lane alone (play: 2) or several layered (play: [0, 2]). Turning fixed lanes off puts every lane's items on one lane, all playing (the answer warns; undo_project brings the lanes back). A lane count below a lane that has items is refused; every refusal changes nothing. One undo point. REAPER can drop the names of lanes with no items, so name lanes once the takes are on them.",
|
|
2701
2857
|
{
|
|
2702
2858
|
track: trackRef,
|
|
2703
|
-
fixedLanes:
|
|
2704
|
-
laneCount:
|
|
2705
|
-
names:
|
|
2706
|
-
play:
|
|
2859
|
+
fixedLanes: z16.boolean().optional(),
|
|
2860
|
+
laneCount: z16.coerce.number().int().min(1).max(64).optional(),
|
|
2861
|
+
names: z16.array(z16.object({ lane: z16.coerce.number().int().min(0), name: z16.string() })).max(64).optional().describe("Lane names, lanes 0-based"),
|
|
2862
|
+
play: z16.union([z16.array(z16.coerce.number().int().min(0)).min(1).max(64), laneNumber]).optional().describe("A lane number to play alone, or an array of lanes to play together (layered); every other lane goes silent")
|
|
2707
2863
|
},
|
|
2708
2864
|
async ({ track, fixedLanes, laneCount, names, play }) => {
|
|
2709
2865
|
const res = await sendCommand("set_track_lanes", {
|
|
@@ -2713,7 +2869,7 @@ function registerRecordingTools(server) {
|
|
|
2713
2869
|
names: names === void 0 ? void 0 : JSON.stringify(names),
|
|
2714
2870
|
play: play === void 0 ? void 0 : JSON.stringify(play)
|
|
2715
2871
|
});
|
|
2716
|
-
if (res.success)
|
|
2872
|
+
if (res.success) trace3.getActiveSpan()?.setAttribute("reaper.lanes.count", Number(res.data["laneCount"] ?? 0));
|
|
2717
2873
|
return reply2(res);
|
|
2718
2874
|
}
|
|
2719
2875
|
);
|
|
@@ -2722,13 +2878,13 @@ function registerRecordingTools(server) {
|
|
|
2722
2878
|
'Comp takes from fixed lanes: give time ranges and the lane to take each from ({ start, end, lane }, seconds, no overlaps); copies of those parts go onto a new lane ("Comp" by default) with crossfades where one range meets the next, and that lane plays alone. The source lanes stay untouched (silent), so another comp or set_track_lanes play can switch back. A range a lane has no audio for is refused with the gap; every refusal changes nothing. One undo point.',
|
|
2723
2879
|
{
|
|
2724
2880
|
track: trackRef,
|
|
2725
|
-
ranges:
|
|
2726
|
-
start:
|
|
2727
|
-
end:
|
|
2728
|
-
lane:
|
|
2881
|
+
ranges: z16.array(z16.object({
|
|
2882
|
+
start: z16.coerce.number().min(0),
|
|
2883
|
+
end: z16.coerce.number().min(0),
|
|
2884
|
+
lane: z16.coerce.number().int().min(0).describe("Source lane, 0-based (get_track_lanes)")
|
|
2729
2885
|
})).min(1).max(MAX_COMP_RANGES),
|
|
2730
|
-
crossfadeMs:
|
|
2731
|
-
name:
|
|
2886
|
+
crossfadeMs: z16.coerce.number().min(0).max(500).optional().describe("Crossfade at each switch, ms (default 10)"),
|
|
2887
|
+
name: z16.string().min(1).optional().describe('Name of the new comp lane (default "Comp")')
|
|
2732
2888
|
},
|
|
2733
2889
|
async ({ track, ranges, crossfadeMs, name }) => {
|
|
2734
2890
|
const res = await sendCommand("comp_lanes", { track, ranges: JSON.stringify(ranges), crossfadeMs, name });
|
|
@@ -2740,7 +2896,7 @@ function registerRecordingTools(server) {
|
|
|
2740
2896
|
const segments = d["segments"] ?? [];
|
|
2741
2897
|
const sources = new Set(segments.map((s) => s["lane"])).size;
|
|
2742
2898
|
getCompSegmentsHistogram().record(segments.length);
|
|
2743
|
-
const span =
|
|
2899
|
+
const span = trace3.getActiveSpan();
|
|
2744
2900
|
span?.setAttribute("reaper.comp.segment_count", segments.length);
|
|
2745
2901
|
span?.setAttribute("reaper.comp.source_lane_count", sources);
|
|
2746
2902
|
span?.setAttribute("reaper.lanes.count", Number(d["laneCount"] ?? 0));
|
|
@@ -2751,7 +2907,7 @@ function registerRecordingTools(server) {
|
|
|
2751
2907
|
}
|
|
2752
2908
|
|
|
2753
2909
|
// apps/reaper-mcp-server/src/tools/markers.ts
|
|
2754
|
-
import { z as
|
|
2910
|
+
import { z as z17 } from "zod/v4";
|
|
2755
2911
|
function registerMarkerTools(server) {
|
|
2756
2912
|
server.tool(
|
|
2757
2913
|
"list_markers",
|
|
@@ -2781,9 +2937,9 @@ function registerMarkerTools(server) {
|
|
|
2781
2937
|
"add_marker",
|
|
2782
2938
|
"Add a project marker at a position in seconds, with optional name and color",
|
|
2783
2939
|
{
|
|
2784
|
-
position:
|
|
2785
|
-
name:
|
|
2786
|
-
color:
|
|
2940
|
+
position: z17.coerce.number().min(0).describe("Position in seconds"),
|
|
2941
|
+
name: z17.string().optional().describe("Marker name"),
|
|
2942
|
+
color: z17.coerce.number().optional().describe("REAPER native color int (0 = default)")
|
|
2787
2943
|
},
|
|
2788
2944
|
async ({ position, name, color }) => {
|
|
2789
2945
|
const res = await sendCommand("add_marker", { position, name, color });
|
|
@@ -2797,10 +2953,10 @@ function registerMarkerTools(server) {
|
|
|
2797
2953
|
"add_region",
|
|
2798
2954
|
"Add a project region with start/end in seconds, optional name and color",
|
|
2799
2955
|
{
|
|
2800
|
-
start:
|
|
2801
|
-
end:
|
|
2802
|
-
name:
|
|
2803
|
-
color:
|
|
2956
|
+
start: z17.coerce.number().min(0).describe("Region start in seconds"),
|
|
2957
|
+
end: z17.coerce.number().min(0).describe("Region end in seconds"),
|
|
2958
|
+
name: z17.string().optional().describe("Region name"),
|
|
2959
|
+
color: z17.coerce.number().optional().describe("REAPER native color int (0 = default)")
|
|
2804
2960
|
},
|
|
2805
2961
|
async ({ start, end, name, color }) => {
|
|
2806
2962
|
const res = await sendCommand("add_region", { start, end, name, color });
|
|
@@ -2814,7 +2970,7 @@ function registerMarkerTools(server) {
|
|
|
2814
2970
|
"delete_marker",
|
|
2815
2971
|
"Delete a project marker by its marker index number",
|
|
2816
2972
|
{
|
|
2817
|
-
markerIndex:
|
|
2973
|
+
markerIndex: z17.coerce.number().int().min(0).describe("Marker index number")
|
|
2818
2974
|
},
|
|
2819
2975
|
async ({ markerIndex }) => {
|
|
2820
2976
|
const res = await sendCommand("delete_marker", { markerIndex });
|
|
@@ -2828,7 +2984,7 @@ function registerMarkerTools(server) {
|
|
|
2828
2984
|
"delete_region",
|
|
2829
2985
|
"Delete a project region by its region index number",
|
|
2830
2986
|
{
|
|
2831
|
-
regionIndex:
|
|
2987
|
+
regionIndex: z17.coerce.number().int().min(0).describe("Region index number")
|
|
2832
2988
|
},
|
|
2833
2989
|
async ({ regionIndex }) => {
|
|
2834
2990
|
const res = await sendCommand("delete_region", { regionIndex });
|
|
@@ -2845,10 +3001,10 @@ function registerMarkerEditTools(server) {
|
|
|
2845
3001
|
"edit_marker",
|
|
2846
3002
|
`Rename, move or recolor an existing marker by its marker index number (from list_markers). Unspecified fields keep their values; name "" clears the name. Color is a native color int, stored with REAPER's 0x1000000 "custom color" flag. Unknown markers change nothing.`,
|
|
2847
3003
|
{
|
|
2848
|
-
markerIndex:
|
|
2849
|
-
name:
|
|
2850
|
-
position:
|
|
2851
|
-
color:
|
|
3004
|
+
markerIndex: z17.coerce.number().int().min(0).describe("Marker index number (list_markers index)"),
|
|
3005
|
+
name: z17.string().optional().describe('New name ("" clears it)'),
|
|
3006
|
+
position: z17.coerce.number().min(0).optional().describe("New position in seconds"),
|
|
3007
|
+
color: z17.coerce.number().int().min(0).optional().describe("Native color int (e.g. ColorToNative(r,g,b)); 0 keeps the current color")
|
|
2852
3008
|
},
|
|
2853
3009
|
async (params) => reply(await sendCommand("edit_marker", params))
|
|
2854
3010
|
);
|
|
@@ -2856,18 +3012,18 @@ function registerMarkerEditTools(server) {
|
|
|
2856
3012
|
"edit_region",
|
|
2857
3013
|
"Rename, move/resize or recolor an existing region by its region index number (from list_regions). Unspecified fields keep their values; end must stay after start. Unknown regions change nothing.",
|
|
2858
3014
|
{
|
|
2859
|
-
regionIndex:
|
|
2860
|
-
name:
|
|
2861
|
-
start:
|
|
2862
|
-
end:
|
|
2863
|
-
color:
|
|
3015
|
+
regionIndex: z17.coerce.number().int().min(0).describe("Region index number (list_regions index)"),
|
|
3016
|
+
name: z17.string().optional().describe('New name ("" clears it)'),
|
|
3017
|
+
start: z17.coerce.number().min(0).optional().describe("New start in seconds"),
|
|
3018
|
+
end: z17.coerce.number().min(0).optional().describe("New end in seconds"),
|
|
3019
|
+
color: z17.coerce.number().int().min(0).optional().describe("Native color int; 0 keeps the current color")
|
|
2864
3020
|
},
|
|
2865
3021
|
async (params) => reply(await sendCommand("edit_region", params))
|
|
2866
3022
|
);
|
|
2867
3023
|
}
|
|
2868
3024
|
|
|
2869
3025
|
// apps/reaper-mcp-server/src/tools/tempo.ts
|
|
2870
|
-
import { z as
|
|
3026
|
+
import { z as z18 } from "zod/v4";
|
|
2871
3027
|
function registerTempoTools(server) {
|
|
2872
3028
|
server.tool(
|
|
2873
3029
|
"get_tempo_map",
|
|
@@ -2883,19 +3039,19 @@ function registerTempoTools(server) {
|
|
|
2883
3039
|
);
|
|
2884
3040
|
registerTempoEditTools(server);
|
|
2885
3041
|
}
|
|
2886
|
-
var bpm =
|
|
2887
|
-
var timeSigNumerator =
|
|
2888
|
-
var timeSigDenominator =
|
|
3042
|
+
var bpm = z18.coerce.number().gt(0).max(960).describe("Tempo in BPM (> 0, max 960)");
|
|
3043
|
+
var timeSigNumerator = z18.coerce.number().int().min(1).max(255).optional().describe("Time signature numerator (give with denominator)");
|
|
3044
|
+
var timeSigDenominator = z18.coerce.number().int().optional().describe("Time signature denominator: 1, 2, 4, 8, 16, 32 or 64 (give with numerator)");
|
|
2889
3045
|
function registerTempoEditTools(server) {
|
|
2890
3046
|
server.tool(
|
|
2891
3047
|
"add_tempo_marker",
|
|
2892
3048
|
"Add a tempo / time signature marker at a position in seconds. Returns the updated tempo map (same shape as get_tempo_map, plus tempoMarkerCount). One undo point.",
|
|
2893
3049
|
{
|
|
2894
|
-
position:
|
|
3050
|
+
position: z18.coerce.number().min(0).describe("Position in seconds"),
|
|
2895
3051
|
bpm,
|
|
2896
3052
|
timeSigNumerator,
|
|
2897
3053
|
timeSigDenominator,
|
|
2898
|
-
linear:
|
|
3054
|
+
linear: z18.boolean().optional().describe("Gradual (linear) tempo change to the next marker")
|
|
2899
3055
|
},
|
|
2900
3056
|
async (params) => reply(await sendCommand("add_tempo_marker", params))
|
|
2901
3057
|
);
|
|
@@ -2903,19 +3059,19 @@ function registerTempoEditTools(server) {
|
|
|
2903
3059
|
"edit_tempo_marker",
|
|
2904
3060
|
"Edit a tempo marker by its get_tempo_map index (only tempoMarkerCount > 0 maps have real markers). Unspecified fields keep their values. Returns the updated tempo map.",
|
|
2905
3061
|
{
|
|
2906
|
-
index:
|
|
2907
|
-
position:
|
|
3062
|
+
index: z18.coerce.number().int().min(0).describe("Tempo marker index from get_tempo_map"),
|
|
3063
|
+
position: z18.coerce.number().min(0).optional().describe("New position in seconds"),
|
|
2908
3064
|
bpm: bpm.optional(),
|
|
2909
3065
|
timeSigNumerator,
|
|
2910
3066
|
timeSigDenominator,
|
|
2911
|
-
linear:
|
|
3067
|
+
linear: z18.boolean().optional().describe("Gradual (linear) tempo change to the next marker")
|
|
2912
3068
|
},
|
|
2913
3069
|
async (params) => reply(await sendCommand("edit_tempo_marker", params))
|
|
2914
3070
|
);
|
|
2915
3071
|
server.tool(
|
|
2916
3072
|
"delete_tempo_marker",
|
|
2917
3073
|
"Delete a tempo marker by its get_tempo_map index. Returns the updated tempo map.",
|
|
2918
|
-
{ index:
|
|
3074
|
+
{ index: z18.coerce.number().int().min(0).describe("Tempo marker index from get_tempo_map") },
|
|
2919
3075
|
async ({ index }) => reply(await sendCommand("delete_tempo_marker", { index }))
|
|
2920
3076
|
);
|
|
2921
3077
|
server.tool(
|
|
@@ -2927,22 +3083,22 @@ function registerTempoEditTools(server) {
|
|
|
2927
3083
|
}
|
|
2928
3084
|
|
|
2929
3085
|
// apps/reaper-mcp-server/src/tools/envelopes.ts
|
|
2930
|
-
import { z as
|
|
2931
|
-
var trackIndex =
|
|
2932
|
-
var envelopeIndex =
|
|
2933
|
-
var automationItemIndex =
|
|
3086
|
+
import { z as z19 } from "zod/v4";
|
|
3087
|
+
var trackIndex = z19.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master track)");
|
|
3088
|
+
var envelopeIndex = z19.coerce.number().int().min(0).describe("Zero-based envelope index on the track (from get_track_envelopes)");
|
|
3089
|
+
var automationItemIndex = z19.coerce.number().int().min(0).optional().describe(
|
|
2934
3090
|
"Work on the points inside this automation item (from list_automation_items) instead of the underlying envelope. Pooled instances share their points, so this edits every instance of the pool."
|
|
2935
3091
|
);
|
|
2936
|
-
var shape =
|
|
2937
|
-
var tension =
|
|
3092
|
+
var shape = z19.coerce.number().int().min(0).max(5).optional().describe("Shape: 0=linear, 1=square, 2=slow start/end, 3=fast start, 4=fast end, 5=bezier");
|
|
3093
|
+
var tension = z19.coerce.number().min(-1).max(1).optional().describe("Tension for bezier shape (-1.0 to 1.0)");
|
|
2938
3094
|
var VALUE_HELP = "Give `db` on volume envelopes (Volume, Trim Volume, Send Volume): it is converted with the envelope's own scaling (fader-scaled volume envelopes store 716.2 for 0 dB, not 1.0). `value` is the raw envelope value (pan -1..1, mute 0/1, FX parameter 0..1).";
|
|
2939
3095
|
var automationItemFields = {
|
|
2940
|
-
startOffset:
|
|
2941
|
-
playRate:
|
|
2942
|
-
baseline:
|
|
2943
|
-
amplitude:
|
|
2944
|
-
loop:
|
|
2945
|
-
name:
|
|
3096
|
+
startOffset: z19.coerce.number().optional().describe("Seconds into the pool's points where this instance starts"),
|
|
3097
|
+
playRate: z19.coerce.number().positive().optional().describe("Play rate (1 = normal)"),
|
|
3098
|
+
baseline: z19.coerce.number().min(0).max(1).optional().describe("Baseline 0..1 (0.5 = unchanged)"),
|
|
3099
|
+
amplitude: z19.coerce.number().min(-1).max(1).optional().describe("Amplitude -1..1 (1 = unchanged)"),
|
|
3100
|
+
loop: z19.boolean().optional().describe("Loop the pool's points when the item is longer than them"),
|
|
3101
|
+
name: z19.string().optional().describe('Pool name, shared by every instance (e.g. "Vox Chorus")')
|
|
2946
3102
|
};
|
|
2947
3103
|
async function run2(command2, params) {
|
|
2948
3104
|
const res = await sendCommand(command2, params);
|
|
@@ -2965,8 +3121,8 @@ function registerEnvelopeTools(server) {
|
|
|
2965
3121
|
trackIndex,
|
|
2966
3122
|
envelopeIndex,
|
|
2967
3123
|
automationItemIndex,
|
|
2968
|
-
offset:
|
|
2969
|
-
limit:
|
|
3124
|
+
offset: z19.coerce.number().int().min(0).optional().describe("Skip first N points (default 0)"),
|
|
3125
|
+
limit: z19.coerce.number().int().min(1).optional().describe("Max points to return (default all)")
|
|
2970
3126
|
},
|
|
2971
3127
|
async (params) => run2("get_envelope_points", params)
|
|
2972
3128
|
);
|
|
@@ -2977,9 +3133,9 @@ function registerEnvelopeTools(server) {
|
|
|
2977
3133
|
trackIndex,
|
|
2978
3134
|
envelopeIndex,
|
|
2979
3135
|
automationItemIndex,
|
|
2980
|
-
time:
|
|
2981
|
-
value:
|
|
2982
|
-
db:
|
|
3136
|
+
time: z19.coerce.number().describe("Time position in seconds (project time)"),
|
|
3137
|
+
value: z19.coerce.number().optional().describe("Raw envelope value"),
|
|
3138
|
+
db: z19.coerce.number().optional().describe("Level in dB (volume envelopes only), instead of value"),
|
|
2983
3139
|
shape,
|
|
2984
3140
|
tension
|
|
2985
3141
|
},
|
|
@@ -2992,7 +3148,7 @@ function registerEnvelopeTools(server) {
|
|
|
2992
3148
|
trackIndex,
|
|
2993
3149
|
envelopeIndex,
|
|
2994
3150
|
automationItemIndex,
|
|
2995
|
-
points:
|
|
3151
|
+
points: z19.string().describe("JSON array of point objects: [{time, value | db, shape?, tension?}, ...]")
|
|
2996
3152
|
},
|
|
2997
3153
|
async (params) => run2("insert_envelope_points", params)
|
|
2998
3154
|
);
|
|
@@ -3003,7 +3159,7 @@ function registerEnvelopeTools(server) {
|
|
|
3003
3159
|
trackIndex,
|
|
3004
3160
|
envelopeIndex,
|
|
3005
3161
|
automationItemIndex,
|
|
3006
|
-
points:
|
|
3162
|
+
points: z19.string().describe("JSON array: [{index, time?, value? | db?, shape?, tension?}, ...]")
|
|
3007
3163
|
},
|
|
3008
3164
|
async (params) => run2("edit_envelope_points", params)
|
|
3009
3165
|
);
|
|
@@ -3014,7 +3170,7 @@ function registerEnvelopeTools(server) {
|
|
|
3014
3170
|
trackIndex,
|
|
3015
3171
|
envelopeIndex,
|
|
3016
3172
|
automationItemIndex,
|
|
3017
|
-
pointIndex:
|
|
3173
|
+
pointIndex: z19.coerce.number().int().min(0).describe("Zero-based point index")
|
|
3018
3174
|
},
|
|
3019
3175
|
async (params) => run2("delete_envelope_point", params)
|
|
3020
3176
|
);
|
|
@@ -3023,10 +3179,10 @@ function registerEnvelopeTools(server) {
|
|
|
3023
3179
|
"Create/show an automation envelope on a track. Use envelopeName for built-in envelopes (Volume, Pan, Mute, Width, Trim Volume), sendIndex + envelopeName (Volume, Pan, Mute) for a send's envelope (it appears on the track as \"Send Volume\" etc. and starts at the send's current value), or fxIndex+paramIndex for FX parameter envelopes. The envelope is made visible and active; an existing one is only shown (`created: false`). The track selection is left as it was.",
|
|
3024
3180
|
{
|
|
3025
3181
|
trackIndex,
|
|
3026
|
-
envelopeName:
|
|
3027
|
-
sendIndex:
|
|
3028
|
-
fxIndex:
|
|
3029
|
-
paramIndex:
|
|
3182
|
+
envelopeName: z19.string().optional().describe('Built-in envelope name: "Volume", "Pan", "Mute", "Width", "Trim Volume" (with sendIndex: "Volume", "Pan" or "Mute")'),
|
|
3183
|
+
sendIndex: z19.coerce.number().int().min(0).optional().describe("A send's envelope instead: 0-based send index (from get_track_routing); it starts at the send's current level"),
|
|
3184
|
+
fxIndex: z19.coerce.number().int().min(0).optional().describe("FX chain index (for FX parameter envelopes)"),
|
|
3185
|
+
paramIndex: z19.coerce.number().int().min(0).optional().describe("FX parameter index (required if fxIndex provided)")
|
|
3030
3186
|
},
|
|
3031
3187
|
async (params) => run2("create_track_envelope", params)
|
|
3032
3188
|
);
|
|
@@ -3036,9 +3192,9 @@ function registerEnvelopeTools(server) {
|
|
|
3036
3192
|
{
|
|
3037
3193
|
trackIndex,
|
|
3038
3194
|
envelopeIndex,
|
|
3039
|
-
active:
|
|
3040
|
-
visible:
|
|
3041
|
-
armed:
|
|
3195
|
+
active: z19.boolean().optional().describe("Set envelope active/inactive"),
|
|
3196
|
+
visible: z19.boolean().optional().describe("Set envelope visible/hidden in arrange view"),
|
|
3197
|
+
armed: z19.boolean().optional().describe("Set envelope armed for writing automation")
|
|
3042
3198
|
},
|
|
3043
3199
|
async (params) => run2("set_envelope_properties", params)
|
|
3044
3200
|
);
|
|
@@ -3055,8 +3211,8 @@ function registerEnvelopeTools(server) {
|
|
|
3055
3211
|
trackIndex,
|
|
3056
3212
|
envelopeIndex,
|
|
3057
3213
|
automationItemIndex,
|
|
3058
|
-
timeStart:
|
|
3059
|
-
timeEnd:
|
|
3214
|
+
timeStart: z19.coerce.number().describe("Start of time range in seconds (inclusive)"),
|
|
3215
|
+
timeEnd: z19.coerce.number().describe("End of time range in seconds (exclusive)")
|
|
3060
3216
|
},
|
|
3061
3217
|
async (params) => run2("remove_envelope_points", params)
|
|
3062
3218
|
);
|
|
@@ -3072,11 +3228,11 @@ function registerEnvelopeTools(server) {
|
|
|
3072
3228
|
{
|
|
3073
3229
|
trackIndex,
|
|
3074
3230
|
envelopeIndex,
|
|
3075
|
-
position:
|
|
3076
|
-
length:
|
|
3077
|
-
poolId:
|
|
3078
|
-
points:
|
|
3079
|
-
captureEnvelope:
|
|
3231
|
+
position: z19.coerce.number().min(0).describe("Item start in seconds"),
|
|
3232
|
+
length: z19.coerce.number().positive().describe("Item length in seconds"),
|
|
3233
|
+
poolId: z19.coerce.number().int().min(0).optional().describe("Existing pool to instance (from list_automation_items)"),
|
|
3234
|
+
points: z19.string().optional().describe(`New pool only. JSON array [{time, value | db, shape?, tension?}], time from the item start. ${VALUE_HELP}`),
|
|
3235
|
+
captureEnvelope: z19.boolean().optional().describe("Move the underlying points in range into the item (new pool)"),
|
|
3080
3236
|
...automationItemFields
|
|
3081
3237
|
},
|
|
3082
3238
|
async (params) => run2("insert_automation_item", params)
|
|
@@ -3087,9 +3243,9 @@ function registerEnvelopeTools(server) {
|
|
|
3087
3243
|
{
|
|
3088
3244
|
trackIndex,
|
|
3089
3245
|
envelopeIndex,
|
|
3090
|
-
automationItemIndex:
|
|
3091
|
-
position:
|
|
3092
|
-
length:
|
|
3246
|
+
automationItemIndex: z19.coerce.number().int().min(0).describe("Automation item index (from list_automation_items)"),
|
|
3247
|
+
position: z19.coerce.number().min(0).optional().describe("Item start in seconds"),
|
|
3248
|
+
length: z19.coerce.number().positive().optional().describe("Item length in seconds"),
|
|
3093
3249
|
...automationItemFields
|
|
3094
3250
|
},
|
|
3095
3251
|
async (params) => run2("set_automation_item", params)
|
|
@@ -3100,29 +3256,29 @@ function registerEnvelopeTools(server) {
|
|
|
3100
3256
|
{
|
|
3101
3257
|
trackIndex,
|
|
3102
3258
|
envelopeIndex,
|
|
3103
|
-
automationItemIndex:
|
|
3104
|
-
preservePoints:
|
|
3259
|
+
automationItemIndex: z19.coerce.number().int().min(0).describe("Automation item index (from list_automation_items)"),
|
|
3260
|
+
preservePoints: z19.boolean().optional().describe("Keep the item's points on the underlying envelope")
|
|
3105
3261
|
},
|
|
3106
3262
|
async (params) => run2("delete_automation_item", params)
|
|
3107
3263
|
);
|
|
3108
3264
|
}
|
|
3109
3265
|
|
|
3110
3266
|
// apps/reaper-mcp-server/src/tools/batch.ts
|
|
3111
|
-
import { z as
|
|
3267
|
+
import { z as z20 } from "zod/v4";
|
|
3112
3268
|
function registerBatchTools(server) {
|
|
3113
3269
|
server.tool(
|
|
3114
3270
|
"set_multiple_track_properties",
|
|
3115
3271
|
"Batch set properties (volume, pan, mute, solo, recordArm, phase, input) on multiple tracks in a single call. Much more efficient than calling set_track_property repeatedly. Pass an array of track update objects, each with trackIndex and any properties to change.",
|
|
3116
3272
|
{
|
|
3117
|
-
tracks:
|
|
3118
|
-
trackIndex:
|
|
3119
|
-
volume:
|
|
3120
|
-
pan:
|
|
3121
|
-
mute:
|
|
3122
|
-
solo:
|
|
3123
|
-
recordArm:
|
|
3124
|
-
phase:
|
|
3125
|
-
input:
|
|
3273
|
+
tracks: z20.array(z20.object({
|
|
3274
|
+
trackIndex: z20.coerce.number().int().min(-1).describe("0-based track index (-1 = master track)"),
|
|
3275
|
+
volume: z20.coerce.number().optional().describe("Volume in dB (0 = unity gain)"),
|
|
3276
|
+
pan: z20.coerce.number().min(-1).max(1).optional().describe("Pan position -1.0 (left) to 1.0 (right)"),
|
|
3277
|
+
mute: z20.coerce.number().int().min(0).max(1).optional().describe("Mute state (0=unmuted, 1=muted)"),
|
|
3278
|
+
solo: z20.coerce.number().int().min(0).max(1).optional().describe("Solo state (0=unsolo, 1=solo)"),
|
|
3279
|
+
recordArm: z20.coerce.number().int().min(0).max(1).optional().describe("Record arm state (0=unarmed, 1=armed)"),
|
|
3280
|
+
phase: z20.coerce.number().int().min(0).max(1).optional().describe("Phase inversion (0=normal, 1=inverted)"),
|
|
3281
|
+
input: z20.coerce.number().int().optional().describe("REAPER input index (-1 = no input)")
|
|
3126
3282
|
})).describe("Array of track property updates to apply")
|
|
3127
3283
|
},
|
|
3128
3284
|
async ({ tracks: tracks2 }) => {
|
|
@@ -3137,13 +3293,13 @@ function registerBatchTools(server) {
|
|
|
3137
3293
|
"setup_fx_chain",
|
|
3138
3294
|
"Add multiple FX plugins to a track with optional initial parameter values in a single call. Returns the FX chain indices of added plugins. More efficient than calling add_fx and set_fx_parameter repeatedly.",
|
|
3139
3295
|
{
|
|
3140
|
-
trackIndex:
|
|
3141
|
-
plugins:
|
|
3142
|
-
fxName:
|
|
3143
|
-
enabled:
|
|
3144
|
-
parameters:
|
|
3145
|
-
index:
|
|
3146
|
-
value:
|
|
3296
|
+
trackIndex: z20.coerce.number().int().min(-1).describe("0-based track index (-1 = master track)"),
|
|
3297
|
+
plugins: z20.array(z20.object({
|
|
3298
|
+
fxName: z20.string().describe('FX plugin name (partial match supported, e.g. "ReaEQ", "VST: Pro-Q 3")'),
|
|
3299
|
+
enabled: z20.coerce.number().int().min(0).max(1).optional().describe("Initial enabled state (1=enabled default, 0=bypassed)"),
|
|
3300
|
+
parameters: z20.array(z20.object({
|
|
3301
|
+
index: z20.coerce.number().int().min(0).describe("Parameter index"),
|
|
3302
|
+
value: z20.coerce.number().describe("Parameter value: normalized 0.0\u20131.0 for most plugins; a few use their own range (ReaComp Threshold/Wet/Dry 0\u20132 linear gain, JSFX raw slider values). Check minValue/maxValue from get_fx_parameters")
|
|
3147
3303
|
})).optional().describe("Initial parameter values to set after adding the plugin")
|
|
3148
3304
|
})).describe("Array of FX plugins to add, in order")
|
|
3149
3305
|
},
|
|
@@ -3159,11 +3315,11 @@ function registerBatchTools(server) {
|
|
|
3159
3315
|
"set_multiple_fx_parameters",
|
|
3160
3316
|
"Batch set parameters across multiple FX plugins, potentially on different tracks, in a single call. Much faster than repeated set_fx_parameter calls. Pass an array of update objects with trackIndex, fxIndex, paramIndex, and value.",
|
|
3161
3317
|
{
|
|
3162
|
-
updates:
|
|
3163
|
-
trackIndex:
|
|
3164
|
-
fxIndex:
|
|
3165
|
-
paramIndex:
|
|
3166
|
-
value:
|
|
3318
|
+
updates: z20.array(z20.object({
|
|
3319
|
+
trackIndex: z20.coerce.number().int().min(-1).describe("0-based track index (-1 = master track)"),
|
|
3320
|
+
fxIndex: z20.coerce.number().int().min(0).describe("0-based FX index in the chain"),
|
|
3321
|
+
paramIndex: z20.coerce.number().int().min(0).describe("0-based parameter index"),
|
|
3322
|
+
value: z20.coerce.number().describe("Parameter value: normalized 0.0\u20131.0 for most plugins; a few use their own range (ReaComp Threshold/Wet/Dry 0\u20132 linear gain, JSFX raw slider values). Check minValue/maxValue from get_fx_parameters")
|
|
3167
3323
|
})).describe("Array of FX parameter updates to apply")
|
|
3168
3324
|
},
|
|
3169
3325
|
async ({ updates }) => {
|
|
@@ -3177,12 +3333,12 @@ function registerBatchTools(server) {
|
|
|
3177
3333
|
}
|
|
3178
3334
|
|
|
3179
3335
|
// apps/reaper-mcp-server/src/tools/plan.ts
|
|
3180
|
-
import { z as
|
|
3336
|
+
import { z as z24 } from "zod/v4";
|
|
3181
3337
|
|
|
3182
3338
|
// apps/reaper-mcp-server/src/tools/actions.ts
|
|
3183
|
-
import { z as
|
|
3184
|
-
var actionRef =
|
|
3185
|
-
var actionSection =
|
|
3339
|
+
import { z as z21 } from "zod/v4";
|
|
3340
|
+
var actionRef = z21.union([z21.number().int().min(1), z21.string().min(1)]).describe('Command id (40001), named id ("_SWS_\u2026", "_aee8\u2026" \u2014 stable across sessions; prefer it for custom actions and scripts), or the exact action name');
|
|
3341
|
+
var actionSection = z21.enum(["main", "midi_editor", "midi_event_list"]).optional().describe("Action section (default main). MIDI editor actions need an open MIDI editor.");
|
|
3186
3342
|
function reply3(res) {
|
|
3187
3343
|
if (!res.success) {
|
|
3188
3344
|
return { content: [{ type: "text", text: `Error: ${res.error}` }], isError: true };
|
|
@@ -3194,9 +3350,9 @@ function registerActionTools(server) {
|
|
|
3194
3350
|
"search_actions",
|
|
3195
3351
|
"Search REAPER's action list (native, SWS/extensions, scripts, and the user's Custom: macros \u2014 ~6k actions) inside REAPER. Every query word must appear in the action name or named id (case-insensitive). Returns id, stable namedId, name, toggle state, keyboard shortcuts, and whether it opens a dialog or is always refused, plus the total match count.",
|
|
3196
3352
|
{
|
|
3197
|
-
query:
|
|
3353
|
+
query: z21.string().describe('Words to match, e.g. "track insert", "Custom:", "metronome"'),
|
|
3198
3354
|
section: actionSection,
|
|
3199
|
-
limit:
|
|
3355
|
+
limit: z21.coerce.number().int().min(1).max(100).optional().describe("Max results (default 20, max 100)")
|
|
3200
3356
|
},
|
|
3201
3357
|
async ({ query, section, limit }) => reply3(await sendCommand("search_actions", { query, section, limit }))
|
|
3202
3358
|
);
|
|
@@ -3212,18 +3368,18 @@ function registerActionTools(server) {
|
|
|
3212
3368
|
{
|
|
3213
3369
|
action: actionRef,
|
|
3214
3370
|
section: actionSection,
|
|
3215
|
-
allowDialog:
|
|
3371
|
+
allowDialog: z21.boolean().optional().describe("Allow an action that opens a dialog \u2014 only when someone is at the screen to close it")
|
|
3216
3372
|
},
|
|
3217
3373
|
async ({ action, section, allowDialog }) => reply3(await sendCommand("run_action", { action, section, allowDialog }))
|
|
3218
3374
|
);
|
|
3219
3375
|
}
|
|
3220
3376
|
|
|
3221
3377
|
// apps/reaper-mcp-server/src/tools/arrange.ts
|
|
3222
|
-
import { z as
|
|
3223
|
-
import { trace as
|
|
3378
|
+
import { z as z23 } from "zod/v4";
|
|
3379
|
+
import { trace as trace4 } from "@opentelemetry/api";
|
|
3224
3380
|
|
|
3225
3381
|
// apps/reaper-mcp-server/src/tools/items.ts
|
|
3226
|
-
import { z as
|
|
3382
|
+
import { z as z22 } from "zod/v4";
|
|
3227
3383
|
function reply4(res) {
|
|
3228
3384
|
if (!res.success) {
|
|
3229
3385
|
return { content: [{ type: "text", text: `Error: ${res.error}` }], isError: true };
|
|
@@ -3233,19 +3389,19 @@ function reply4(res) {
|
|
|
3233
3389
|
function passThrough(command2) {
|
|
3234
3390
|
return async (args) => reply4(await sendCommand(command2, args));
|
|
3235
3391
|
}
|
|
3236
|
-
var trackIndex2 =
|
|
3237
|
-
var itemIndex =
|
|
3238
|
-
var takeIndex =
|
|
3239
|
-
var fadeShape =
|
|
3240
|
-
var fadeCurve =
|
|
3392
|
+
var trackIndex2 = z22.coerce.number().int().min(0).describe("0-based track index");
|
|
3393
|
+
var itemIndex = z22.coerce.number().int().min(0).describe("0-based item index on the track");
|
|
3394
|
+
var takeIndex = z22.coerce.number().int().min(0).optional().describe("0-based take index (default: the active take)");
|
|
3395
|
+
var fadeShape = z22.coerce.number().int().min(0).max(6).optional();
|
|
3396
|
+
var fadeCurve = z22.coerce.number().min(-1).max(1).optional();
|
|
3241
3397
|
function registerItemTools(server) {
|
|
3242
3398
|
server.tool(
|
|
3243
3399
|
"insert_audio_file",
|
|
3244
3400
|
"Insert an audio file (WAV, AIFF, FLAC, MP3, \u2026) onto a track as a new item at a position. The item is as long as the file. Refused, with nothing changed, when the file does not exist or REAPER cannot read it as audio.",
|
|
3245
3401
|
{
|
|
3246
3402
|
trackIndex: trackIndex2,
|
|
3247
|
-
filePath:
|
|
3248
|
-
position:
|
|
3403
|
+
filePath: z22.string().min(1).describe("Absolute path of the audio file"),
|
|
3404
|
+
position: z22.coerce.number().min(0).optional().describe("Item start in seconds (default: the edit cursor)")
|
|
3249
3405
|
},
|
|
3250
3406
|
passThrough("insert_audio_file")
|
|
3251
3407
|
);
|
|
@@ -3258,7 +3414,7 @@ function registerItemTools(server) {
|
|
|
3258
3414
|
server.tool(
|
|
3259
3415
|
"set_active_take",
|
|
3260
3416
|
"Make one take of a media item the active (playing) take. Returns the item's takes afterwards.",
|
|
3261
|
-
{ trackIndex: trackIndex2, itemIndex, takeIndex:
|
|
3417
|
+
{ trackIndex: trackIndex2, itemIndex, takeIndex: z22.coerce.number().int().min(0).describe("0-based take index") },
|
|
3262
3418
|
passThrough("set_active_take")
|
|
3263
3419
|
);
|
|
3264
3420
|
server.tool(
|
|
@@ -3268,9 +3424,9 @@ function registerItemTools(server) {
|
|
|
3268
3424
|
trackIndex: trackIndex2,
|
|
3269
3425
|
itemIndex,
|
|
3270
3426
|
takeIndex,
|
|
3271
|
-
fxIndex:
|
|
3272
|
-
offset:
|
|
3273
|
-
limit:
|
|
3427
|
+
fxIndex: z22.coerce.number().int().min(0).optional().describe("0-based take FX index whose parameters to list"),
|
|
3428
|
+
offset: z22.coerce.number().int().min(0).optional().describe("Skip the first N parameters (default 0)"),
|
|
3429
|
+
limit: z22.coerce.number().int().min(1).optional().describe("Max parameters to return (default all)")
|
|
3274
3430
|
},
|
|
3275
3431
|
passThrough("get_take_fx")
|
|
3276
3432
|
);
|
|
@@ -3281,14 +3437,14 @@ function registerItemTools(server) {
|
|
|
3281
3437
|
trackIndex: trackIndex2,
|
|
3282
3438
|
itemIndex,
|
|
3283
3439
|
takeIndex,
|
|
3284
|
-
fxName:
|
|
3440
|
+
fxName: z22.string().min(1).describe('FX name, e.g. "ReaEQ" or "VST: Pro-Q 3"')
|
|
3285
3441
|
},
|
|
3286
3442
|
passThrough("add_take_fx")
|
|
3287
3443
|
);
|
|
3288
3444
|
server.tool(
|
|
3289
3445
|
"remove_take_fx",
|
|
3290
3446
|
"Remove one FX from a take's FX chain. Returns the take's FX chain afterwards.",
|
|
3291
|
-
{ trackIndex: trackIndex2, itemIndex, takeIndex, fxIndex:
|
|
3447
|
+
{ trackIndex: trackIndex2, itemIndex, takeIndex, fxIndex: z22.coerce.number().int().min(0).describe("0-based take FX index") },
|
|
3292
3448
|
passThrough("remove_take_fx")
|
|
3293
3449
|
);
|
|
3294
3450
|
server.tool(
|
|
@@ -3298,9 +3454,9 @@ function registerItemTools(server) {
|
|
|
3298
3454
|
trackIndex: trackIndex2,
|
|
3299
3455
|
itemIndex,
|
|
3300
3456
|
takeIndex,
|
|
3301
|
-
fxIndex:
|
|
3302
|
-
paramIndex:
|
|
3303
|
-
value:
|
|
3457
|
+
fxIndex: z22.coerce.number().int().min(0).describe("0-based take FX index"),
|
|
3458
|
+
paramIndex: z22.coerce.number().int().min(0).describe("0-based parameter index (see get_take_fx with fxIndex)"),
|
|
3459
|
+
value: z22.coerce.number().describe("Parameter value (normalized 0.0-1.0 for most plugins)")
|
|
3304
3460
|
},
|
|
3305
3461
|
passThrough("set_take_fx_parameter")
|
|
3306
3462
|
);
|
|
@@ -3316,7 +3472,7 @@ function registerItemTools(server) {
|
|
|
3316
3472
|
{
|
|
3317
3473
|
trackIndex: trackIndex2,
|
|
3318
3474
|
itemIndex,
|
|
3319
|
-
color:
|
|
3475
|
+
color: z22.string().describe('"#RRGGBB" (e.g. "#FF8000"), or "none"')
|
|
3320
3476
|
},
|
|
3321
3477
|
passThrough("set_item_color")
|
|
3322
3478
|
);
|
|
@@ -3326,8 +3482,8 @@ function registerItemTools(server) {
|
|
|
3326
3482
|
{
|
|
3327
3483
|
trackIndex: trackIndex2,
|
|
3328
3484
|
itemIndex,
|
|
3329
|
-
fadeInLength:
|
|
3330
|
-
fadeOutLength:
|
|
3485
|
+
fadeInLength: z22.coerce.number().min(0).optional().describe("Fade-in length in seconds"),
|
|
3486
|
+
fadeOutLength: z22.coerce.number().min(0).optional().describe("Fade-out length in seconds"),
|
|
3331
3487
|
fadeInShape: fadeShape.describe("Fade-in shape 0-6"),
|
|
3332
3488
|
fadeOutShape: fadeShape.describe("Fade-out shape 0-6"),
|
|
3333
3489
|
fadeInCurve: fadeCurve.describe("Fade-in curvature -1..1 (0 = shape default)"),
|
|
@@ -3339,11 +3495,11 @@ function registerItemTools(server) {
|
|
|
3339
3495
|
|
|
3340
3496
|
// apps/reaper-mcp-server/src/tools/arrange.ts
|
|
3341
3497
|
var ARRANGE_TIMEOUT_MS = 6e4;
|
|
3342
|
-
var itemRefs =
|
|
3343
|
-
trackIndex:
|
|
3344
|
-
itemIndex:
|
|
3498
|
+
var itemRefs = z23.array(z23.object({
|
|
3499
|
+
trackIndex: z23.coerce.number().int().min(0).describe("0-based track index"),
|
|
3500
|
+
itemIndex: z23.coerce.number().int().min(0).describe("0-based item index on the track (list_media_items order)")
|
|
3345
3501
|
})).min(1).max(64);
|
|
3346
|
-
var seconds = (what) =>
|
|
3502
|
+
var seconds = (what) => z23.coerce.number().min(0).describe(what);
|
|
3347
3503
|
var OPERATION = {
|
|
3348
3504
|
copy_media_items: "copy",
|
|
3349
3505
|
insert_time: "insert",
|
|
@@ -3373,7 +3529,7 @@ function recordEdit(command2, args, data) {
|
|
|
3373
3529
|
const start = num2("start");
|
|
3374
3530
|
const end = num2("end");
|
|
3375
3531
|
const length = num2("length") ?? num2("span") ?? (start !== void 0 && end !== void 0 ? end - start : void 0);
|
|
3376
|
-
|
|
3532
|
+
trace4.getActiveSpan()?.setAttributes({
|
|
3377
3533
|
"reaper.arrange.operation": operation,
|
|
3378
3534
|
"reaper.arrange.items_changed": items,
|
|
3379
3535
|
...length !== void 0 && { "reaper.arrange.length_s": length }
|
|
@@ -3395,10 +3551,10 @@ function registerArrangeTools(server) {
|
|
|
3395
3551
|
"Copy (duplicate or repeat) media items, keeping their spacing: by default right after the last one, or at `position` and/or on another track. `times` lays copies end to end (e.g. repeat a 4-bar loop 8 times). Copies get fresh GUIDs; MIDI copies get their own data unless `pooled`. One undo point; returns where each copy landed.",
|
|
3396
3552
|
{
|
|
3397
3553
|
items: itemRefs.describe("Items to copy"),
|
|
3398
|
-
times:
|
|
3554
|
+
times: z23.coerce.number().int().min(1).max(64).optional().describe("How many copies of the group (default 1)"),
|
|
3399
3555
|
position: seconds("Start of the first copy in seconds (default: end of the last source item)").optional(),
|
|
3400
|
-
trackIndex:
|
|
3401
|
-
pooled:
|
|
3556
|
+
trackIndex: z23.coerce.number().int().min(0).optional().describe("Destination track (default: each item's own track)"),
|
|
3557
|
+
pooled: z23.boolean().optional().describe("MIDI copies share the source's data (edit one, edit all)")
|
|
3402
3558
|
},
|
|
3403
3559
|
(args) => send("copy_media_items", args)
|
|
3404
3560
|
);
|
|
@@ -3407,8 +3563,8 @@ function registerArrangeTools(server) {
|
|
|
3407
3563
|
"Open empty time at a position across the whole project: every item, marker, region, tempo marker, envelope point and automation item at or after it moves later by `length`; items spanning it are split (unless splitItems: false) and regions spanning it grow. An automation item spanning the position stays where it is (counted in automationItemsSpanning). Independent of REAPER's ripple settings. One undo point; returns what moved.",
|
|
3408
3564
|
{
|
|
3409
3565
|
position: seconds("Where to open time, in seconds"),
|
|
3410
|
-
length:
|
|
3411
|
-
splitItems:
|
|
3566
|
+
length: z23.coerce.number().positive().max(3600).describe("How much time to insert, in seconds"),
|
|
3567
|
+
splitItems: z23.boolean().optional().describe("Split items that span the position (default true)")
|
|
3412
3568
|
},
|
|
3413
3569
|
(args) => send("insert_time", args)
|
|
3414
3570
|
);
|
|
@@ -3425,13 +3581,13 @@ function registerArrangeTools(server) {
|
|
|
3425
3581
|
"copy_section",
|
|
3426
3582
|
"Copy a section of the song (a region by list_regions index, or start/end) to another position: the items in it (trimmed to the section) and, by default, its automation (envelope points, plus a pooled copy of each automation item wholly inside the section; items crossing an edge are counted in automationItemsCrossing, not copied), on every track or the given tracks. With `insert`, time is opened at the position first, across the whole project like insert_time, so nothing there is overwritten (e.g. repeat a chorus). One undo point.",
|
|
3427
3583
|
{
|
|
3428
|
-
regionIndex:
|
|
3584
|
+
regionIndex: z23.coerce.number().int().min(0).optional().describe("Region to copy (list_regions index)"),
|
|
3429
3585
|
start: seconds("Section start in seconds (instead of regionIndex)").optional(),
|
|
3430
3586
|
end: seconds("Section end in seconds (instead of regionIndex)").optional(),
|
|
3431
3587
|
position: seconds("Where the copy starts, in seconds"),
|
|
3432
|
-
insert:
|
|
3433
|
-
envelopes:
|
|
3434
|
-
tracks:
|
|
3588
|
+
insert: z23.boolean().optional().describe("Insert time at the position first (default false: overwrite automation there, place items over)"),
|
|
3589
|
+
envelopes: z23.boolean().optional().describe("Copy the automation too: envelope points and the automation items inside the section (default true)"),
|
|
3590
|
+
tracks: z23.array(z23.coerce.number().int().min(0)).min(1).optional().describe("Track indexes to copy (default all)")
|
|
3435
3591
|
},
|
|
3436
3592
|
(args) => send("copy_section", args)
|
|
3437
3593
|
);
|
|
@@ -3439,10 +3595,10 @@ function registerArrangeTools(server) {
|
|
|
3439
3595
|
"process_items",
|
|
3440
3596
|
"Process audio items: `normalize` sets item gain so each item hits `target` dB (mode peak by default, or true_peak, lufs_i, rms, lufs_m_max, lufs_s_max; non-peak modes need a target), measured over what the item plays; `reverse` toggles each active take's direction (a take already reversed plays forward again); `glue` joins the whole items on each track into one new item, whatever the time selection. MIDI items are refused for normalize/reverse. The selection is kept. One undo point; normalize returns each item's level and gain before and after.",
|
|
3441
3597
|
{
|
|
3442
|
-
operation:
|
|
3598
|
+
operation: z23.enum(["normalize", "reverse", "glue"]),
|
|
3443
3599
|
items: itemRefs.describe("Items to process"),
|
|
3444
|
-
mode:
|
|
3445
|
-
target:
|
|
3600
|
+
mode: z23.enum(["peak", "true_peak", "lufs_i", "rms", "lufs_m_max", "lufs_s_max"]).optional().describe("Normalize measurement (default peak)"),
|
|
3601
|
+
target: z23.coerce.number().min(-70).max(0).optional().describe("Normalize target in dB (default 0 for peak modes)")
|
|
3446
3602
|
},
|
|
3447
3603
|
(args) => send("process_items", args)
|
|
3448
3604
|
);
|
|
@@ -3450,98 +3606,98 @@ function registerArrangeTools(server) {
|
|
|
3450
3606
|
|
|
3451
3607
|
// apps/reaper-mcp-server/src/tools/plan.ts
|
|
3452
3608
|
var RUN_PLAN_TIMEOUT_MS = 12e4;
|
|
3453
|
-
var trackRef2 =
|
|
3454
|
-
var fxRef =
|
|
3455
|
-
var refName =
|
|
3456
|
-
var paramValues =
|
|
3457
|
-
index:
|
|
3458
|
-
value:
|
|
3609
|
+
var trackRef2 = z24.union([z24.number().int().min(-1), z24.string().min(1)]).describe('Track: 0-based index (-1 or "master" = master track), exact name, "{GUID}", or a "$ref" bound by an earlier add_track');
|
|
3610
|
+
var fxRef = z24.union([z24.number().int().min(0), z24.string().min(1)]).describe('FX: index on the track, unique name substring, or a "$ref" bound by an earlier add_fx');
|
|
3611
|
+
var refName = z24.string().regex(/^\$[A-Za-z0-9_]+$/, 'refs look like "$name"');
|
|
3612
|
+
var paramValues = z24.array(z24.object({
|
|
3613
|
+
index: z24.coerce.number().int().min(0).describe("Parameter index"),
|
|
3614
|
+
value: z24.coerce.number().describe("Parameter value (same scale as set_fx_parameter)")
|
|
3459
3615
|
})).min(1);
|
|
3460
|
-
var opSchema =
|
|
3461
|
-
|
|
3462
|
-
op:
|
|
3463
|
-
name:
|
|
3464
|
-
index:
|
|
3616
|
+
var opSchema = z24.discriminatedUnion("op", [
|
|
3617
|
+
z24.object({
|
|
3618
|
+
op: z24.literal("add_track"),
|
|
3619
|
+
name: z24.string().optional(),
|
|
3620
|
+
index: z24.coerce.number().int().min(0).optional().describe("Insert position (default: end)"),
|
|
3465
3621
|
as: refName.optional()
|
|
3466
3622
|
}),
|
|
3467
|
-
|
|
3468
|
-
op:
|
|
3623
|
+
z24.object({
|
|
3624
|
+
op: z24.literal("set_track"),
|
|
3469
3625
|
track: trackRef2,
|
|
3470
|
-
volume:
|
|
3471
|
-
pan:
|
|
3472
|
-
mute:
|
|
3473
|
-
solo:
|
|
3474
|
-
recordArm:
|
|
3475
|
-
phase:
|
|
3476
|
-
input:
|
|
3477
|
-
name:
|
|
3626
|
+
volume: z24.coerce.number().optional().describe("Volume in dB"),
|
|
3627
|
+
pan: z24.coerce.number().min(-1).max(1).optional(),
|
|
3628
|
+
mute: z24.coerce.number().int().min(0).max(1).optional(),
|
|
3629
|
+
solo: z24.coerce.number().int().min(0).max(1).optional(),
|
|
3630
|
+
recordArm: z24.coerce.number().int().min(0).max(1).optional(),
|
|
3631
|
+
phase: z24.coerce.number().int().min(0).max(1).optional(),
|
|
3632
|
+
input: z24.coerce.number().int().optional(),
|
|
3633
|
+
name: z24.string().optional()
|
|
3478
3634
|
}),
|
|
3479
|
-
|
|
3480
|
-
op:
|
|
3635
|
+
z24.object({
|
|
3636
|
+
op: z24.literal("add_fx"),
|
|
3481
3637
|
track: trackRef2,
|
|
3482
|
-
fxName:
|
|
3483
|
-
position:
|
|
3484
|
-
enabled:
|
|
3638
|
+
fxName: z24.string().min(1).describe('FX name (partial match, e.g. "ReaComp", "VST3: Pro-Q 3")'),
|
|
3639
|
+
position: z24.coerce.number().int().min(0).optional().describe("Chain position (default: end)"),
|
|
3640
|
+
enabled: z24.coerce.number().int().min(0).max(1).optional(),
|
|
3485
3641
|
params: paramValues.optional(),
|
|
3486
3642
|
as: refName.optional()
|
|
3487
3643
|
}),
|
|
3488
|
-
|
|
3489
|
-
op:
|
|
3644
|
+
z24.object({
|
|
3645
|
+
op: z24.literal("set_fx_params"),
|
|
3490
3646
|
track: trackRef2.optional().describe('Required unless fx is a "$ref"'),
|
|
3491
3647
|
fx: fxRef,
|
|
3492
3648
|
params: paramValues
|
|
3493
3649
|
}),
|
|
3494
|
-
|
|
3495
|
-
op:
|
|
3650
|
+
z24.object({
|
|
3651
|
+
op: z24.literal("add_send"),
|
|
3496
3652
|
from: trackRef2,
|
|
3497
3653
|
to: trackRef2,
|
|
3498
|
-
volume:
|
|
3499
|
-
pan:
|
|
3500
|
-
mute:
|
|
3654
|
+
volume: z24.coerce.number().optional().describe("Send volume in dB"),
|
|
3655
|
+
pan: z24.coerce.number().min(-1).max(1).optional(),
|
|
3656
|
+
mute: z24.coerce.number().int().min(0).max(1).optional()
|
|
3501
3657
|
}),
|
|
3502
|
-
|
|
3503
|
-
op:
|
|
3658
|
+
z24.object({
|
|
3659
|
+
op: z24.literal("graft_fxchain"),
|
|
3504
3660
|
track: trackRef2.describe("Target track; its items, envelopes and sends are kept"),
|
|
3505
3661
|
from: trackRef2.optional().describe("Source track in this project"),
|
|
3506
|
-
fromChunk:
|
|
3662
|
+
fromChunk: z24.string().optional().describe("Base64 track state chunk (e.g. a full-chunk snapshot track)")
|
|
3507
3663
|
}),
|
|
3508
|
-
|
|
3509
|
-
op:
|
|
3510
|
-
tracks:
|
|
3511
|
-
mode:
|
|
3664
|
+
z24.object({
|
|
3665
|
+
op: z24.literal("select_tracks"),
|
|
3666
|
+
tracks: z24.array(trackRef2).min(1).describe("Tracks to select (refs allowed)"),
|
|
3667
|
+
mode: z24.enum(["replace", "add"]).optional().describe("replace (default) or add to the selection")
|
|
3512
3668
|
}),
|
|
3513
|
-
|
|
3514
|
-
op:
|
|
3669
|
+
z24.object({
|
|
3670
|
+
op: z24.literal("run_action"),
|
|
3515
3671
|
action: actionRef,
|
|
3516
3672
|
section: actionSection,
|
|
3517
|
-
allowDialog:
|
|
3673
|
+
allowDialog: z24.boolean().optional()
|
|
3518
3674
|
}),
|
|
3519
|
-
|
|
3520
|
-
op:
|
|
3675
|
+
z24.object({
|
|
3676
|
+
op: z24.literal("copy_items"),
|
|
3521
3677
|
items: itemRefs.describe("Items to copy, as the project is before the plan (no op that adds tracks or items may come first)"),
|
|
3522
|
-
times:
|
|
3523
|
-
position:
|
|
3524
|
-
trackIndex:
|
|
3525
|
-
pooled:
|
|
3678
|
+
times: z24.coerce.number().int().min(1).max(64).optional(),
|
|
3679
|
+
position: z24.coerce.number().min(0).optional(),
|
|
3680
|
+
trackIndex: z24.coerce.number().int().min(0).optional(),
|
|
3681
|
+
pooled: z24.boolean().optional()
|
|
3526
3682
|
}),
|
|
3527
|
-
|
|
3528
|
-
op:
|
|
3529
|
-
position:
|
|
3530
|
-
length:
|
|
3531
|
-
splitItems:
|
|
3683
|
+
z24.object({
|
|
3684
|
+
op: z24.literal("insert_time"),
|
|
3685
|
+
position: z24.coerce.number().min(0),
|
|
3686
|
+
length: z24.coerce.number().positive().max(3600),
|
|
3687
|
+
splitItems: z24.boolean().optional()
|
|
3532
3688
|
}),
|
|
3533
|
-
|
|
3534
|
-
op:
|
|
3535
|
-
start:
|
|
3536
|
-
end:
|
|
3689
|
+
z24.object({
|
|
3690
|
+
op: z24.literal("remove_time"),
|
|
3691
|
+
start: z24.coerce.number().min(0),
|
|
3692
|
+
end: z24.coerce.number().min(0)
|
|
3537
3693
|
})
|
|
3538
3694
|
]);
|
|
3539
3695
|
var runPlanShape = {
|
|
3540
|
-
ops:
|
|
3541
|
-
dryRun:
|
|
3542
|
-
idempotencyKey:
|
|
3543
|
-
snapshotBefore:
|
|
3544
|
-
label:
|
|
3696
|
+
ops: z24.array(opSchema).min(1).max(500).describe("Ordered list of ops"),
|
|
3697
|
+
dryRun: z24.boolean().optional().describe("Validate and resolve only; write nothing"),
|
|
3698
|
+
idempotencyKey: z24.string().min(1).optional().describe("Re-sending a key that was already applied returns the earlier result instead of applying again"),
|
|
3699
|
+
snapshotBefore: z24.string().min(1).optional().describe("Save a snapshot with this name before applying"),
|
|
3700
|
+
label: z24.string().min(1).optional().describe("Undo history label")
|
|
3545
3701
|
};
|
|
3546
3702
|
var KIND = { track: "a track", fx: "an FX" };
|
|
3547
3703
|
function validatePlanRefs(ops) {
|
|
@@ -3609,19 +3765,22 @@ function registerPlanTools(server) {
|
|
|
3609
3765
|
if (!res.success) {
|
|
3610
3766
|
return { content: [{ type: "text", text: `Error: ${res.error}` }], isError: true };
|
|
3611
3767
|
}
|
|
3768
|
+
if (!dryRun) {
|
|
3769
|
+
for (const op of ops) if (op.op === "add_track") noteScratchTrack(op.name);
|
|
3770
|
+
}
|
|
3612
3771
|
return { content: [{ type: "text", text: JSON.stringify(res.data, null, 2) }] };
|
|
3613
3772
|
}
|
|
3614
3773
|
);
|
|
3615
3774
|
}
|
|
3616
3775
|
|
|
3617
3776
|
// apps/reaper-mcp-server/src/tools/fx-housekeeping.ts
|
|
3618
|
-
import { z as
|
|
3619
|
-
var trackIndex3 =
|
|
3620
|
-
var fxTrackIndex =
|
|
3621
|
-
var fxIndex =
|
|
3622
|
-
var toTrackIndex =
|
|
3623
|
-
var toIndex =
|
|
3624
|
-
var overwrite =
|
|
3777
|
+
import { z as z25 } from "zod/v4";
|
|
3778
|
+
var trackIndex3 = z25.coerce.number().int().min(0).describe("0-based track index");
|
|
3779
|
+
var fxTrackIndex = z25.coerce.number().int().min(-1).describe("0-based track index (-1 = master track)");
|
|
3780
|
+
var fxIndex = z25.coerce.number().int().min(0).describe("0-based FX index in the track's chain");
|
|
3781
|
+
var toTrackIndex = z25.coerce.number().int().min(-1).optional().describe("0-based target track, -1 = master (default: the same track)");
|
|
3782
|
+
var toIndex = z25.coerce.number().int().min(0).optional().describe("0-based position in the target chain (default: the end)");
|
|
3783
|
+
var overwrite = z25.boolean().optional().describe("Replace an existing file of that name (default false: refuse)");
|
|
3625
3784
|
function registerFxHousekeepingTools(server) {
|
|
3626
3785
|
server.tool(
|
|
3627
3786
|
"move_fx",
|
|
@@ -3638,7 +3797,7 @@ function registerFxHousekeepingTools(server) {
|
|
|
3638
3797
|
server.tool(
|
|
3639
3798
|
"rename_fx",
|
|
3640
3799
|
"Rename one FX instance as shown in the FX chain (REAPER 6.37+). An empty name restores the plugin's own name.",
|
|
3641
|
-
{ trackIndex: fxTrackIndex, fxIndex, name:
|
|
3800
|
+
{ trackIndex: fxTrackIndex, fxIndex, name: z25.string().describe('New display name, or "" to clear the rename') },
|
|
3642
3801
|
passThrough("rename_fx")
|
|
3643
3802
|
);
|
|
3644
3803
|
server.tool(
|
|
@@ -3646,7 +3805,7 @@ function registerFxHousekeepingTools(server) {
|
|
|
3646
3805
|
`Save a track's whole FX chain (with all settings) as an .RfxChain file in REAPER's FXChains folder, where REAPER's own "Add FX chain" finds it. The name may include subfolders ("Vocals/Lead") but never "..", an absolute path or a drive letter.`,
|
|
3647
3806
|
{
|
|
3648
3807
|
trackIndex: fxTrackIndex,
|
|
3649
|
-
name:
|
|
3808
|
+
name: z25.string().min(1).describe("File name under FXChains/, without or with .RfxChain"),
|
|
3650
3809
|
overwrite
|
|
3651
3810
|
},
|
|
3652
3811
|
passThrough("save_fx_chain")
|
|
@@ -3656,8 +3815,8 @@ function registerFxHousekeepingTools(server) {
|
|
|
3656
3815
|
"Load an .RfxChain file onto a track: appended after its FX (default) or replacing them. Each loaded FX gets a fresh identity. See list_fx_chains for names.",
|
|
3657
3816
|
{
|
|
3658
3817
|
trackIndex: fxTrackIndex,
|
|
3659
|
-
name:
|
|
3660
|
-
mode:
|
|
3818
|
+
name: z25.string().min(1).describe('Name under FXChains/ (e.g. "Vocals/Lead"), or an absolute path to a .RfxChain file'),
|
|
3819
|
+
mode: z25.enum(["append", "replace"]).optional().describe("append (default) or replace the track's FX")
|
|
3661
3820
|
},
|
|
3662
3821
|
passThrough("load_fx_chain")
|
|
3663
3822
|
);
|
|
@@ -3672,8 +3831,8 @@ function registerFxHousekeepingTools(server) {
|
|
|
3672
3831
|
`Save a track (name, FX chain, settings) as an .RTrackTemplate in REAPER's TrackTemplates folder. Items are left out unless includeItems is true; receives and folder state are never saved (they depend on the tracks around it). The name may include subfolders but never "..", an absolute path or a drive letter.`,
|
|
3673
3832
|
{
|
|
3674
3833
|
trackIndex: trackIndex3,
|
|
3675
|
-
name:
|
|
3676
|
-
includeItems:
|
|
3834
|
+
name: z25.string().min(1).describe("File name under TrackTemplates/, without or with .RTrackTemplate"),
|
|
3835
|
+
includeItems: z25.boolean().optional().describe("Also save the track's media items (default false)"),
|
|
3677
3836
|
overwrite
|
|
3678
3837
|
},
|
|
3679
3838
|
passThrough("save_track_template")
|
|
@@ -3682,8 +3841,8 @@ function registerFxHousekeepingTools(server) {
|
|
|
3682
3841
|
"insert_track_template",
|
|
3683
3842
|
"Insert the track(s) from an .RTrackTemplate at a position, each with fresh identities. See list_track_templates for names.",
|
|
3684
3843
|
{
|
|
3685
|
-
name:
|
|
3686
|
-
index:
|
|
3844
|
+
name: z25.string().min(1).describe("Name under TrackTemplates/, or an absolute path to a .RTrackTemplate file"),
|
|
3845
|
+
index: z25.coerce.number().int().min(0).optional().describe("0-based position of the first inserted track (default: the end)")
|
|
3687
3846
|
},
|
|
3688
3847
|
passThrough("insert_track_template")
|
|
3689
3848
|
);
|
|
@@ -3696,7 +3855,7 @@ function registerFxHousekeepingTools(server) {
|
|
|
3696
3855
|
}
|
|
3697
3856
|
|
|
3698
3857
|
// apps/reaper-mcp-server/src/tools/categories.ts
|
|
3699
|
-
import { z as
|
|
3858
|
+
import { z as z26 } from "zod/v4";
|
|
3700
3859
|
var TOOL_CATEGORIES = {
|
|
3701
3860
|
project: {
|
|
3702
3861
|
name: "project",
|
|
@@ -3905,8 +4064,8 @@ var TOOL_CATEGORIES = {
|
|
|
3905
4064
|
},
|
|
3906
4065
|
knowledge: {
|
|
3907
4066
|
name: "knowledge",
|
|
3908
|
-
description: "Built-in mix knowledge (read-only, curated in LoreKit): list/search plugin records and mixing lessons, read one by key. The user's own LoreKit layer (user:: keys) overrides it.",
|
|
3909
|
-
tools: ["list_builtin_knowledge", "get_builtin_knowledge"]
|
|
4067
|
+
description: "Built-in mix knowledge (read-only, curated in LoreKit): list/search plugin records and mixing lessons, read one by key. The user's own LoreKit layer (user:: keys) overrides it. report_plugin_research ends a plugin research run.",
|
|
4068
|
+
tools: ["list_builtin_knowledge", "get_builtin_knowledge", "report_plugin_research"]
|
|
3910
4069
|
}
|
|
3911
4070
|
};
|
|
3912
4071
|
function registerExtensionCategory(extension, description, tools) {
|
|
@@ -3939,7 +4098,7 @@ function registerCategoryTools(server) {
|
|
|
3939
4098
|
"enable_tool_category",
|
|
3940
4099
|
"Signal that you intend to use tools from a specific category. All tools are already registered and available \u2014 this call returns the full list of tools in the category so you know exactly which tool names to use. Use list_tool_categories first to see all available categories.",
|
|
3941
4100
|
{
|
|
3942
|
-
category:
|
|
4101
|
+
category: z26.string().describe('Category name (e.g. "tracks", "fx", "midi", "media", "transport", "markers", "envelopes", "analysis", "discovery")')
|
|
3943
4102
|
},
|
|
3944
4103
|
async ({ category }) => {
|
|
3945
4104
|
const cat = TOOL_CATEGORIES[category];
|
|
@@ -3971,7 +4130,7 @@ function registerCategoryTools(server) {
|
|
|
3971
4130
|
"disable_tool_category",
|
|
3972
4131
|
"Signal that you are done using tools from a specific category. This is a semantic hint to help manage your context budget \u2014 the tools remain registered but you can use this to indicate you no longer need them in the current workflow.",
|
|
3973
4132
|
{
|
|
3974
|
-
category:
|
|
4133
|
+
category: z26.string().describe('Category name (e.g. "tracks", "fx", "midi", "media", "transport", "markers", "envelopes", "analysis", "discovery")')
|
|
3975
4134
|
},
|
|
3976
4135
|
async ({ category }) => {
|
|
3977
4136
|
const cat = TOOL_CATEGORIES[category];
|
|
@@ -4000,7 +4159,7 @@ function registerCategoryTools(server) {
|
|
|
4000
4159
|
}
|
|
4001
4160
|
|
|
4002
4161
|
// apps/reaper-mcp-server/src/tools/aesthetics.ts
|
|
4003
|
-
import { z as
|
|
4162
|
+
import { z as z27 } from "zod/v4";
|
|
4004
4163
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
4005
4164
|
|
|
4006
4165
|
// apps/reaper-mcp-server/src/render.ts
|
|
@@ -4415,7 +4574,9 @@ var MCP_TOOL_NAMES = [
|
|
|
4415
4574
|
"separate_stems",
|
|
4416
4575
|
// built-in mix knowledge (read-only LoreKit proxy)
|
|
4417
4576
|
"list_builtin_knowledge",
|
|
4418
|
-
"get_builtin_knowledge"
|
|
4577
|
+
"get_builtin_knowledge",
|
|
4578
|
+
// plugin research runs → usage telemetry (TS-only, no bridge command)
|
|
4579
|
+
"report_plugin_research"
|
|
4419
4580
|
// Note: 'render_track_to_wav', 'render_tracks_to_wav', 'remove_mcp_meters' (measure_tracks cleanup), 'insert_stem_tracks'
|
|
4420
4581
|
// (the insertTracks option of separate_stems) and 'get_fx_state' / 'set_fx_state' / 'extension_call'
|
|
4421
4582
|
// (extension plumbing) are internal
|
|
@@ -5341,11 +5502,11 @@ function registerAestheticsTools(server) {
|
|
|
5341
5502
|
"analyze_track_aesthetics",
|
|
5342
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: node dist/apps/reaper-mcp-server/main.js setup-sidecar).",
|
|
5343
5504
|
{
|
|
5344
|
-
trackIndex:
|
|
5345
|
-
startTime:
|
|
5346
|
-
endTime:
|
|
5347
|
-
durationSeconds:
|
|
5348
|
-
normalizeLufs:
|
|
5505
|
+
trackIndex: z27.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master: the whole mix)"),
|
|
5506
|
+
startTime: z27.coerce.number().min(0).optional().describe("Start time in seconds (default: 0 or use REAPER time selection)"),
|
|
5507
|
+
endTime: z27.coerce.number().min(0).optional().describe("End time in seconds (default: startTime + durationSeconds)"),
|
|
5508
|
+
durationSeconds: z27.coerce.number().min(0.5).max(30).optional().default(DEFAULT_CLIP_SECONDS).describe("Duration to analyze in seconds (default and max 30 \u2014 shorter clips are noisier). Ignored if endTime is provided."),
|
|
5509
|
+
normalizeLufs: z27.union([z27.literal(false), z27.null(), z27.coerce.number().min(-60).max(0)]).optional().default(DEFAULT_SCORING_LUFS).describe("Scale the clip to this integrated loudness before scoring (default -18 LUFS); false or null scores it as rendered")
|
|
5349
5510
|
},
|
|
5350
5511
|
async (args) => {
|
|
5351
5512
|
const { trackIndex: trackIndex5, startTime, endTime, durationSeconds, normalizeLufs } = args;
|
|
@@ -5419,7 +5580,7 @@ function registerAestheticsTools(server) {
|
|
|
5419
5580
|
}
|
|
5420
5581
|
|
|
5421
5582
|
// apps/reaper-mcp-server/src/tools/offline.ts
|
|
5422
|
-
import { z as
|
|
5583
|
+
import { z as z28 } from "zod/v4";
|
|
5423
5584
|
import { basename } from "node:path";
|
|
5424
5585
|
var SIDECAR_NOT_INSTALLED_MSG2 = "Audio understanding sidecar not installed. Run: node dist/apps/reaper-mcp-server/main.js setup-sidecar";
|
|
5425
5586
|
var MAX_OFFLINE_SECONDS = 900;
|
|
@@ -5452,20 +5613,20 @@ function inProjectTime(result, offset) {
|
|
|
5452
5613
|
return result;
|
|
5453
5614
|
}
|
|
5454
5615
|
var referenceSchema = {
|
|
5455
|
-
referencePath:
|
|
5456
|
-
referenceStartTime:
|
|
5457
|
-
referenceEndTime:
|
|
5616
|
+
referencePath: z28.string().min(1).optional().describe("Absolute path of a reference audio file (WAV/FLAC/AIFF) to compare tonal balance and loudness against"),
|
|
5617
|
+
referenceStartTime: z28.coerce.number().min(0).optional().describe("Start of the reference excerpt in seconds (default 0)"),
|
|
5618
|
+
referenceEndTime: z28.coerce.number().min(0).optional().describe("End of the reference excerpt in seconds (default: end of file)")
|
|
5458
5619
|
};
|
|
5459
5620
|
function registerOfflineTools(server) {
|
|
5460
5621
|
server.tool(
|
|
5461
5622
|
"analyze_track_offline",
|
|
5462
5623
|
`Render a track (or the master, -1) once and analyze it offline \u2014 no playback needed, works on folder tracks. Returns integrated LUFS (BS.1770 gated), loudness range (LRA), true peak (dBTP), sample peak, crest factor, per-section loudness, band balance (sub..brilliance as share of energy), resonance hints (narrow peaks above the local spectrum) and sibilance hints (5-10 kHz spikes with times). With referencePath, also the loudness difference and tonal-balance difference (bands and third octaves, level offset removed) against that file. Use this for whole-song and mastering numbers (up to ${MAX_OFFLINE_SECONDS} s). Requires the Python sidecar.`,
|
|
5463
5624
|
{
|
|
5464
|
-
trackIndex:
|
|
5465
|
-
startTime:
|
|
5466
|
-
endTime:
|
|
5467
|
-
durationSeconds:
|
|
5468
|
-
sectionSeconds:
|
|
5625
|
+
trackIndex: z28.coerce.number().int().min(-1).describe("Zero-based track index (-1 = master: the whole mix)"),
|
|
5626
|
+
startTime: z28.coerce.number().min(0).optional().describe("Start in seconds (default 0)"),
|
|
5627
|
+
endTime: z28.coerce.number().min(0).optional().describe("End in seconds (default startTime + durationSeconds)"),
|
|
5628
|
+
durationSeconds: z28.coerce.number().min(1).max(MAX_OFFLINE_SECONDS).optional().default(DEFAULT_OFFLINE_SECONDS).describe(`Length in seconds when endTime is not given (default ${DEFAULT_OFFLINE_SECONDS}, max ${MAX_OFFLINE_SECONDS})`),
|
|
5629
|
+
sectionSeconds: z28.coerce.number().min(1).max(120).optional().describe("Also report loudness per consecutive section of this length (e.g. 10)"),
|
|
5469
5630
|
...referenceSchema
|
|
5470
5631
|
},
|
|
5471
5632
|
async (args) => {
|
|
@@ -5511,10 +5672,10 @@ function registerOfflineTools(server) {
|
|
|
5511
5672
|
"analyze_audio_file",
|
|
5512
5673
|
"Analyze an audio file on disk (a reference track, a bounce, a stem) the same way as analyze_track_offline: integrated LUFS, LRA, true peak, crest, per-section loudness, band balance, resonance and sibilance hints, and an optional comparison against another file. Does not touch REAPER. Requires the Python sidecar.",
|
|
5513
5674
|
{
|
|
5514
|
-
path:
|
|
5515
|
-
startTime:
|
|
5516
|
-
endTime:
|
|
5517
|
-
sectionSeconds:
|
|
5675
|
+
path: z28.string().min(1).describe("Absolute path of the audio file"),
|
|
5676
|
+
startTime: z28.coerce.number().min(0).optional().describe("Start in seconds (default 0)"),
|
|
5677
|
+
endTime: z28.coerce.number().min(0).optional().describe("End in seconds (default: end of file)"),
|
|
5678
|
+
sectionSeconds: z28.coerce.number().min(1).max(120).optional().describe("Also report loudness per consecutive section of this length"),
|
|
5518
5679
|
...referenceSchema
|
|
5519
5680
|
},
|
|
5520
5681
|
async (args) => {
|
|
@@ -5547,11 +5708,11 @@ function registerOfflineTools(server) {
|
|
|
5547
5708
|
"measure_track_alignment",
|
|
5548
5709
|
`Measure the time offset and polarity of one track against a reference track (e.g. snare bottom vs snare top, kick sub vs kick in, overheads vs snare) by rendering both over the same range and cross-correlating them. A positive delayMs means the track arrives later than the reference, as both play now (the current playback offset and polarity are included). To align it, set_track_property playOffsetMs = suggestedPlayOffsetMs and phase = suggestedPhase (1 = inverted) on that track \u2014 absolute values that already account for the current settings, so re-measuring an aligned track suggests what it already has. Renders are post-FX (plugin latency is compensated). Pick a range where both tracks play the same hits; below correlation ${MIN_ALIGNMENT_CORRELATION} no suggestion is made. Requires the Python sidecar.`,
|
|
5549
5710
|
{
|
|
5550
|
-
referenceTrack:
|
|
5551
|
-
trackIndex:
|
|
5552
|
-
startTime:
|
|
5553
|
-
durationSeconds:
|
|
5554
|
-
maxLagMs:
|
|
5711
|
+
referenceTrack: z28.coerce.number().int().min(0).describe("Zero-based index of the reference track"),
|
|
5712
|
+
trackIndex: z28.coerce.number().int().min(0).describe("Zero-based index of the track to measure"),
|
|
5713
|
+
startTime: z28.coerce.number().min(0).describe("Start of the range in seconds"),
|
|
5714
|
+
durationSeconds: z28.coerce.number().min(0.5).max(MAX_ALIGNMENT_SECONDS).optional().default(DEFAULT_ALIGNMENT_SECONDS).describe(`Length in seconds (default ${DEFAULT_ALIGNMENT_SECONDS}, max ${MAX_ALIGNMENT_SECONDS})`),
|
|
5715
|
+
maxLagMs: z28.coerce.number().min(0.1).max(100).optional().default(DEFAULT_MAX_LAG_MS).describe(`Largest offset to search either way in ms (default ${DEFAULT_MAX_LAG_MS}; room mics may need 30-50)`)
|
|
5555
5716
|
},
|
|
5556
5717
|
async (args) => {
|
|
5557
5718
|
const { referenceTrack, trackIndex: trackIndex5, startTime, durationSeconds, maxLagMs } = args;
|
|
@@ -5607,14 +5768,14 @@ function registerOfflineTools(server) {
|
|
|
5607
5768
|
"verify_edit",
|
|
5608
5769
|
`Check the result of an edit you just made, since you cannot hear it: compare the edited track with the audio from before the edit and get a verdict per check. Compensated null: the delay (ms, + = later), gain (dB) and polarity between the two are estimated and removed, and the residual left (dB below the reference) says whether anything else changed (noise, a splice, a different waveform, a swapped stereo channel; it is relative to referenceRmsDb, so with a quiet reference the rounding noise of a 16-bit bounce can set it). Discontinuity: the largest sample-to-sample jump on any channel against the reference's own, with where it happens and which channel (a click or hard splice). Use expect 'identical' (default) for edits that should leave the sound alone apart from level, delay and polarity (alignment, gain, split, crossfade): the residual is judged ok/warn/fail. Use "changed" for EQ, compression and the like: the residual is reported without a verdict. Set timeScale to the playback rate when the edit changed the timing (1.1 = the edit is 10% shorter): the waveform null is then skipped and the click check runs with three warn-only character checks against the reference warped through that rate: pitch drift in cents (skipped for unpitched material), tone (long-term spectrum distance in dB) and transients (smeared attacks). The reference is another track (e.g. a copy you kept) or an audio file of the same range from before the edit (a bounce), not an undo. Keep a reference track unmuted so it renders. The tone check misses a phase vocoder's smearing and the transient check is blind on drums. A passing result is evidence, not a replacement for listening. Requires the Python sidecar.`,
|
|
5609
5770
|
{
|
|
5610
|
-
trackIndex:
|
|
5611
|
-
referenceTrack:
|
|
5612
|
-
referencePath:
|
|
5613
|
-
startTime:
|
|
5614
|
-
durationSeconds:
|
|
5615
|
-
expect:
|
|
5616
|
-
timeScale:
|
|
5617
|
-
maxLagMs:
|
|
5771
|
+
trackIndex: z28.coerce.number().int().min(0).describe("Zero-based index of the edited track"),
|
|
5772
|
+
referenceTrack: z28.coerce.number().int().min(0).optional().describe("Zero-based index of a track holding the audio from before the edit (give this or referencePath)"),
|
|
5773
|
+
referencePath: z28.string().min(1).optional().describe("Absolute path of an audio file of the same range from before the edit (give this or referenceTrack)"),
|
|
5774
|
+
startTime: z28.coerce.number().min(0).describe("Start of the range in seconds"),
|
|
5775
|
+
durationSeconds: z28.coerce.number().min(0.5).max(MAX_VERIFY_SECONDS).optional().default(DEFAULT_VERIFY_SECONDS).describe(`Length in seconds (default ${DEFAULT_VERIFY_SECONDS}, max ${MAX_VERIFY_SECONDS})`),
|
|
5776
|
+
expect: z28.enum(["identical", "changed"]).optional().default("identical").describe('"identical": only level, delay and polarity may differ; "changed": report the residual without a verdict'),
|
|
5777
|
+
timeScale: z28.coerce.number().min(0.1).max(10).optional().default(1).describe("Playback rate: 1 = the edit kept the timing (default); 1.1 = the edit is 10% shorter. Any other value skips the waveform null and runs the pitch, tone and transient checks instead"),
|
|
5778
|
+
maxLagMs: z28.coerce.number().min(0.1).max(100).optional().default(DEFAULT_MAX_LAG_MS).describe(`Largest delay to search either way in ms (default ${DEFAULT_MAX_LAG_MS})`)
|
|
5618
5779
|
},
|
|
5619
5780
|
async (args) => {
|
|
5620
5781
|
const { trackIndex: trackIndex5, referenceTrack, referencePath, startTime, durationSeconds, expect, timeScale, maxLagMs } = args;
|
|
@@ -5665,7 +5826,7 @@ function registerOfflineTools(server) {
|
|
|
5665
5826
|
}
|
|
5666
5827
|
|
|
5667
5828
|
// apps/reaper-mcp-server/src/tools/transients.ts
|
|
5668
|
-
import { z as
|
|
5829
|
+
import { z as z29 } from "zod/v4";
|
|
5669
5830
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
5670
5831
|
var SIDECAR_NOT_INSTALLED_MSG3 = "Audio understanding sidecar not installed. Run: node dist/apps/reaper-mcp-server/main.js setup-sidecar";
|
|
5671
5832
|
var DEFAULT_TRACK_SECONDS = 60;
|
|
@@ -5725,16 +5886,16 @@ function sections(hits, start, end, seconds2) {
|
|
|
5725
5886
|
return out2;
|
|
5726
5887
|
}
|
|
5727
5888
|
var sourceSchema = {
|
|
5728
|
-
trackIndex:
|
|
5729
|
-
path:
|
|
5730
|
-
filePosition:
|
|
5731
|
-
startTime:
|
|
5732
|
-
endTime:
|
|
5733
|
-
band:
|
|
5734
|
-
sensitivity:
|
|
5735
|
-
minGapMs:
|
|
5736
|
-
minStrength:
|
|
5737
|
-
bands:
|
|
5889
|
+
trackIndex: z29.coerce.number().int().min(-1).optional().describe("Track to analyze, rendered post-FX (-1 = master). Give this or path"),
|
|
5890
|
+
path: z29.string().min(1).optional().describe("Absolute path of an audio file (WAV/FLAC/AIFF/MP3/OGG) to analyze instead of a track. Read as-is: an item's stretch markers, play rate and start offset are NOT applied, so for a warped or stretched item use trackIndex (renders what REAPER plays)"),
|
|
5891
|
+
filePosition: z29.coerce.number().min(0).optional().describe("With path: project time (seconds) where the file starts, e.g. its item position (default 0), so times come back in project time"),
|
|
5892
|
+
startTime: z29.coerce.number().min(0).optional().describe("Start of the range in project seconds (default 0, or filePosition for a file)"),
|
|
5893
|
+
endTime: z29.coerce.number().min(0).optional().describe(`End of the range in project seconds (track default: start + ${DEFAULT_TRACK_SECONDS} s; file default: end of file)`),
|
|
5894
|
+
band: z29.enum(["full", "low", "mid", "high"]).optional().default("full").describe("Band to find hits in: full (all, default), low (<150 Hz: kick, bass), mid (150 Hz-4 kHz: snare, vocals, keys), high (>4 kHz: hats, cymbals)"),
|
|
5895
|
+
sensitivity: z29.coerce.number().min(0).max(1).optional().default(0.5).describe("0..1 (default 0.5): higher finds softer hits, lower keeps only the big ones"),
|
|
5896
|
+
minGapMs: z29.coerce.number().min(5).max(2e3).optional().default(50).describe("Closest two hits may be, in ms (default 50); raise it (e.g. 250) for fewer, beat-level hits"),
|
|
5897
|
+
minStrength: z29.coerce.number().min(0).max(1).optional().default(0).describe("Drop hits weaker than this (0..1 relative to the loudest hits; e.g. 0.6 keeps the accents)"),
|
|
5898
|
+
bands: z29.array(z29.enum(["low", "mid", "high"])).optional().describe('Keep only hits whose dominant band is one of these (e.g. ["low"] for kick-driven flashes)')
|
|
5738
5899
|
};
|
|
5739
5900
|
async function detect(args) {
|
|
5740
5901
|
const sidecar = getSidecarClient();
|
|
@@ -5805,9 +5966,9 @@ function registerTransientTools(server) {
|
|
|
5805
5966
|
"Find the transients (hits/onsets) in a track (rendered post-FX, -1 = master) or an audio file on disk: each hit's time in project seconds, strength (0..1, relative to the loudest hits), dominant band (low = kick/bass, mid = snare/vocals/keys, high = hats/cymbals) and peakDb, plus a tempo estimate, hit counts per band and, with sectionSeconds, how busy each part is. Hits are paginated (offset/limit). Use it to sync lighting, video cuts, markers or MIDI to a song; create_transient_automation writes the hits as envelope pulses directly. A file is read as-is (no stretch markers or play rate): for an item warped to the grid, pass its track instead. Requires the Python sidecar.",
|
|
5806
5967
|
{
|
|
5807
5968
|
...sourceSchema,
|
|
5808
|
-
sectionSeconds:
|
|
5809
|
-
offset:
|
|
5810
|
-
limit:
|
|
5969
|
+
sectionSeconds: z29.coerce.number().min(1).max(120).optional().describe("Also report hit count and mean strength per section of this length (e.g. 8)"),
|
|
5970
|
+
offset: z29.coerce.number().int().min(0).optional().default(0).describe("First hit to return (default 0)"),
|
|
5971
|
+
limit: z29.coerce.number().int().min(0).max(2e3).optional().default(DEFAULT_LIMIT).describe(`Most hits to return (default ${DEFAULT_LIMIT}; 0 = summary only)`)
|
|
5811
5972
|
},
|
|
5812
5973
|
async (args) => {
|
|
5813
5974
|
const startedAt = Date.now();
|
|
@@ -5847,17 +6008,17 @@ function registerTransientTools(server) {
|
|
|
5847
6008
|
`Detect the transients of a track or audio file (same options as detect_transients) and write one pulse per hit onto an existing envelope of a target track \u2014 e.g. a lighting/DMX plugin parameter that should flash on every kick. Each pulse rises from baseValue to the hit level (peakValue, scaled by strength unless scaleByStrength is false) over attackMs, holds holdMs, and falls back over decayMs; a hit before the previous pulse has ended cuts it short. Values are raw envelope values (FX parameters 0..1, Pan -1..1). Create the envelope first with create_track_envelope (it returns envelopeIndex). By default the envelope's points in the range are replaced (replaceExisting). dryRun returns the points without writing. Use bands/minStrength/minGapMs to choose what the lights follow (e.g. bands ["low"], minStrength 0.6 for the kick accents). Requires the Python sidecar.`,
|
|
5848
6009
|
{
|
|
5849
6010
|
...sourceSchema,
|
|
5850
|
-
targetTrack:
|
|
5851
|
-
envelopeIndex:
|
|
5852
|
-
baseValue:
|
|
5853
|
-
peakValue:
|
|
5854
|
-
scaleByStrength:
|
|
5855
|
-
attackMs:
|
|
5856
|
-
holdMs:
|
|
5857
|
-
decayMs:
|
|
5858
|
-
decayCurve:
|
|
5859
|
-
replaceExisting:
|
|
5860
|
-
dryRun:
|
|
6011
|
+
targetTrack: z29.coerce.number().int().min(-1).describe("Track that holds the envelope to write (-1 = master)"),
|
|
6012
|
+
envelopeIndex: z29.coerce.number().int().min(0).describe("Envelope on targetTrack (from create_track_envelope / get_track_envelopes)"),
|
|
6013
|
+
baseValue: z29.coerce.number().optional().default(0).describe("Value between hits (default 0)"),
|
|
6014
|
+
peakValue: z29.coerce.number().optional().default(1).describe("Value of the strongest hit (default 1)"),
|
|
6015
|
+
scaleByStrength: z29.boolean().optional().default(true).describe("Scale each pulse by the hit's strength (default true); false = every pulse reaches peakValue"),
|
|
6016
|
+
attackMs: z29.coerce.number().min(0).max(2e3).optional().default(0).describe("Rise time before each hit in ms (default 0 = instant)"),
|
|
6017
|
+
holdMs: z29.coerce.number().min(0).max(5e3).optional().default(30).describe("Time at the hit level in ms (default 30)"),
|
|
6018
|
+
decayMs: z29.coerce.number().min(0).max(1e4).optional().default(200).describe("Fall time back to baseValue in ms (default 200; 0 = cut off)"),
|
|
6019
|
+
decayCurve: z29.enum(["linear", "exponential"]).optional().default("exponential").describe("Shape of the fall: exponential (fast then slow, like a flash fading; default) or linear"),
|
|
6020
|
+
replaceExisting: z29.boolean().optional().default(true).describe("Delete the envelope's points in the range (plus the last pulse's tail) before writing (default true)"),
|
|
6021
|
+
dryRun: z29.boolean().optional().default(false).describe("Return the points without writing them")
|
|
5861
6022
|
},
|
|
5862
6023
|
async (args) => {
|
|
5863
6024
|
const startedAt = Date.now();
|
|
@@ -5959,10 +6120,10 @@ function registerTransientTools(server) {
|
|
|
5959
6120
|
}
|
|
5960
6121
|
|
|
5961
6122
|
// apps/reaper-mcp-server/src/tools/mixcheck.ts
|
|
5962
|
-
import { z as
|
|
6123
|
+
import { z as z30 } from "zod/v4";
|
|
5963
6124
|
import { homedir as homedir6 } from "node:os";
|
|
5964
6125
|
import { basename as basename2, extname, join as join7 } from "node:path";
|
|
5965
|
-
import { trace as
|
|
6126
|
+
import { trace as trace5 } from "@opentelemetry/api";
|
|
5966
6127
|
var SIDECAR_NOT_INSTALLED_MSG4 = "Audio understanding sidecar not installed. Run: node dist/apps/reaper-mcp-server/main.js setup-sidecar";
|
|
5967
6128
|
var DEFAULT_TRACK_SECONDS2 = 180;
|
|
5968
6129
|
var SEPARATION_TRACK_SECONDS = 60;
|
|
@@ -5976,10 +6137,10 @@ var error3 = (message) => ({ content: [{ type: "text", text: message }], isError
|
|
|
5976
6137
|
var messageOf = (err) => err instanceof Error ? err.message : String(err);
|
|
5977
6138
|
var round12 = (x) => Math.round(x * 10) / 10;
|
|
5978
6139
|
var sourceSchema2 = {
|
|
5979
|
-
trackIndex:
|
|
5980
|
-
path:
|
|
5981
|
-
startTime:
|
|
5982
|
-
endTime:
|
|
6140
|
+
trackIndex: z30.coerce.number().int().min(-1).optional().describe("Track to analyze, rendered post-FX (-1 = master: the whole mix). Give this or path"),
|
|
6141
|
+
path: z30.string().min(1).optional().describe("Absolute path of an audio file (WAV/FLAC/AIFF/MP3/OGG) instead of a track, e.g. a reference song"),
|
|
6142
|
+
startTime: z30.coerce.number().min(0).optional().describe("Start in seconds (default 0)"),
|
|
6143
|
+
endTime: z30.coerce.number().min(0).optional().describe(`End in seconds (track default: startTime + ${DEFAULT_TRACK_SECONDS2}; file default: its end)`)
|
|
5983
6144
|
};
|
|
5984
6145
|
async function resolveSource(args, maxSeconds, defaultSeconds = DEFAULT_TRACK_SECONDS2) {
|
|
5985
6146
|
const { trackIndex: trackIndex5, path, startTime, endTime } = args;
|
|
@@ -6029,8 +6190,8 @@ function registerMixcheckTools(server) {
|
|
|
6029
6190
|
"Loudness over time of a track (or the master, -1) or an audio file: short-term (3 s) and momentary (400 ms) LUFS as curves (at most 240 points each, every point the loudest moment of its slice), integrated LUFS, true peak, LRA, PLR (true peak minus integrated), the loudest and quietest 3 s windows, and with targetLufs the spans whose short-term loudness goes over target + toleranceLu. Use it to see where a master gets too loud or a section drops away, before and after a change. Rendered once, no playback. Requires the Python sidecar.",
|
|
6030
6191
|
{
|
|
6031
6192
|
...sourceSchema2,
|
|
6032
|
-
targetLufs:
|
|
6033
|
-
toleranceLu:
|
|
6193
|
+
targetLufs: z30.coerce.number().min(-40).max(0).optional().describe("Report the spans whose short-term loudness is above this (e.g. -14 for streaming)"),
|
|
6194
|
+
toleranceLu: z30.coerce.number().min(0).max(6).optional().default(1).describe("LU above targetLufs before a span counts (default 1)")
|
|
6034
6195
|
},
|
|
6035
6196
|
async (args) => {
|
|
6036
6197
|
const startedAt = Date.now();
|
|
@@ -6058,7 +6219,7 @@ function registerMixcheckTools(server) {
|
|
|
6058
6219
|
startTime: src.offset + Number(result["startTime"] ?? 0)
|
|
6059
6220
|
};
|
|
6060
6221
|
if (args.targetLufs != null) data["targetLufs"] = args.targetLufs;
|
|
6061
|
-
|
|
6222
|
+
trace5.getActiveSpan()?.setAttribute("reaper.loudness.over_target_seconds", Number(result["overTargetSeconds"] ?? 0));
|
|
6062
6223
|
logToolResult("analyze_loudness_curve", args, startedAt, curveSummary(src.name, data));
|
|
6063
6224
|
return text3(data);
|
|
6064
6225
|
} catch (err) {
|
|
@@ -6092,7 +6253,7 @@ function registerMixcheckTools(server) {
|
|
|
6092
6253
|
startTime: src.offset + Number(result["startTime"] ?? 0)
|
|
6093
6254
|
};
|
|
6094
6255
|
const flags = result["flags"] ?? [];
|
|
6095
|
-
|
|
6256
|
+
trace5.getActiveSpan()?.setAttribute("reaper.stereo.flag_count", flags.length);
|
|
6096
6257
|
logToolResult("analyze_stereo_bands", args, startedAt, stereoBandsSummary(src.name, data));
|
|
6097
6258
|
return text3(data);
|
|
6098
6259
|
} catch (err) {
|
|
@@ -6107,9 +6268,9 @@ function registerMixcheckTools(server) {
|
|
|
6107
6268
|
"measure_masking",
|
|
6108
6269
|
`Find where 2-8 tracks compete for the same frequencies: renders each track over the same range (post-FX) and compares their K-weighted third-octave levels (40 Hz-16 kHz). A band scores high when both tracks are loud there and within a few dB of each other. Returns every pair's overall score with its worst bands, and the top conflicts (score >= 0.2) with a suggestion: which track to cut around which frequency (the one the band matters less to). Pick a section where they all play (max ${MAX_MASKING_SECONDS} s). Requires the Python sidecar.`,
|
|
6109
6270
|
{
|
|
6110
|
-
tracks:
|
|
6111
|
-
startTime:
|
|
6112
|
-
durationSeconds:
|
|
6271
|
+
tracks: z30.array(z30.coerce.number().int().min(0)).min(2).max(MAX_MASKING_TRACKS).describe(`Zero-based indexes of 2-${MAX_MASKING_TRACKS} tracks to compare (e.g. kick, bass, keys)`),
|
|
6272
|
+
startTime: z30.coerce.number().min(0).describe("Start of the range in seconds"),
|
|
6273
|
+
durationSeconds: z30.coerce.number().min(1).max(MAX_MASKING_SECONDS).optional().default(DEFAULT_MASKING_SECONDS).describe(`Length in seconds (default ${DEFAULT_MASKING_SECONDS}, max ${MAX_MASKING_SECONDS})`)
|
|
6113
6274
|
},
|
|
6114
6275
|
async (args) => {
|
|
6115
6276
|
const { tracks: tracks2, startTime, durationSeconds } = args;
|
|
@@ -6139,7 +6300,7 @@ function registerMixcheckTools(server) {
|
|
|
6139
6300
|
conflicts,
|
|
6140
6301
|
...conflicts.length === 0 ? { note: "No band where two of these tracks are both loud and within a few dB: nothing masks." } : {}
|
|
6141
6302
|
};
|
|
6142
|
-
const span =
|
|
6303
|
+
const span = trace5.getActiveSpan();
|
|
6143
6304
|
span?.setAttribute("reaper.masking.track_count", tracks2.length);
|
|
6144
6305
|
span?.setAttribute("reaper.masking.conflict_count", conflicts.length);
|
|
6145
6306
|
logToolResult("measure_masking", args, startedAt, maskingSummary(result));
|
|
@@ -6157,12 +6318,12 @@ function registerMixcheckTools(server) {
|
|
|
6157
6318
|
`Split a track (rendered post-FX, -1 = master) or an audio file into stems with Demucs: htdemucs gives drums, bass, other, vocals; htdemucs_6s adds guitar and piano. Writes one 32-bit float WAV per stem to outDir (default: a new folder under the project's Stems folder) and returns each stem's path, LUFS and peak. With insertTracks, adds them as tracks under a new folder in one undo point, lined up with the source (a track: after it, at startTime; a file: at filePosition + startTime); the folder starts muted, since the stems sum back to the source. Slow: about real time on a CPU, several times faster on Apple silicon or CUDA (max ${MAX_SEPARATION_SECONDS} s per call). Needs \`reaper-mcp setup-sidecar --with-separation\` (which downloads htdemucs; the first htdemucs_6s call downloads its ~80 MB weights).`,
|
|
6158
6319
|
{
|
|
6159
6320
|
...sourceSchema2,
|
|
6160
|
-
endTime:
|
|
6161
|
-
model:
|
|
6162
|
-
stems:
|
|
6163
|
-
outDir:
|
|
6164
|
-
insertTracks:
|
|
6165
|
-
filePosition:
|
|
6321
|
+
endTime: z30.coerce.number().min(0).optional().describe(`End in seconds (track default: startTime + ${SEPARATION_TRACK_SECONDS}; file default: its end)`),
|
|
6322
|
+
model: z30.enum(["htdemucs", "htdemucs_6s"]).optional().default("htdemucs").describe("htdemucs (4 stems, default) or htdemucs_6s (adds guitar and piano)"),
|
|
6323
|
+
stems: z30.array(z30.enum(["drums", "bass", "other", "vocals", "guitar", "piano"])).min(1).optional().describe("Write only these stems (default: all the model gives)"),
|
|
6324
|
+
outDir: z30.string().min(1).optional().describe("Absolute folder for the stem WAVs (created if missing)"),
|
|
6325
|
+
insertTracks: z30.boolean().optional().default(false).describe("Insert the stems as tracks under a new folder track (muted)"),
|
|
6326
|
+
filePosition: z30.coerce.number().min(0).optional().describe("With path and insertTracks: project time where the file starts (default 0)")
|
|
6166
6327
|
},
|
|
6167
6328
|
async (args) => {
|
|
6168
6329
|
const startedAt = Date.now();
|
|
@@ -6204,7 +6365,7 @@ function registerMixcheckTools(server) {
|
|
|
6204
6365
|
"reaper.separation.device": "cpu_fallback"
|
|
6205
6366
|
});
|
|
6206
6367
|
}
|
|
6207
|
-
const span =
|
|
6368
|
+
const span = trace5.getActiveSpan();
|
|
6208
6369
|
span?.setAttribute("reaper.separation.stem_count", stems.length);
|
|
6209
6370
|
span?.setAttribute("reaper.separation.device", String(result["device"] ?? "unknown"));
|
|
6210
6371
|
let inserted;
|
|
@@ -6239,8 +6400,8 @@ function registerMixcheckTools(server) {
|
|
|
6239
6400
|
}
|
|
6240
6401
|
|
|
6241
6402
|
// apps/reaper-mcp-server/src/tools/mixing.ts
|
|
6242
|
-
import { z as
|
|
6243
|
-
import { trace as
|
|
6403
|
+
import { z as z31 } from "zod/v4";
|
|
6404
|
+
import { trace as trace6 } from "@opentelemetry/api";
|
|
6244
6405
|
var SIDECAR_NOT_INSTALLED_MSG5 = "Audio understanding sidecar not installed. Run: node dist/apps/reaper-mcp-server/main.js setup-sidecar";
|
|
6245
6406
|
var MAX_QUANTIZE_SECONDS = 900;
|
|
6246
6407
|
var error4 = (text7) => ({ content: [{ type: "text", text: `Error: ${text7}` }], isError: true });
|
|
@@ -6255,16 +6416,16 @@ function flatten(args, keys) {
|
|
|
6255
6416
|
for (const k of keys) if (out2[k] !== void 0) out2[k] = JSON.stringify(out2[k]);
|
|
6256
6417
|
return out2;
|
|
6257
6418
|
}
|
|
6258
|
-
var trackIndex4 =
|
|
6259
|
-
var fxIndex2 =
|
|
6260
|
-
var tracks =
|
|
6261
|
-
var renderMode =
|
|
6262
|
-
var automationMode =
|
|
6263
|
-
var fxParams =
|
|
6264
|
-
paramIndex:
|
|
6265
|
-
value:
|
|
6419
|
+
var trackIndex4 = z31.coerce.number().int().min(-1).describe("0-based track index (-1 = master)");
|
|
6420
|
+
var fxIndex2 = z31.coerce.number().int().min(0).describe("0-based FX index in the track's chain");
|
|
6421
|
+
var tracks = z31.array(trackRef).min(1).max(64);
|
|
6422
|
+
var renderMode = z31.enum(["stereo", "mono", "multichannel"]).optional().default("stereo");
|
|
6423
|
+
var automationMode = z31.enum(["trim", "read", "touch", "write", "latch", "latch_preview"]);
|
|
6424
|
+
var fxParams = z31.array(z31.object({
|
|
6425
|
+
paramIndex: z31.coerce.number().int().min(0),
|
|
6426
|
+
value: z31.coerce.number().min(0).max(1).describe("Normalized 0..1")
|
|
6266
6427
|
})).optional().describe("Parameters to set, normalized 0..1");
|
|
6267
|
-
var direction =
|
|
6428
|
+
var direction = z31.coerce.number().int().min(-1).max(1).optional().describe("-1 moves the value down from the baseline, 0 around it, 1 up (default)");
|
|
6268
6429
|
function registerMixingTools(server) {
|
|
6269
6430
|
server.tool(
|
|
6270
6431
|
"set_automation_mode",
|
|
@@ -6272,14 +6433,14 @@ function registerMixingTools(server) {
|
|
|
6272
6433
|
{
|
|
6273
6434
|
tracks: tracks.optional().describe("Tracks to set (needs mode)"),
|
|
6274
6435
|
mode: automationMode.optional(),
|
|
6275
|
-
globalOverride:
|
|
6436
|
+
globalOverride: z31.enum(["none", "bypass", "trim", "read", "touch", "write", "latch", "latch_preview"]).optional().describe("Override every track's mode at once; not saved in the project")
|
|
6276
6437
|
},
|
|
6277
6438
|
async (args) => run3("set_automation_mode", flatten(args, ["tracks"]))
|
|
6278
6439
|
);
|
|
6279
6440
|
server.tool(
|
|
6280
6441
|
"get_fx_param_modulation",
|
|
6281
6442
|
"Read FX parameter modulation (REAPER 6.37+): LFO, audio control signal (sidechain follower) and parameter link, with the baseline. Without paramIndex, lists only the modulated parameters of the FX.",
|
|
6282
|
-
{ trackIndex: trackIndex4, fxIndex: fxIndex2, paramIndex:
|
|
6443
|
+
{ trackIndex: trackIndex4, fxIndex: fxIndex2, paramIndex: z31.coerce.number().int().min(0).optional() },
|
|
6283
6444
|
async (args) => run3("get_fx_param_modulation", args)
|
|
6284
6445
|
);
|
|
6285
6446
|
server.tool(
|
|
@@ -6288,41 +6449,41 @@ function registerMixingTools(server) {
|
|
|
6288
6449
|
{
|
|
6289
6450
|
trackIndex: trackIndex4,
|
|
6290
6451
|
fxIndex: fxIndex2,
|
|
6291
|
-
paramIndex:
|
|
6292
|
-
enabled:
|
|
6293
|
-
baseline:
|
|
6294
|
-
lfo:
|
|
6295
|
-
enabled:
|
|
6296
|
-
shape:
|
|
6297
|
-
speed:
|
|
6298
|
-
strength:
|
|
6299
|
-
phase:
|
|
6300
|
-
tempoSync:
|
|
6452
|
+
paramIndex: z31.coerce.number().int().min(0),
|
|
6453
|
+
enabled: z31.boolean().optional().describe("false turns off all modulation of this parameter"),
|
|
6454
|
+
baseline: z31.coerce.number().min(0).max(1).optional().describe("0..1, the value the modulation moves around"),
|
|
6455
|
+
lfo: z31.object({
|
|
6456
|
+
enabled: z31.boolean().optional(),
|
|
6457
|
+
shape: z31.enum(["sine", "square", "saw_down", "saw_up", "triangle", "random"]).optional(),
|
|
6458
|
+
speed: z31.coerce.number().positive().max(64).optional().describe("Hz, or quarter notes per cycle with tempoSync"),
|
|
6459
|
+
strength: z31.coerce.number().min(0).max(1).optional(),
|
|
6460
|
+
phase: z31.coerce.number().min(0).max(1).optional(),
|
|
6461
|
+
tempoSync: z31.boolean().optional(),
|
|
6301
6462
|
direction
|
|
6302
6463
|
}).optional(),
|
|
6303
|
-
audio:
|
|
6304
|
-
enabled:
|
|
6305
|
-
attackMs:
|
|
6306
|
-
releaseMs:
|
|
6307
|
-
minDb:
|
|
6308
|
-
maxDb:
|
|
6309
|
-
strength:
|
|
6310
|
-
channel:
|
|
6464
|
+
audio: z31.object({
|
|
6465
|
+
enabled: z31.boolean().optional(),
|
|
6466
|
+
attackMs: z31.coerce.number().min(0).max(1e3).optional(),
|
|
6467
|
+
releaseMs: z31.coerce.number().min(0).max(1e3).optional(),
|
|
6468
|
+
minDb: z31.coerce.number().min(-60).max(12).optional().describe("Level that maps to no modulation"),
|
|
6469
|
+
maxDb: z31.coerce.number().min(-60).max(12).optional().describe("Level that maps to full modulation"),
|
|
6470
|
+
strength: z31.coerce.number().min(0).max(1).optional(),
|
|
6471
|
+
channel: z31.coerce.number().int().min(1).max(64).optional().describe("Track channel to follow, 1-based (3 = a sidechain on 3/4)"),
|
|
6311
6472
|
direction
|
|
6312
6473
|
}).optional().describe("Audio control signal: the parameter follows a channel's level"),
|
|
6313
|
-
link:
|
|
6314
|
-
enabled:
|
|
6315
|
-
fxIndex:
|
|
6316
|
-
paramIndex:
|
|
6317
|
-
scale:
|
|
6318
|
-
offset:
|
|
6474
|
+
link: z31.object({
|
|
6475
|
+
enabled: z31.boolean().optional(),
|
|
6476
|
+
fxIndex: z31.coerce.number().int().min(0).optional().describe("Source FX; required unless enabled is false"),
|
|
6477
|
+
paramIndex: z31.coerce.number().int().min(0).optional().describe("Source parameter; required unless enabled is false"),
|
|
6478
|
+
scale: z31.coerce.number().min(-10).max(10).optional(),
|
|
6479
|
+
offset: z31.coerce.number().min(-1).max(1).optional()
|
|
6319
6480
|
}).optional().describe("Follow another FX parameter on this track")
|
|
6320
6481
|
},
|
|
6321
6482
|
async (args) => {
|
|
6322
6483
|
const res = await run3("set_fx_param_modulation", flatten(args, ["lfo", "audio", "link"]));
|
|
6323
6484
|
if (!res.isError) {
|
|
6324
6485
|
const kinds = ["lfo", "audio", "link"].filter((k) => args[k] !== void 0);
|
|
6325
|
-
|
|
6486
|
+
trace6.getActiveSpan()?.setAttribute("reaper.fx.modulation.kind", args.enabled === false ? "off" : kinds.join(",") || "baseline");
|
|
6326
6487
|
}
|
|
6327
6488
|
return res;
|
|
6328
6489
|
}
|
|
@@ -6339,19 +6500,19 @@ function registerMixingTools(server) {
|
|
|
6339
6500
|
{
|
|
6340
6501
|
trackIndex: trackIndex4,
|
|
6341
6502
|
fxIndex: fxIndex2,
|
|
6342
|
-
inputs:
|
|
6343
|
-
|
|
6344
|
-
|
|
6503
|
+
inputs: z31.array(z31.union([
|
|
6504
|
+
z31.array(z31.coerce.number().int().min(1).max(64)),
|
|
6505
|
+
z31.object({ pin: z31.coerce.number().int().min(0), channels: z31.array(z31.coerce.number().int().min(1).max(64)) })
|
|
6345
6506
|
])).optional(),
|
|
6346
|
-
outputs:
|
|
6347
|
-
|
|
6348
|
-
|
|
6507
|
+
outputs: z31.array(z31.union([
|
|
6508
|
+
z31.array(z31.coerce.number().int().min(1).max(64)),
|
|
6509
|
+
z31.object({ pin: z31.coerce.number().int().min(0), channels: z31.array(z31.coerce.number().int().min(1).max(64)) })
|
|
6349
6510
|
])).optional(),
|
|
6350
|
-
trackChannels:
|
|
6511
|
+
trackChannels: z31.coerce.number().int().min(2).max(128).optional().describe("Even channel count for the track")
|
|
6351
6512
|
},
|
|
6352
6513
|
async (args) => {
|
|
6353
6514
|
const res = await run3("set_fx_pins", flatten(args, ["inputs", "outputs"]));
|
|
6354
|
-
if (res.data)
|
|
6515
|
+
if (res.data) trace6.getActiveSpan()?.setAttribute("reaper.fx.pins.widened", res.data["trackChannelsBefore"] !== void 0);
|
|
6355
6516
|
return res;
|
|
6356
6517
|
}
|
|
6357
6518
|
);
|
|
@@ -6364,16 +6525,16 @@ function registerMixingTools(server) {
|
|
|
6364
6525
|
server.tool(
|
|
6365
6526
|
"add_monitoring_fx",
|
|
6366
6527
|
"Add an FX to the monitoring chain (heard in the monitors, never rendered), with optional normalized parameters.",
|
|
6367
|
-
{ fxName:
|
|
6528
|
+
{ fxName: z31.string().min(1).describe('FX name as add_fx takes it, e.g. "ReaEQ" or "VST3: SoundID Reference"'), params: fxParams },
|
|
6368
6529
|
async (args) => run3("add_monitoring_fx", flatten(args, ["params"]))
|
|
6369
6530
|
);
|
|
6370
6531
|
server.tool(
|
|
6371
6532
|
"set_monitoring_fx",
|
|
6372
6533
|
"Bypass, set offline, or set normalized parameters of a monitoring FX by index (from list_monitoring_fx).",
|
|
6373
6534
|
{
|
|
6374
|
-
fxIndex:
|
|
6375
|
-
enabled:
|
|
6376
|
-
offline:
|
|
6535
|
+
fxIndex: z31.coerce.number().int().min(0),
|
|
6536
|
+
enabled: z31.boolean().optional(),
|
|
6537
|
+
offline: z31.boolean().optional(),
|
|
6377
6538
|
params: fxParams
|
|
6378
6539
|
},
|
|
6379
6540
|
async (args) => run3("set_monitoring_fx", flatten(args, ["params"]))
|
|
@@ -6381,7 +6542,7 @@ function registerMixingTools(server) {
|
|
|
6381
6542
|
server.tool(
|
|
6382
6543
|
"remove_monitoring_fx",
|
|
6383
6544
|
"Remove a monitoring FX by index (from list_monitoring_fx).",
|
|
6384
|
-
{ fxIndex:
|
|
6545
|
+
{ fxIndex: z31.coerce.number().int().min(0) },
|
|
6385
6546
|
async (args) => run3("remove_monitoring_fx", args)
|
|
6386
6547
|
);
|
|
6387
6548
|
server.tool(
|
|
@@ -6390,7 +6551,7 @@ function registerMixingTools(server) {
|
|
|
6390
6551
|
{ tracks, mode: renderMode },
|
|
6391
6552
|
async (args) => {
|
|
6392
6553
|
const res = await run3("freeze_tracks", flatten(args, ["tracks"]), 3e5);
|
|
6393
|
-
const span =
|
|
6554
|
+
const span = trace6.getActiveSpan();
|
|
6394
6555
|
span?.setAttribute("reaper.freeze.mode", args.mode);
|
|
6395
6556
|
span?.setAttribute("reaper.freeze.track_count", args.tracks.length);
|
|
6396
6557
|
return res;
|
|
@@ -6406,7 +6567,7 @@ function registerMixingTools(server) {
|
|
|
6406
6567
|
"apply_fx_to_items",
|
|
6407
6568
|
"Render in place: apply the track and take FX to items as a new active take (stereo, mono or multichannel). The old take stays, so the render can be switched back with set_active_take. Blocks REAPER while it renders. The item selection is put back.",
|
|
6408
6569
|
{
|
|
6409
|
-
items:
|
|
6570
|
+
items: z31.array(z31.object({ trackIndex: z31.coerce.number().int().min(0), itemIndex: z31.coerce.number().int().min(0) })).min(1).max(64),
|
|
6410
6571
|
mode: renderMode
|
|
6411
6572
|
},
|
|
6412
6573
|
async (args) => run3("apply_fx_to_items", flatten(args, ["items"]), 3e5)
|
|
@@ -6415,11 +6576,11 @@ function registerMixingTools(server) {
|
|
|
6415
6576
|
"add_stretch_markers",
|
|
6416
6577
|
"Add many stretch markers to an audio item in one call and one undo point. position is seconds from the item start; sourcePosition (seconds in the source) pins the audio at that spot to the new position, which stretches the audio around it.",
|
|
6417
6578
|
{
|
|
6418
|
-
trackIndex:
|
|
6419
|
-
itemIndex:
|
|
6420
|
-
markers:
|
|
6421
|
-
position:
|
|
6422
|
-
sourcePosition:
|
|
6579
|
+
trackIndex: z31.coerce.number().int().min(0),
|
|
6580
|
+
itemIndex: z31.coerce.number().int().min(0),
|
|
6581
|
+
markers: z31.array(z31.object({
|
|
6582
|
+
position: z31.coerce.number().min(0),
|
|
6583
|
+
sourcePosition: z31.coerce.number().optional()
|
|
6423
6584
|
})).min(1).max(2e3)
|
|
6424
6585
|
},
|
|
6425
6586
|
async (args) => run3("add_stretch_markers", flatten(args, ["markers"]))
|
|
@@ -6428,13 +6589,13 @@ function registerMixingTools(server) {
|
|
|
6428
6589
|
"edit_stretch_markers",
|
|
6429
6590
|
"Edit existing stretch markers of an audio item in one call and one undo point: move a marker (position, seconds from the item start), change which source time it pins (sourcePosition) and its slope (-1..1, the curve of the stretch after it). Markers are named by index, in position order. position is in item seconds, as this tool and add_stretch_markers report them; get_stretch_markers lists raw take positions, which equal item seconds only at play rate 1 (divide by the play rate otherwise). Only the fields given change. Every edit is checked first: a marker moved out of order (position or source), onto another marker, outside the item, or a repeated index refuses the whole call and changes nothing.",
|
|
6430
6591
|
{
|
|
6431
|
-
trackIndex:
|
|
6432
|
-
itemIndex:
|
|
6433
|
-
edits:
|
|
6434
|
-
index:
|
|
6435
|
-
position:
|
|
6436
|
-
sourcePosition:
|
|
6437
|
-
slope:
|
|
6592
|
+
trackIndex: z31.coerce.number().int().min(0),
|
|
6593
|
+
itemIndex: z31.coerce.number().int().min(0),
|
|
6594
|
+
edits: z31.array(z31.object({
|
|
6595
|
+
index: z31.coerce.number().int().min(0),
|
|
6596
|
+
position: z31.coerce.number().min(0).optional(),
|
|
6597
|
+
sourcePosition: z31.coerce.number().optional(),
|
|
6598
|
+
slope: z31.coerce.number().min(-1).max(1).optional()
|
|
6438
6599
|
})).min(1).max(2e3)
|
|
6439
6600
|
},
|
|
6440
6601
|
async (args) => run3("edit_stretch_markers", flatten(args, ["edits"]))
|
|
@@ -6443,15 +6604,15 @@ function registerMixingTools(server) {
|
|
|
6443
6604
|
"quantize_audio",
|
|
6444
6605
|
"Quantize an audio item to the grid with stretch markers: finds the hits in the item's source (sidecar), puts a marker on each and moves it toward the nearest grid line (strength, window and swing as quantize_midi). The item keeps its length (anchors at both ends); the item's existing stretch markers are replaced. Returns the timing offset before and after (avg/max ms). Requires the sidecar.",
|
|
6445
6606
|
{
|
|
6446
|
-
trackIndex:
|
|
6447
|
-
itemIndex:
|
|
6448
|
-
grid:
|
|
6449
|
-
strength:
|
|
6450
|
-
window:
|
|
6451
|
-
swing:
|
|
6452
|
-
sensitivity:
|
|
6453
|
-
minGapMs:
|
|
6454
|
-
minStrength:
|
|
6607
|
+
trackIndex: z31.coerce.number().int().min(0),
|
|
6608
|
+
itemIndex: z31.coerce.number().int().min(0),
|
|
6609
|
+
grid: z31.coerce.number().positive().max(16).describe("Grid in quarter notes: 1 = quarter, 0.5 = 8th, 0.25 = 16th"),
|
|
6610
|
+
strength: z31.coerce.number().min(0).max(1).optional().default(1).describe("0..1, how far each hit moves toward its line"),
|
|
6611
|
+
window: z31.coerce.number().positive().max(1).optional().default(1).describe("0..1 of half a grid step (times 1 + swing, as quantize_midi); hits further from a line stay put"),
|
|
6612
|
+
swing: z31.coerce.number().min(0).max(0.9).optional().default(0),
|
|
6613
|
+
sensitivity: z31.coerce.number().min(0).max(1).optional().default(0.5).describe("Hit detection: higher finds softer hits"),
|
|
6614
|
+
minGapMs: z31.coerce.number().min(5).max(2e3).optional().default(60),
|
|
6615
|
+
minStrength: z31.coerce.number().min(0).max(1).optional().default(0.2).describe("Ignore hits weaker than this (0..1 of the loudest)")
|
|
6455
6616
|
},
|
|
6456
6617
|
async ({ trackIndex: ti, itemIndex: itemIndex2, grid, strength, window, swing, sensitivity, minGapMs, minStrength }) => {
|
|
6457
6618
|
const sidecar = getSidecarClient();
|
|
@@ -6485,7 +6646,7 @@ function registerMixingTools(server) {
|
|
|
6485
6646
|
const res = await run3("quantize_audio", { trackIndex: ti, itemIndex: itemIndex2, grid, strength, window, swing, hits: JSON.stringify(hits) }, 6e4);
|
|
6486
6647
|
if (!res.data) return res;
|
|
6487
6648
|
const d = res.data;
|
|
6488
|
-
const s =
|
|
6649
|
+
const s = trace6.getActiveSpan();
|
|
6489
6650
|
s?.setAttribute("reaper.quantize.hits", hits.length);
|
|
6490
6651
|
s?.setAttribute("reaper.quantize.moved", d.moved ?? 0);
|
|
6491
6652
|
s?.setAttribute("reaper.quantize.skipped", d.skipped ?? 0);
|
|
@@ -6500,8 +6661,8 @@ function registerMixingTools(server) {
|
|
|
6500
6661
|
}
|
|
6501
6662
|
|
|
6502
6663
|
// apps/reaper-mcp-server/src/tools/align.ts
|
|
6503
|
-
import { z as
|
|
6504
|
-
import { trace as
|
|
6664
|
+
import { z as z32 } from "zod/v4";
|
|
6665
|
+
import { trace as trace7 } from "@opentelemetry/api";
|
|
6505
6666
|
|
|
6506
6667
|
// apps/reaper-mcp-server/src/align.ts
|
|
6507
6668
|
var MAX_HITS = 2e3;
|
|
@@ -6592,9 +6753,9 @@ var SIDECAR_NOT_INSTALLED_MSG6 = "Audio understanding sidecar not installed. Run
|
|
|
6592
6753
|
var MAX_ALIGN_SECONDS = 900;
|
|
6593
6754
|
var error5 = (text7) => ({ content: [{ type: "text", text: `Error: ${text7}` }], isError: true });
|
|
6594
6755
|
var ok2 = (data) => ({ content: [{ type: "text", text: JSON.stringify(data, null, 2) }] });
|
|
6595
|
-
var itemRef =
|
|
6596
|
-
trackIndex:
|
|
6597
|
-
itemIndex:
|
|
6756
|
+
var itemRef = z32.object({
|
|
6757
|
+
trackIndex: z32.coerce.number().int().min(0),
|
|
6758
|
+
itemIndex: z32.coerce.number().int().min(0)
|
|
6598
6759
|
});
|
|
6599
6760
|
async function readItem(ref, what) {
|
|
6600
6761
|
const res = await sendCommand("get_media_item_properties", ref);
|
|
@@ -6634,15 +6795,15 @@ function registerAlignTools(server) {
|
|
|
6634
6795
|
"Align doubles (a second take, a harmony, a stack) to a guide item with stretch markers, the way VocalSync does: finds the hits (onsets) in the guide and in each double (sidecar), pairs them in order within maxShiftMs, and puts a stretch marker on each hit of the double so it lands on the guide's. Audio between hits is stretched; anchors at both ends keep each double's length. strength < 1 moves hits only part of the way. protectConsonants moves high-band hits (s, t, k, sh) as a block, so the stretch lands in the vowel after them instead of smearing the consonant. dryRun returns the planned moves and writes nothing. Each double's existing stretch markers are replaced; a guide that has stretch markers is refused (its hits would not sit where its source says). Returns, per double, the timing offset before and after (avg/max ms against the guide). Works on the items' source files (take FX are ignored). Requires the sidecar. Not pitch correction.",
|
|
6635
6796
|
{
|
|
6636
6797
|
guide: itemRef.describe("The item to align to (the lead)"),
|
|
6637
|
-
doubles:
|
|
6638
|
-
strength:
|
|
6639
|
-
maxShiftMs:
|
|
6640
|
-
protectConsonants:
|
|
6641
|
-
consonantMs:
|
|
6642
|
-
dryRun:
|
|
6643
|
-
sensitivity:
|
|
6644
|
-
minGapMs:
|
|
6645
|
-
minStrength:
|
|
6798
|
+
doubles: z32.array(itemRef).min(1).max(8).describe("The items to move onto the guide"),
|
|
6799
|
+
strength: z32.coerce.number().positive().max(1).optional().default(1).describe("0..1, how far each hit moves toward the guide's"),
|
|
6800
|
+
maxShiftMs: z32.coerce.number().min(10).max(500).optional().default(120).describe("Hits further apart than this are not paired (and stay put)"),
|
|
6801
|
+
protectConsonants: z32.boolean().optional().default(true).describe("Move high-band hits as a block with a rigid tail of consonantMs"),
|
|
6802
|
+
consonantMs: z32.coerce.number().min(20).max(300).optional().default(80),
|
|
6803
|
+
dryRun: z32.boolean().optional().default(false),
|
|
6804
|
+
sensitivity: z32.coerce.number().min(0).max(1).optional().default(0.5).describe("Hit detection: higher finds softer hits"),
|
|
6805
|
+
minGapMs: z32.coerce.number().min(5).max(2e3).optional().default(60),
|
|
6806
|
+
minStrength: z32.coerce.number().min(0).max(1).optional().default(0.2).describe("Ignore hits weaker than this (0..1 of the loudest)")
|
|
6646
6807
|
},
|
|
6647
6808
|
async ({ guide, doubles, strength, maxShiftMs, protectConsonants, consonantMs, dryRun, sensitivity, minGapMs, minStrength }) => {
|
|
6648
6809
|
if (!getSidecarClient().isAvailable()) return error5(SIDECAR_NOT_INSTALLED_MSG6);
|
|
@@ -6712,7 +6873,7 @@ function registerAlignTools(server) {
|
|
|
6712
6873
|
});
|
|
6713
6874
|
}
|
|
6714
6875
|
const aligned = results.filter((r) => r["ok"]).length;
|
|
6715
|
-
const span =
|
|
6876
|
+
const span = trace7.getActiveSpan();
|
|
6716
6877
|
span?.setAttribute("reaper.align.doubles", doubles.length);
|
|
6717
6878
|
span?.setAttribute("reaper.align.aligned", aligned);
|
|
6718
6879
|
span?.setAttribute("reaper.align.dry_run", dryRun);
|
|
@@ -6725,11 +6886,11 @@ function registerAlignTools(server) {
|
|
|
6725
6886
|
}
|
|
6726
6887
|
|
|
6727
6888
|
// apps/reaper-mcp-server/src/tools/composition.ts
|
|
6728
|
-
import { z as
|
|
6889
|
+
import { z as z33 } from "zod/v4";
|
|
6729
6890
|
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
6730
6891
|
import { readFile as readFile2, stat as stat2 } from "node:fs/promises";
|
|
6731
6892
|
import { basename as basename3, extname as extname2 } from "node:path";
|
|
6732
|
-
import { trace as
|
|
6893
|
+
import { trace as trace8 } from "@opentelemetry/api";
|
|
6733
6894
|
|
|
6734
6895
|
// apps/reaper-mcp-server/src/key.ts
|
|
6735
6896
|
var PITCH_CLASSES = ["C", "C#", "D", "Eb", "E", "F", "F#", "G", "Ab", "A", "Bb", "B"];
|
|
@@ -7231,12 +7392,12 @@ var DEFAULT_KEY_SECONDS = 60;
|
|
|
7231
7392
|
var renderTimeoutMs3 = (seconds2) => 3e4 + seconds2 * 400;
|
|
7232
7393
|
var chordModelTimeoutMs = (seconds2) => 6e4 + seconds2 * 500;
|
|
7233
7394
|
var selectionSchema = {
|
|
7234
|
-
trackIndex:
|
|
7235
|
-
itemIndex:
|
|
7236
|
-
notes:
|
|
7237
|
-
pitchMin:
|
|
7238
|
-
pitchMax:
|
|
7239
|
-
channel:
|
|
7395
|
+
trackIndex: z33.coerce.number().int().min(0).describe("Track index (0-based)"),
|
|
7396
|
+
itemIndex: z33.coerce.number().int().min(0).describe("MIDI item index on the track (0-based, from list_midi_items)"),
|
|
7397
|
+
notes: z33.array(z33.coerce.number().int().min(0)).optional().describe("Only these note indexes (from get_midi_notes); default: every note matching pitchMin/pitchMax/channel"),
|
|
7398
|
+
pitchMin: z33.coerce.number().int().min(0).max(127).optional().describe("Only notes at or above this pitch"),
|
|
7399
|
+
pitchMax: z33.coerce.number().int().min(0).max(127).optional().describe("Only notes at or below this pitch"),
|
|
7400
|
+
channel: z33.coerce.number().int().min(0).max(15).optional().describe("Only notes on this MIDI channel (0-15; 9 = GM drums)")
|
|
7240
7401
|
};
|
|
7241
7402
|
function flatten2(args, objects = []) {
|
|
7242
7403
|
const out2 = {};
|
|
@@ -7248,7 +7409,7 @@ function flatten2(args, objects = []) {
|
|
|
7248
7409
|
}
|
|
7249
7410
|
function recordNotes(tool, notesChanged) {
|
|
7250
7411
|
if (!Number.isFinite(notesChanged)) return;
|
|
7251
|
-
|
|
7412
|
+
trace8.getActiveSpan()?.setAttribute("reaper.midi.notes_changed", notesChanged);
|
|
7252
7413
|
getMidiNotesHistogram().record(notesChanged, { "gen_ai.tool.name": tool });
|
|
7253
7414
|
}
|
|
7254
7415
|
function keySummary(name, source, k) {
|
|
@@ -7295,11 +7456,11 @@ function registerCompositionTools(server) {
|
|
|
7295
7456
|
'Quantize the notes of a MIDI item to the project grid (beats, not the item start): grid in beats (1 = quarter, 0.5 = 8th, 0.25 = 16th, 1/3 = 8th triplet), strength 0..1 (partial moves keep feel), swing 0..0.9 (pushes every second grid line later), window 0..1 (only notes within that fraction of half the gap to the next line move; with swing the gaps are uneven, so the reach is (1 + swing) times half a step), lengths "keep" (default, notes move whole) or "quantize" (ends snap too). Acts on all notes or a selection (indexes, pitch range, channel). One undo point; a refused call changes nothing. Returns how many notes moved and the average and largest shift in beats.',
|
|
7296
7457
|
{
|
|
7297
7458
|
...selectionSchema,
|
|
7298
|
-
grid:
|
|
7299
|
-
strength:
|
|
7300
|
-
swing:
|
|
7301
|
-
window:
|
|
7302
|
-
lengths:
|
|
7459
|
+
grid: z33.coerce.number().positive().max(16).describe("Grid in beats: 1 = quarter, 0.5 = 8th, 0.25 = 16th, 0.333 = 8th triplet"),
|
|
7460
|
+
strength: z33.coerce.number().min(0).max(1).optional().describe("How far notes move toward the grid, 0..1 (default 1)"),
|
|
7461
|
+
swing: z33.coerce.number().min(0).max(0.9).optional().describe("Off-beat delay as a fraction of a grid step, 0..0.9 (default 0)"),
|
|
7462
|
+
window: z33.coerce.number().gt(0).max(1).optional().describe("Only move notes within this fraction of half the gap between lines, (1 + swing) half steps with swing (default 1 = all)"),
|
|
7463
|
+
lengths: z33.enum(["keep", "quantize"]).optional().describe("keep (default): notes keep their length; quantize: note ends snap too")
|
|
7303
7464
|
},
|
|
7304
7465
|
async (args) => {
|
|
7305
7466
|
const res = await sendCommand("quantize_midi", flatten2(args));
|
|
@@ -7313,23 +7474,23 @@ function registerCompositionTools(server) {
|
|
|
7313
7474
|
"Transform the notes of a MIDI item in one undo point: transpose (semitones, refused if any note would leave 0-127), velocity (set, scale, add, then clamp to min/max), humanize (random timing in beats and velocity, reproducible with seed), length (set in beats, scale, or legato = each note runs to the next selected note on its channel). Acts on all notes or a selection (indexes, pitch range, channel). Returns how many notes it acted on, velocities before/after and the humanize seed.",
|
|
7314
7475
|
{
|
|
7315
7476
|
...selectionSchema,
|
|
7316
|
-
transpose:
|
|
7317
|
-
velocity:
|
|
7318
|
-
set:
|
|
7319
|
-
scale:
|
|
7320
|
-
add:
|
|
7321
|
-
min:
|
|
7322
|
-
max:
|
|
7477
|
+
transpose: z33.coerce.number().int().min(-48).max(48).optional().describe("Semitones up (+) or down (-)"),
|
|
7478
|
+
velocity: z33.object({
|
|
7479
|
+
set: z33.coerce.number().int().min(1).max(127).optional().describe("Every velocity becomes this"),
|
|
7480
|
+
scale: z33.coerce.number().min(0).max(4).optional().describe("Multiply velocities (0.8 = softer, 1.2 = harder)"),
|
|
7481
|
+
add: z33.coerce.number().int().min(-126).max(126).optional().describe("Add to velocities"),
|
|
7482
|
+
min: z33.coerce.number().int().min(1).max(127).optional().describe("Clamp: lowest velocity (default 1)"),
|
|
7483
|
+
max: z33.coerce.number().int().min(1).max(127).optional().describe("Clamp: highest velocity (default 127)")
|
|
7323
7484
|
}).optional(),
|
|
7324
|
-
humanize:
|
|
7325
|
-
timingBeats:
|
|
7326
|
-
velocity:
|
|
7327
|
-
seed:
|
|
7485
|
+
humanize: z33.object({
|
|
7486
|
+
timingBeats: z33.coerce.number().min(0).max(0.25).optional().describe("Random start shift up to \xB1 this many beats (0.02 \u2248 subtle)"),
|
|
7487
|
+
velocity: z33.coerce.number().int().min(0).max(64).optional().describe("Random velocity change up to \xB1 this"),
|
|
7488
|
+
seed: z33.coerce.number().int().optional().describe("Seed: the same seed gives the same result (default 1)")
|
|
7328
7489
|
}).optional(),
|
|
7329
|
-
length:
|
|
7330
|
-
set:
|
|
7331
|
-
scale:
|
|
7332
|
-
legato:
|
|
7490
|
+
length: z33.object({
|
|
7491
|
+
set: z33.coerce.number().positive().max(64).optional().describe("Every note this many beats long"),
|
|
7492
|
+
scale: z33.coerce.number().positive().max(8).optional().describe("Multiply lengths (0.5 = staccato)"),
|
|
7493
|
+
legato: z33.boolean().optional().describe("Each note runs to the start of the next selected note on its channel (unselected notes are not counted)")
|
|
7333
7494
|
}).optional()
|
|
7334
7495
|
},
|
|
7335
7496
|
async (args) => {
|
|
@@ -7343,10 +7504,10 @@ function registerCompositionTools(server) {
|
|
|
7343
7504
|
"import_midi_file",
|
|
7344
7505
|
"Import a Standard MIDI File (.mid/.midi, type 0 or 1, up to 5 MB and 20000 notes) as MIDI items, without REAPER's import dialog: notes and controllers of every file track merged into one item on trackIndex, or with newTracks each file track on a new track named after it, inserted at trackIndex. Placed at position (seconds) on the project grid; the file's tempo is reported, not applied (set it with set_project_tempo). Pitch bend, program changes, aftertouch and sysex are not imported; file.notImported counts them. One undo point.",
|
|
7345
7506
|
{
|
|
7346
|
-
path:
|
|
7347
|
-
trackIndex:
|
|
7348
|
-
newTracks:
|
|
7349
|
-
position:
|
|
7507
|
+
path: z33.string().min(1).describe("Absolute path of the .mid/.midi file"),
|
|
7508
|
+
trackIndex: z33.coerce.number().int().min(0).default(0).describe("Track to put the item on, or with newTracks where the new tracks are inserted"),
|
|
7509
|
+
newTracks: z33.boolean().optional().describe("One new named track per file track (default: merge onto trackIndex)"),
|
|
7510
|
+
position: z33.coerce.number().min(0).default(0).describe("Project time in seconds where the file starts (default 0)")
|
|
7350
7511
|
},
|
|
7351
7512
|
async (args) => {
|
|
7352
7513
|
const ext = extname2(args.path).toLowerCase();
|
|
@@ -7406,12 +7567,12 @@ function registerCompositionTools(server) {
|
|
|
7406
7567
|
"detect_key",
|
|
7407
7568
|
`Detect the musical key (e.g. "A minor") of a track or an audio file: from a track's MIDI notes (note time weighted by velocity, drums on channel 10 ignored) or, for audio, from its rendered chroma (Python sidecar). Returns the key, confidence 0..1 (how far it stands out from the next candidate that is not its relative key, scaled down for a flat profile and by how well the key fits \u2014 its correlation), the relative key, the top 3 alternatives with their correlation, and the 12-bin chroma (C first). Use it before writing parts, choosing a pitch-correction scale or a harmonizer key.`,
|
|
7408
7569
|
{
|
|
7409
|
-
trackIndex:
|
|
7410
|
-
path:
|
|
7411
|
-
itemIndex:
|
|
7412
|
-
source:
|
|
7413
|
-
startTime:
|
|
7414
|
-
endTime:
|
|
7570
|
+
trackIndex: z33.coerce.number().int().min(-1).optional().describe("Track to analyze (-1 = master). Give this or path"),
|
|
7571
|
+
path: z33.string().min(1).optional().describe("Absolute path of an audio file to analyze instead (sidecar)"),
|
|
7572
|
+
itemIndex: z33.coerce.number().int().min(0).optional().describe("Only the time this media item covers on trackIndex (from list_media_items); instead of startTime/endTime. Audio renders the whole track over it"),
|
|
7573
|
+
source: z33.enum(["auto", "midi", "audio"]).optional().default("auto").describe("For a track: midi (its MIDI notes), audio (render it), auto (default: MIDI notes when it has any, else audio)"),
|
|
7574
|
+
startTime: z33.coerce.number().min(0).optional().describe("Start of the range in seconds (project time for a track, file time for a file; default 0)"),
|
|
7575
|
+
endTime: z33.coerce.number().min(0).optional().describe(`End of the range in seconds (track audio default: start + ${DEFAULT_KEY_SECONDS} s; MIDI and file default: the end)`)
|
|
7415
7576
|
},
|
|
7416
7577
|
async (args) => {
|
|
7417
7578
|
const startedAt = Date.now();
|
|
@@ -7489,7 +7650,7 @@ function registerCompositionTools(server) {
|
|
|
7489
7650
|
}
|
|
7490
7651
|
const k = estimateKey(profile);
|
|
7491
7652
|
if (!k) return fail4("No pitched content found in the range (silence, or only drums/noise)");
|
|
7492
|
-
const span =
|
|
7653
|
+
const span = trace8.getActiveSpan();
|
|
7493
7654
|
span?.setAttribute("reaper.key.source", source);
|
|
7494
7655
|
span?.setAttribute("reaper.key.confidence", k.confidence);
|
|
7495
7656
|
logToolResult("detect_key", args, startedAt, keySummary(name, source, k));
|
|
@@ -7510,19 +7671,19 @@ function registerCompositionTools(server) {
|
|
|
7510
7671
|
"detect_chords",
|
|
7511
7672
|
'Detect the chords of a track, one media item or an audio file, one per bar (default) or beat: from MIDI notes (drums on channel 10 ignored; the lowest held note gives slash chords like C/E) or from rendered audio (Python sidecar chroma). Track bars and beats follow the project tempo map; a file uses `bpm` (bar 1 at startTime) or fixed windows. Returns the key, the progression ("Am F C G"), and chord spans (equal neighbours merged): start/end seconds, bar.beat, chord, root, quality (maj, min, 7, maj7, m7, sus2, sus4, dim, aug; the model also dim7, m7b5, 6, m6, 9, maj9, m9, mMaj7, 5, 11, 13), roman numeral in the key, bassMidi (a MIDI note for a bass line, E1-D#2) and a 0..1 fit; "N" = no chord. Paginated (offset/limit). Audio uses the chord model (lv-chordia, slash chords and sevenths from a full mix) when installed (setup-sidecar --with-chords), else chroma templates; `engine` picks. Use it before writing a bass line or other parts to existing guitars, keys or vocals.',
|
|
7512
7673
|
{
|
|
7513
|
-
trackIndex:
|
|
7514
|
-
path:
|
|
7515
|
-
itemIndex:
|
|
7516
|
-
source:
|
|
7517
|
-
per:
|
|
7518
|
-
engine:
|
|
7519
|
-
startTime:
|
|
7520
|
-
endTime:
|
|
7521
|
-
bpm:
|
|
7522
|
-
beatsPerBar:
|
|
7523
|
-
windowSeconds:
|
|
7524
|
-
offset:
|
|
7525
|
-
limit:
|
|
7674
|
+
trackIndex: z33.coerce.number().int().min(-1).optional().describe("Track to analyze (-1 = master, audio only). Give this or path"),
|
|
7675
|
+
path: z33.string().min(1).optional().describe("Absolute path of an audio file to analyze instead (sidecar)"),
|
|
7676
|
+
itemIndex: z33.coerce.number().int().min(0).optional().describe("Only the time this media item covers on trackIndex (from list_media_items); instead of startTime/endTime. Audio renders the whole track over it"),
|
|
7677
|
+
source: z33.enum(["auto", "midi", "audio"]).optional().default("auto").describe("For a track: midi (its MIDI notes), audio (render it), auto (default: MIDI notes when it has any, else audio)"),
|
|
7678
|
+
per: z33.enum(["bar", "beat"]).optional().default("bar").describe("One chord per bar (default) or per beat"),
|
|
7679
|
+
engine: z33.enum(["auto", "model", "template"]).optional().default("auto").describe("Audio: model (the chord model, setup-sidecar --with-chords; also renders a MIDI track), template (chroma templates), auto (default: the model when installed). MIDI notes always use templates"),
|
|
7680
|
+
startTime: z33.coerce.number().min(0).optional().describe("Start of the range in seconds (project time for a track, file time for a file; default 0)"),
|
|
7681
|
+
endTime: z33.coerce.number().min(0).optional().describe(`End of the range in seconds (default: where the track's last item ends, the project end on the master, the file's end; max ${MAX_OFFLINE_SECONDS} s for audio)`),
|
|
7682
|
+
bpm: z33.coerce.number().min(30).max(300).optional().describe("File only: its tempo, so segments are bars/beats from startTime"),
|
|
7683
|
+
beatsPerBar: z33.coerce.number().int().min(1).max(16).optional().default(4).describe("File only, with bpm: beats per bar (default 4)"),
|
|
7684
|
+
windowSeconds: z33.coerce.number().min(0.25).max(16).optional().default(2).describe("File only, without bpm: one chord per this many seconds (default 2)"),
|
|
7685
|
+
offset: z33.coerce.number().int().min(0).optional().default(0).describe("First chord span to return (pagination)"),
|
|
7686
|
+
limit: z33.coerce.number().int().min(1).max(256).optional().default(64).describe("Most chord spans to return (default 64, max 256)")
|
|
7526
7687
|
},
|
|
7527
7688
|
async (args) => {
|
|
7528
7689
|
const startedAt = Date.now();
|
|
@@ -7669,9 +7830,9 @@ function registerCompositionTools(server) {
|
|
|
7669
7830
|
const page = spans.slice(offset, offset + limit);
|
|
7670
7831
|
const chords = spans.filter((s) => s.chord !== "N");
|
|
7671
7832
|
const fit = chords.length ? chords.reduce((a, s) => a + s.score * s.length, 0) / chords.reduce((a, s) => a + s.length, 0) : 0;
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7833
|
+
trace8.getActiveSpan()?.setAttribute("reaper.chords.source", source);
|
|
7834
|
+
trace8.getActiveSpan()?.setAttribute("reaper.chords.count", spans.length);
|
|
7835
|
+
trace8.getActiveSpan()?.setAttribute("reaper.chords.engine", engine);
|
|
7675
7836
|
logToolResult("detect_chords", args, startedAt, chordsSummary(name, source, per, key.key, range, spans));
|
|
7676
7837
|
return text5({
|
|
7677
7838
|
...trackIndex5 != null ? { trackIndex: trackIndex5 } : { path },
|
|
@@ -7699,7 +7860,7 @@ function registerCompositionTools(server) {
|
|
|
7699
7860
|
}
|
|
7700
7861
|
|
|
7701
7862
|
// apps/reaper-mcp-server/src/tools/voice-sketch.ts
|
|
7702
|
-
import { z as
|
|
7863
|
+
import { z as z34 } from "zod/v4";
|
|
7703
7864
|
import { writeFile as writeFile2 } from "node:fs/promises";
|
|
7704
7865
|
import { extname as extname3, isAbsolute as isAbsolute2 } from "node:path";
|
|
7705
7866
|
|
|
@@ -7841,23 +8002,23 @@ function registerVoiceSketchTools(server) {
|
|
|
7841
8002
|
"transcribe_voice_sketch",
|
|
7842
8003
|
"Compose an editable musical draft from humming, singing, beatboxing, or a mixture. Local Python sidecar, no model download. Returns stable rounded BPM, sustained tempo changes, tentative key, separate monophonic melody and GM drum notes, repeated 4/4 drum patterns, and original file times. Timing snaps to a shared grid (default sixteenths); pitches snap to semitones, NOT to a guessed key. By default arrange:true adds a proposed intro/verse/chorus/outro, a kick/snare/hat groove using detected kick positions and hat accents, chord accompaniment, bass locked to the kicks, and the repeated detected melody. Those backing parts and sections are GENERATED, not recovered from the recording. No true audio source separation. arrange:false exports only the detected melody/percussion. key overrides accompaniment only, never retunes the melody. Experimental: drum labels and octaves need review; speech is not removed. Use startTime/endTime to isolate music. No REAPER changes. outputPath writes the FULL score as a type-1 .mid with tempo map and GM instruments. With soundfontPath also renders a sampled mix and separate 32-bit WAV instrument stems into <outputPath without .mid>-stems/. This optional preview needs the FluidSynth shared library and a user-supplied GM .sf2; no audio device or REAPER needed. Then use import_midi_file(newTracks:true) and assign instruments. That importer skips GM programs and does NOT apply the file tempo: use set_project_tempo/add_tempo_marker separately, or REAPER native MIDI import. Summary-first: note arrays default to 100 events per part; limit:0 returns only summaries. Export is never paginated. At most 120 seconds input, 64 bars output, 240 seconds for previews. Requires setup-sidecar (core only is enough).",
|
|
7843
8004
|
{
|
|
7844
|
-
path:
|
|
7845
|
-
startTime:
|
|
7846
|
-
endTime:
|
|
7847
|
-
mode:
|
|
7848
|
-
bpm:
|
|
7849
|
-
grid:
|
|
7850
|
-
pitchMin:
|
|
7851
|
-
pitchMax:
|
|
7852
|
-
minNoteMs:
|
|
7853
|
-
tempoChangeThreshold:
|
|
7854
|
-
arrange:
|
|
7855
|
-
bars:
|
|
7856
|
-
key:
|
|
7857
|
-
outputPath:
|
|
7858
|
-
soundfontPath:
|
|
7859
|
-
offset:
|
|
7860
|
-
limit:
|
|
8005
|
+
path: z34.string().min(1).describe("Absolute path of a voice recording (MP3/WAV/FLAC/AIFF/OGG)"),
|
|
8006
|
+
startTime: z34.coerce.number().min(0).optional().describe("Start in file seconds (default 0); exclude spoken cues"),
|
|
8007
|
+
endTime: z34.coerce.number().positive().optional().describe("End in file seconds (default end of file, max 120 seconds selected)"),
|
|
8008
|
+
mode: z34.enum(["auto", "melody", "drums"]).default("auto").describe("auto: both layers, melody: humming only, drums: beatboxing only"),
|
|
8009
|
+
bpm: z34.coerce.number().min(40).max(240).optional().describe("Force one fixed tempo; use for short clips or half/double-time ambiguity"),
|
|
8010
|
+
grid: z34.coerce.number().min(1 / 12).max(1).default(0.25).describe("Grid in quarter-note beats: 0.25 sixteenths, 0.5 eighths, 1/3 triplets"),
|
|
8011
|
+
pitchMin: z34.coerce.number().int().min(24).max(95).default(36).describe("Lowest vocal MIDI pitch (default C2 = 36)"),
|
|
8012
|
+
pitchMax: z34.coerce.number().int().min(25).max(96).default(84).describe("Highest vocal MIDI pitch (default C6 = 84)"),
|
|
8013
|
+
minNoteMs: z34.coerce.number().min(40).max(500).default(80).describe("Shortest stable pitched segment before quantization (default 80 ms)"),
|
|
8014
|
+
tempoChangeThreshold: z34.coerce.number().min(0.1).max(0.5).default(0.2).describe("Minimum relative tempo change, persisting in two 4-second windows (default 0.2 = 20%)"),
|
|
8015
|
+
arrange: z34.boolean().default(true).describe("Generate a full backing arrangement; false returns the raw detected sketch only"),
|
|
8016
|
+
bars: z34.coerce.number().int().min(4).max(64).default(16).describe("Generated arrangement length in 4/4 bars (default 16); ignored with arrange:false"),
|
|
8017
|
+
key: z34.string().regex(/^(C|C#|D|Eb|E|F|F#|G|Ab|A|Bb|B) (major|minor)$/).optional().describe("Optional accompaniment key, e.g. A minor or Eb major. Does not change detected melody"),
|
|
8018
|
+
outputPath: z34.string().min(1).optional().describe("Optional absolute .mid path to create. Parent folder must exist. Existing files are never overwritten"),
|
|
8019
|
+
soundfontPath: z34.string().min(1).optional().describe("Optional absolute GM .sf2 for real sampled mix + stems. Requires outputPath and local FluidSynth library"),
|
|
8020
|
+
offset: z34.coerce.number().int().min(0).default(0).describe("Note offset, independently in each part"),
|
|
8021
|
+
limit: z34.coerce.number().int().min(0).max(500).default(100).describe("Notes returned per part (default 100, 0 = summary only); export always includes all notes")
|
|
7861
8022
|
},
|
|
7862
8023
|
async (args) => {
|
|
7863
8024
|
const started = Date.now();
|
|
@@ -7982,7 +8143,7 @@ function registerVoiceSketchTools(server) {
|
|
|
7982
8143
|
}
|
|
7983
8144
|
|
|
7984
8145
|
// apps/reaper-mcp-server/src/tools/knowledge.ts
|
|
7985
|
-
import { z as
|
|
8146
|
+
import { z as z35 } from "zod/v4";
|
|
7986
8147
|
var LOREKIT_DEFAULT_URL = "https://pqokxlhvnosogizsjztg.supabase.co/functions/v1/mcp";
|
|
7987
8148
|
var BUILTIN_LOREKIT_TOKEN = "lk_ro_9YKX9WXJXZYKDQeRrG3bRt9XxYDn77Rj";
|
|
7988
8149
|
var BUILTIN_SCOPE = "project::reaper-mcp";
|
|
@@ -8045,10 +8206,10 @@ function registerKnowledgeTools(server) {
|
|
|
8045
8206
|
"list_builtin_knowledge",
|
|
8046
8207
|
`List the built-in (read-only, curated) mix knowledge: plugin records and mixing lessons. Without query: summaries (key, tags, preview) \u2014 filter plugins by tags such as "category::eq" or "fx::Pro-Q 3". With query: full-text search returning full bodies. Combine with the user's own LoreKit layer (user:: keys), which overrides these.`,
|
|
8047
8208
|
{
|
|
8048
|
-
kind:
|
|
8049
|
-
tags:
|
|
8050
|
-
query:
|
|
8051
|
-
limit:
|
|
8209
|
+
kind: z35.enum(["plugins", "lessons", "all"]).optional().describe("Which bucket (default all)"),
|
|
8210
|
+
tags: z35.array(z35.string()).optional().describe('List mode: return rows having ANY of these tags (e.g. ["category::compressor"])'),
|
|
8211
|
+
query: z35.string().optional().describe('Full-text search instead of a list (e.g. "drum bus attack")'),
|
|
8212
|
+
limit: z35.coerce.number().int().min(1).max(100).optional().describe("Max results (default 50 for list, 5 for search)")
|
|
8052
8213
|
},
|
|
8053
8214
|
async ({ kind = "all", tags, query, limit }) => {
|
|
8054
8215
|
try {
|
|
@@ -8074,7 +8235,7 @@ function registerKnowledgeTools(server) {
|
|
|
8074
8235
|
"get_builtin_knowledge",
|
|
8075
8236
|
`Read one built-in (read-only) record by key: "plugins::<vendor>/<plugin>" (e.g. "plugins::fabfilter/pro-q-3") or "mixing-lessons::<slug>". Returns null when the built-in layer has no such record. The user's own "user::" record of the same name, if any, overrides it.`,
|
|
8076
8237
|
{
|
|
8077
|
-
key:
|
|
8238
|
+
key: z35.string().describe('Built-in key, e.g. "plugins::fabfilter/pro-q-3"')
|
|
8078
8239
|
},
|
|
8079
8240
|
async ({ key }) => {
|
|
8080
8241
|
if (!isBuiltInKey(key)) {
|
|
@@ -8197,6 +8358,7 @@ function createServer() {
|
|
|
8197
8358
|
registerCompositionTools(server);
|
|
8198
8359
|
registerVoiceSketchTools(server);
|
|
8199
8360
|
registerKnowledgeTools(server);
|
|
8361
|
+
registerPluginResearchTools(server);
|
|
8200
8362
|
return server;
|
|
8201
8363
|
}
|
|
8202
8364
|
|
|
@@ -8355,7 +8517,7 @@ ${b64(fixed.state)}
|
|
|
8355
8517
|
}
|
|
8356
8518
|
|
|
8357
8519
|
// apps/reaper-mcp-server/src/extensions.ts
|
|
8358
|
-
import { z as
|
|
8520
|
+
import { z as z36 } from "zod/v4";
|
|
8359
8521
|
import { existsSync as existsSync4 } from "node:fs";
|
|
8360
8522
|
function getExtensionsDir() {
|
|
8361
8523
|
return process.env["REAPER_MCP_EXTENSIONS"] || join9(homedir7(), ".reaper-mcp", "extensions");
|
|
@@ -8403,7 +8565,7 @@ function createApi(server, manifest) {
|
|
|
8403
8565
|
const api = {
|
|
8404
8566
|
name: manifest.name,
|
|
8405
8567
|
apiVersion: EXTENSION_API_VERSION,
|
|
8406
|
-
z:
|
|
8568
|
+
z: z36,
|
|
8407
8569
|
tool(name, description, shape2, handler) {
|
|
8408
8570
|
if (!TOOL_NAME.test(name)) throw new Error(`tool name "${name}" must be lowercase letters, digits and underscores`);
|
|
8409
8571
|
const full = `${prefix}_${name}`;
|