@audiolabtools/mcp-server 0.5.2 → 0.5.4
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 +22 -0
- package/hosted-server.mjs +55 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,6 +62,28 @@ Every tool takes **one audio source**: a public `url` **or** a local `path`:
|
|
|
62
62
|
| `compare_loudness` | A/B on two sources (`urlA`/`pathA` + `urlB`/`pathB`), returns both results |
|
|
63
63
|
| `analyze_batch` | One route over up to 20 sources in a single call (`urls` and/or `paths`), per-item ok/data/error. For folder QA, library indexing, or checking a whole release against a target; with `endpoint:"signallab/index"` it takes `bandLimit:true` too. Each item meters as one call |
|
|
64
64
|
|
|
65
|
+
## Options
|
|
66
|
+
|
|
67
|
+
Each option says what it is and what it is for, how you use and read it, and what it is not.
|
|
68
|
+
|
|
69
|
+
<!-- options:start (generated from lib/options.mjs by scripts/options-truth-check.mjs --write) -->
|
|
70
|
+
|
|
71
|
+
Every option, with the lenses it changes: https://audiolab.tools/docs/options
|
|
72
|
+
|
|
73
|
+
| Option | What it is, what it is for | How to use and read it | What it is not |
|
|
74
|
+
|---|---|---|---|
|
|
75
|
+
| `measureStatus` | Adds one key, measureStatus, to the answer: for each field that matches a lens, its status (validated, proxy, beta, withdrawn or planned), its method and the lens it belongs to; for a validated lens also its basis; and its margin when the field matches exactly one lens with a margin. A field that matches several lenses gets the weakest status and the list of those lenses. With it you know, per number, whether you may state it, only compare it, or should not use it. | REST: add "measureStatus": true to the JSON body, or ?measureStatus=true with a raw upload. MCP: on by default; measureStatus: false leaves it out. Read it per field: validated, state the number and stay inside its margin; proxy, use it to compare two recordings, not as a fact; beta, not shown to be right yet; withdrawn, do not read it as what its name says. MCP default: true (since MCP server 0.5.3). | Not a guarantee for your recording: a margin holds under the conditions named on the lens. A field that matches no lens gets no entry. It does not remove a withdrawn field: that stays in the answer so that nothing breaks. |
|
|
76
|
+
| `round` | Rounds the numbers to what they are worth: dB, dBFS, dBTP, LUFS, LU and dB/s to 2 decimals, seconds to 3, milliseconds to 1, Hz to 1, shares and ratios to 3, other numbers to 7 significant digits, and numbers in an array to 6 significant digits. Whole numbers stay as they are. On analyze/profile the lenses are rounded, not the other keys. The keys and types stay the same. | REST: "round": true. MCP: on by default; round: false gives full precision. Combine it with measureStatus: the margin of a lens says how many of the remaining digits mean something. MCP default: true (since MCP server 0.5.3). | It makes nothing more accurate: the measurement is the same, only the digits are fewer. Only mixlab/analyze, voicelab/qa, signallab and analyze/profile are rounded (and signallab/index in a batch); the other routes keep full precision. |
|
|
77
|
+
| `series` | Puts the curves and arrays back in the answer: on mixlab/analyze the short-term loudness, the waveform and the spectrum; on voicelab/qa the level envelope, the voiced mask, the segments and the signal-to-noise per segment; on signallab the regions and the energy and centroid envelopes; on analyze/profile every lens that is a curve, a matrix, or a value per block or per segment, among them the octave bands of the room profile. | REST and MCP: series: true; off by default, and then the answer says series: false where the arrays were. In analyze_batch it applies to every item. MCP default: false. | Not needed to answer a question, and it can make the answer many times larger. It is not the audio. |
|
|
78
|
+
| `speechDetector` | Chooses the detector that finds the speech. It decides speechRatio, speechSec, silenceSec, longSilences, the segments, the voiced mask and the measures that read the pauses or the speech, such as the speech level and the signal-to-noise ratio (k2 corrects that ratio below 16 dB). k2 lets a phrase run on into its soft word starts and endings, by at most 100 ms per side. | REST and MCP: "speechDetector": "k2". Leave it out to get the default: v1 until 15 January 2027, then k2. The keys are the same with both; a pause measure is null when no pause is left. MCP default: the API default. | It finds when someone speaks, not who (no speaker separation) and not what (no transcription). Most of the lenses it decides are proxies; the signal-to-noise ratio is validated. |
|
|
79
|
+
| `contentModel` | Chooses the model that gives the content type (voice, music, mixed, noise, silence or unknown) and its confidence. v2 is a small learned model over 25 simple features per 10-second window, much better on speech and music in our tests. | REST and MCP: "contentModel": "v2". Leave it out to get the default: v1 until 15 January 2027, then v2. With v2 the evidence list contains model:v2, so you can see which model answered. MCP default: the API default. | A classifier, not a measurement. v2 met its bar for speech and music, not for steady noise (street traffic and the metro mostly read unknown), so the content type stays a proxy. |
|
|
80
|
+
| `spectrumCalc` | Chooses the spectrum calculation. v2 corrects three errors found in a test against an independent calculation of the same definitions (MARGES-5): the spectral roll-off no longer counts the DC bin (v1 reads it low), and in the analysis grid of analyze/profile the flatness divides by the bins it uses and a level under -120 dB reads -120 (that reaches the level, peak, crest and noise floor of each block, and the headroom). The grid values per block come with series. | REST and MCP: "spectrumCalc": "v2". Leave it out to get the default: v1 until 15 February 2027, then v2. The keys and types are the same with both. MCP default: the API default. | Not a different spectrum: a few values change a little. It changes nothing in loudness or true peak. |
|
|
81
|
+
| `bandLimit` | Adds bandLimit: whether the audio was upsampled, as upsampled yes, no or cannot-say, with its status, its reason in plain words and its basis. | REST: "bandLimit": true on signallab. MCP: bandLimit: true on index_signal, or on analyze_batch with endpoint signallab/index. yes rests on a validated rule (the band stops under 5 kHz in a file of 16 kHz or more); no and the bandwidth ratio are proxies. In the provenance and dataset profiles of analyze/profile the verdict is always there, without this option. MCP default: false. | cannot-say means: look at the file, not that it is fine. telephonyOrigin, a validated rule on the same bandwidth, says a file probably passed through an 8 kHz telephone channel; it does not name a codec. |
|
|
82
|
+
| `liveEvents` | Adds liveEvents: the file read as a stream, 20 ms at a time, by the same live monitor as /live and the npm package @audiolabtools/live, with every dropout, clipping, level drop, dead air and hum event it raised, with its times and its reason. | REST and MCP: "liveEvents": true on analyze/profile, with any profile. Every event has status signals: say "a signal", never "detected". MCP default: false. | Not a diagnosis: none of these detectors has been validated on live streams yet. A dropout or clipping event uses its own rule and can differ from chain.dropoutCount and signal.clipping in the same answer; the event says why. |
|
|
83
|
+
| `roomSource` | Tells the room profile how the recording was made: one clap, one balloon pop, an impulse response, or the engine's sweep as the room returned it. The room profile measures how long the room rings and whether there is a flutter echo; the values per octave band come with series. | REST and MCP: "profile": "room" with "roomSource" on analyze/profile. The room profile needs a paid plan. MCP default: the API default. | It cannot measure reverberation from speech or music: it needs one of the four sources. An earlier room-echo score was withdrawn because it was not a reverb measure. |
|
|
84
|
+
|
|
85
|
+
<!-- options:end -->
|
|
86
|
+
|
|
65
87
|
Example asks to your AI:
|
|
66
88
|
|
|
67
89
|
- *“Analyze the loudness of https://example.com/track.wav”* → `analyze_loudness` with `url`
|
package/hosted-server.mjs
CHANGED
|
@@ -192,8 +192,11 @@ async function batchSources({ urls = [], paths = [] }, endpoint, extra, key, loc
|
|
|
192
192
|
|
|
193
193
|
// Resolve one audio source (url OR local path) to a route call. `local` gates path reads:
|
|
194
194
|
// the remote /mcp endpoint passes local=false and must NEVER touch the server filesystem.
|
|
195
|
-
async function analyzeSource(route, { url, path } = {}, extra = {}, key, local = false) {
|
|
195
|
+
async function analyzeSource(route, { url, path, measureStatus, round } = {}, extra = {}, key, local = false) {
|
|
196
196
|
if (url && path) throw new Error('Provide exactly one of url or path, not both.');
|
|
197
|
+
// on by default (0.5.3); routes without lenses (check-target, timeseries, spectrum, segments) ignore both
|
|
198
|
+
if (measureStatus !== false) extra = { ...extra, measureStatus: true };
|
|
199
|
+
if (round !== false) extra = { ...extra, round: true };
|
|
197
200
|
if (path) {
|
|
198
201
|
if (!local) throw new Error('Local file paths are only supported by the local (stdio) MCP server; use a public https url instead.');
|
|
199
202
|
let buf;
|
|
@@ -226,6 +229,16 @@ const sourceShape = (local) => local
|
|
|
226
229
|
}
|
|
227
230
|
: { url: z.string().url().describe('Public https URL to the audio file.') };
|
|
228
231
|
|
|
232
|
+
// measureStatus is on by default: an agent should not read a proxy or a withdrawn field as a fact.
|
|
233
|
+
const MS_DOC = ' The answer carries measureStatus: per field its status (validated, proxy, beta, withdrawn), basis and margin where known. Report a proxy as an approximation, never present a withdrawn field as what its name says, and stay inside a stated margin (https://audiolab.tools/docs/start/read-a-response#the-five-statuses).';
|
|
234
|
+
const msShape = { measureStatus: z.boolean().optional().describe('Add measureStatus to the answer: the status of each field. On by default; set false to leave it out.') };
|
|
235
|
+
const roundShape = { round: z.boolean().optional().describe('Round numbers to what they are worth (dB and LUFS 2 decimals, seconds 3, ms 1, Hz 1, shares 3); same keys and types. On by default; set false for full precision.') };
|
|
236
|
+
const scShape = { spectrumCalc: z.enum(['v1', 'v2']).optional().describe('Spectrum calculation: v1 (the default until 15 February 2027) or v2 (fixes three errors found against an independent calculation; values change a little, keys do not).') };
|
|
237
|
+
const seriesShape = { series: z.boolean().optional().describe('Include the curves and arrays (a large payload). Off by default.') };
|
|
238
|
+
const cmShape = { contentModel: z.enum(['v1', 'v2']).optional().describe('Content-type model: v1 (the default until 15 January 2027) or v2 (the newer small learned model).') };
|
|
239
|
+
const sdShape = { speechDetector: z.enum(['v1', 'k2']).optional().describe('Speech detector: v1 (the default until 15 January 2027) or k2 (lets a phrase run on into its soft word starts and endings, at most 100 ms per side).') };
|
|
240
|
+
const opt = (i, ...names) => Object.fromEntries(names.filter((n) => i[n] !== undefined).map((n) => [n, i[n]]));
|
|
241
|
+
|
|
229
242
|
export function buildServer({ apiKey, local = false } = {}) {
|
|
230
243
|
const server = new McpServer({ name: 'audiolab', version: PKG_VERSION });
|
|
231
244
|
const toolNames = [];
|
|
@@ -235,9 +248,9 @@ export function buildServer({ apiKey, local = false } = {}) {
|
|
|
235
248
|
|
|
236
249
|
tool('analyze_loudness', {
|
|
237
250
|
title: 'Analyze loudness (MixLab)',
|
|
238
|
-
description: 'Loudness and dynamics for a track: integrated LUFS (EBU R128 / BS.1770-4), true-peak (dBTP), loudness range (LRA), crest factor, stereo correlation, mono compatibility, and tonal balance.' + srcDoc,
|
|
239
|
-
inputSchema: src,
|
|
240
|
-
}, wrap((i) => analyzeSource('mixlab/analyze', i,
|
|
251
|
+
description: 'Loudness and dynamics for a track: integrated LUFS (EBU R128 / BS.1770-4), true-peak (dBTP), loudness range (LRA), crest factor, stereo correlation, mono compatibility, and tonal balance.' + MS_DOC + srcDoc,
|
|
252
|
+
inputSchema: { ...src, ...msShape, ...roundShape, ...seriesShape, ...scShape },
|
|
253
|
+
}, wrap((i) => analyzeSource('mixlab/analyze', i, opt(i, 'series', 'spectrumCalc'), apiKey, local)));
|
|
241
254
|
|
|
242
255
|
tool('check_target', {
|
|
243
256
|
title: 'Check audio against a loudness target (Spotify, EBU, etc.)',
|
|
@@ -254,29 +267,29 @@ export function buildServer({ apiKey, local = false } = {}) {
|
|
|
254
267
|
tool('get_spectrum', {
|
|
255
268
|
title: 'FFT spectrum data',
|
|
256
269
|
description: 'Frequency-domain magnitude data (paired frequency/magnitude arrays) plus energies in 7 standard bands (sub/bass/lowMid/mid/highMid/presence/air). There is no dominant-band field in the response. For spectrum-analyzer UIs and tonal-balance analysis.' + srcDoc,
|
|
257
|
-
inputSchema: src,
|
|
258
|
-
}, wrap((i) => analyzeSource('mixlab/spectrum', i,
|
|
270
|
+
inputSchema: { ...src, ...scShape },
|
|
271
|
+
}, wrap((i) => analyzeSource('mixlab/spectrum', i, opt(i, 'spectrumCalc'), apiKey, local)));
|
|
259
272
|
|
|
260
273
|
tool('analyze_voice', {
|
|
261
274
|
title: 'Analyze voice quality (VoiceLab)',
|
|
262
|
-
description: 'Speech-quality QA for a voice recording: speech/silence ratio, speaking-rate label, signal-to-noise, noise floor, pause energy, sibilance risk, clipping severity. Gates a voice take. Status: levels, SNR, noise floor and clipping are validated against known signals; speaking rate, background scene and intelligibility are proxies, and the pause-energy field is not a reverb measure (https://audiolab.tools/lenses).' + srcDoc,
|
|
263
|
-
inputSchema: src,
|
|
264
|
-
}, wrap((i) => analyzeSource('voicelab/qa', i,
|
|
275
|
+
description: 'Speech-quality QA for a voice recording: speech/silence ratio, speaking-rate label, signal-to-noise, noise floor, pause energy, sibilance risk, clipping severity. Gates a voice take. Status: levels, SNR, noise floor and clipping are validated against known signals; speaking rate, background scene and intelligibility are proxies, and the pause-energy field is not a reverb measure (https://audiolab.tools/lenses).' + MS_DOC + srcDoc,
|
|
276
|
+
inputSchema: { ...src, ...msShape, ...roundShape, ...seriesShape, ...sdShape },
|
|
277
|
+
}, wrap((i) => analyzeSource('voicelab/qa', i, opt(i, 'speechDetector', 'series'), apiKey, local)));
|
|
265
278
|
|
|
266
279
|
tool('get_speech_segments', {
|
|
267
280
|
title: 'Speech segments (VoiceLab)',
|
|
268
281
|
description: 'List voiced speech regions with start/end timestamps and per-segment RMS. For auto-trim and chapter generation. RMS-based voice-activity detection: it finds where speech is, not who is speaking, and it does not detect speaker turns. Status: a proxy, the speech gate is not measured against labelled speech.' + srcDoc,
|
|
269
|
-
inputSchema: src,
|
|
270
|
-
}, wrap((i) => analyzeSource('voicelab/segments', i,
|
|
282
|
+
inputSchema: { ...src, ...sdShape },
|
|
283
|
+
}, wrap((i) => analyzeSource('voicelab/segments', i, opt(i, 'speechDetector'), apiKey, local)));
|
|
271
284
|
|
|
272
285
|
tool('index_signal', {
|
|
273
286
|
title: 'Index a signal (SignalLab)',
|
|
274
|
-
description: 'A metadata index for any audio file: content-type guess (voice/music/mixed/noise/silence) with confidence, brightness & dynamics buckets, a rough band label, clipping/silence regions, and tag suggestions. For triage or auto-tagging a library. Status: content type, regions and confidence come from a frame classifier that is a proxy, not validated on a labelled corpus of real recordings; the tags describe the signal only, never the speaker (https://audiolab.tools/lenses). Set bandLimit:true to ask whether the audio was upsampled: bandLimit.upsampled is yes, no or cannot-say, with the reason in plain words. yes rests on a validated rule (study UP-1: the band stops under 5 kHz in a file of 16 kHz or more, as after a telephone call); no and the bandwidth ratio are proxies (study UP-2); cannot-say means look at the file, not that it is fine.' + srcDoc,
|
|
287
|
+
description: 'A metadata index for any audio file: content-type guess (voice/music/mixed/noise/silence/unknown) with confidence, brightness & dynamics buckets, a rough band label, clipping/silence regions, and tag suggestions. For triage or auto-tagging a library. Status: content type, regions and confidence come from a frame classifier that is a proxy, not validated on a labelled corpus of real recordings; the tags describe the signal only, never the speaker (https://audiolab.tools/lenses). Set bandLimit:true to ask whether the audio was upsampled: bandLimit.upsampled is yes, no or cannot-say, with the reason in plain words. yes rests on a validated rule (study UP-1: the band stops under 5 kHz in a file of 16 kHz or more, as after a telephone call); no and the bandwidth ratio are proxies (study UP-2); cannot-say means look at the file, not that it is fine.' + MS_DOC + srcDoc,
|
|
275
288
|
inputSchema: {
|
|
276
|
-
...src,
|
|
289
|
+
...src, ...msShape, ...roundShape, ...seriesShape, ...cmShape,
|
|
277
290
|
bandLimit: z.boolean().optional().describe('Also return bandLimit: whether the audio was upsampled (yes, no or cannot-say), its status, reason and basis. Off by default.'),
|
|
278
291
|
},
|
|
279
|
-
}, wrap((i) => analyzeSource('signallab', i, { bandLimit: i.bandLimit }, apiKey, local)));
|
|
292
|
+
}, wrap((i) => analyzeSource('signallab', i, { bandLimit: i.bandLimit, ...opt(i, 'contentModel', 'series') }, apiKey, local)));
|
|
280
293
|
|
|
281
294
|
// analyze_profile: the lens registry as one tool. A model that knows what it
|
|
282
295
|
// is looking for names the question, not forty field names; a model that does
|
|
@@ -292,19 +305,19 @@ export function buildServer({ apiKey, local = false } = {}) {
|
|
|
292
305
|
+ 'environment (what is in this space, and what kind of noise is it), '
|
|
293
306
|
+ 'broadcast (does this file meet the delivery spec), '
|
|
294
307
|
+ 'loop (is this loop clean, on the grid, and safe to drop in a DAW), '
|
|
295
|
-
+ 'room (how long does this room ring per octave band, and is there a flutter echo; needs a recording of one clap, a balloon pop, an impulse response or a sweep), '
|
|
308
|
+
+ 'room (how long does this room ring, per octave band with series:true, and is there a flutter echo; needs a recording of one clap, a balloon pop, an impulse response or a sweep), '
|
|
296
309
|
+ 'chain (did this recording lose packets on its way: gaps of digital silence), '
|
|
297
310
|
+ 'pitch (where does this voice sit, how much does it move, how clean is it). '
|
|
298
311
|
+ 'basic is the free tier; the other ten need a paid plan. '
|
|
299
312
|
+ 'Results are keyed by stable lens id. Only the analysis passes the profile needs are run. '
|
|
300
|
-
+ 'Set series:true to also get the curves, the per-block lanes and the per-phrase values,'
|
|
313
|
+
+ 'Set series:true to also get the curves, the per-block lanes and the per-phrase values, '
|
|
301
314
|
+ 'a much larger payload, so leave it off unless you are going to read them. '
|
|
302
315
|
+ 'Set liveEvents:true to also get liveEvents: the file read as a stream by the live monitor, with every dropout, clipping, level drop, dead air '
|
|
303
316
|
+ 'and hum event, its times and its reason. Status signals: none of these detectors has been validated on live streams yet, so say "a signal", '
|
|
304
317
|
+ 'never "detected". A dropout or clipping event names the file measure with its own rule (chain.dropoutCount, signal.clipping) and why the two can differ.'
|
|
305
|
-
+ srcDoc,
|
|
318
|
+
+ MS_DOC + srcDoc,
|
|
306
319
|
inputSchema: {
|
|
307
|
-
...src,
|
|
320
|
+
...src, ...msShape, ...roundShape, ...cmShape, ...sdShape, ...scShape,
|
|
308
321
|
profile: z.enum(['basic', 'voice', 'master', 'provenance', 'dataset', 'environment', 'broadcast', 'loop', 'room', 'chain', 'pitch'])
|
|
309
322
|
.describe('Which question to answer.'),
|
|
310
323
|
series: z.boolean().optional()
|
|
@@ -314,7 +327,7 @@ export function buildServer({ apiKey, local = false } = {}) {
|
|
|
314
327
|
liveEvents: z.boolean().optional()
|
|
315
328
|
.describe('Also return liveEvents: the events of the live monitor over the whole file, status signals. Off by default.'),
|
|
316
329
|
},
|
|
317
|
-
}, wrap((i) => analyzeSource('analyze/profile', i, { profile: i.profile, series: i.series === true, ...(i.roomSource ? { roomSource: i.roomSource } : {}), ...(i.liveEvents ? { liveEvents: true } : {}) }, apiKey, local)));
|
|
330
|
+
}, wrap((i) => analyzeSource('analyze/profile', i, { profile: i.profile, series: i.series === true, ...(i.roomSource ? { roomSource: i.roomSource } : {}), ...(i.liveEvents ? { liveEvents: true } : {}), ...opt(i, 'contentModel', 'speechDetector', 'spectrumCalc') }, apiKey, local)));
|
|
318
331
|
|
|
319
332
|
// compare_loudness: two independent sources, each a url or (local only) a path.
|
|
320
333
|
const cmp = local
|
|
@@ -330,12 +343,12 @@ export function buildServer({ apiKey, local = false } = {}) {
|
|
|
330
343
|
};
|
|
331
344
|
tool('compare_loudness', {
|
|
332
345
|
title: 'Compare two tracks (A/B)',
|
|
333
|
-
description: 'Run loudness analysis on TWO sources and return both results for an A/B comparison: master vs reference, before vs after a fix, two encoders, two cuts.' + srcDoc,
|
|
334
|
-
inputSchema: cmp,
|
|
346
|
+
description: 'Run loudness analysis on TWO sources and return both results for an A/B comparison: master vs reference, before vs after a fix, two encoders, two cuts.' + MS_DOC + srcDoc,
|
|
347
|
+
inputSchema: { ...cmp, ...msShape, ...roundShape, ...scShape },
|
|
335
348
|
}, wrap(async (i) => {
|
|
336
349
|
const [a, b] = await Promise.all([
|
|
337
|
-
analyzeSource('mixlab/analyze', { url: i.urlA, path: i.pathA
|
|
338
|
-
analyzeSource('mixlab/analyze', { url: i.urlB, path: i.pathB
|
|
350
|
+
analyzeSource('mixlab/analyze', { url: i.urlA, path: i.pathA, measureStatus: i.measureStatus, round: i.round }, opt(i, 'spectrumCalc'), apiKey, local),
|
|
351
|
+
analyzeSource('mixlab/analyze', { url: i.urlB, path: i.pathB, measureStatus: i.measureStatus, round: i.round }, opt(i, 'spectrumCalc'), apiKey, local),
|
|
339
352
|
]);
|
|
340
353
|
return { a, b };
|
|
341
354
|
}));
|
|
@@ -349,7 +362,7 @@ export function buildServer({ apiKey, local = false } = {}) {
|
|
|
349
362
|
: { urls: z.array(z.string().url()).min(1).max(20).describe('Public https URLs to audio files (max 20).') };
|
|
350
363
|
tool('analyze_batch', {
|
|
351
364
|
title: 'Batch: one analysis route over many files',
|
|
352
|
-
description: 'Run one analysis route over up to 20 audio sources in a single call. Returns per-item ok/data/error; each item is metered as one call. Routes: mixlab/analyze (default), mixlab/check-target, mixlab/timeseries, mixlab/spectrum, voicelab/qa, voicelab/segments, signallab/index. Use for folder QA, library indexing, or checking a whole release against a loudness target.' + (local ? ' Sources: public https urls and/or local file paths.' : ' Sources: public https urls.'),
|
|
365
|
+
description: 'Run one analysis route over up to 20 audio sources in a single call. Returns per-item ok/data/error; each item is metered as one call. Routes: mixlab/analyze (default), mixlab/check-target, mixlab/timeseries, mixlab/spectrum, voicelab/qa, voicelab/segments, signallab/index. Use for folder QA, library indexing, or checking a whole release against a loudness target. On mixlab/analyze, voicelab/qa and signallab/index each item carries measureStatus (on by default): report a proxy as an approximation, never a withdrawn field as what its name says.' + (local ? ' Sources: public https urls and/or local file paths.' : ' Sources: public https urls.'),
|
|
353
366
|
inputSchema: {
|
|
354
367
|
...batchSrc,
|
|
355
368
|
endpoint: z.string().optional().describe('Analysis route to run for every item (default mixlab/analyze).'),
|
|
@@ -357,8 +370,9 @@ export function buildServer({ apiKey, local = false } = {}) {
|
|
|
357
370
|
lufs: z.number().optional().describe('For target="custom": integrated LUFS target.'),
|
|
358
371
|
tp: z.number().optional().describe('For target="custom": max true-peak (dBTP).'),
|
|
359
372
|
bandLimit: z.boolean().optional().describe('For signallab/index: also return bandLimit per file, with upsampled yes, no or cannot-say (see index_signal).'),
|
|
373
|
+
...msShape, ...roundShape, ...seriesShape, ...cmShape, ...sdShape, ...scShape,
|
|
360
374
|
},
|
|
361
|
-
}, wrap((i) => batchSources({ urls: i.urls || [], paths: i.paths || [] }, i.endpoint || 'mixlab/analyze', { target: i.target, lufs: i.lufs, tp: i.tp, bandLimit: i.bandLimit }, apiKey, local)));
|
|
375
|
+
}, wrap((i) => batchSources({ urls: i.urls || [], paths: i.paths || [] }, i.endpoint || 'mixlab/analyze', { target: i.target, lufs: i.lufs, tp: i.tp, bandLimit: i.bandLimit, measureStatus: i.measureStatus !== false, round: i.round !== false, ...opt(i, 'series', 'contentModel', 'speechDetector', 'spectrumCalc') }, apiKey, local)));
|
|
362
376
|
|
|
363
377
|
return { server, toolNames };
|
|
364
378
|
}
|
|
@@ -391,6 +405,21 @@ if (isMain && process.argv.includes('--selftest')) {
|
|
|
391
405
|
} finally { globalThis.fetch = realFetch; }
|
|
392
406
|
}
|
|
393
407
|
|
|
408
|
+
// measureStatus is on by default (0.5.3): a call carries it, measureStatus:false leaves it out.
|
|
409
|
+
{
|
|
410
|
+
const realFetch = globalThis.fetch;
|
|
411
|
+
let body;
|
|
412
|
+
globalThis.fetch = async (_url, init) => { body = JSON.parse(init.body); return new Response('{"ok":true}', { status: 200 }); };
|
|
413
|
+
try {
|
|
414
|
+
await analyzeSource('voicelab/qa', { url: 'https://example.com/a.wav' }, {}, 'al_live_selftest', false);
|
|
415
|
+
assert.equal(body.measureStatus, true, 'measureStatus goes out by default');
|
|
416
|
+
assert.equal(body.round, true, 'round goes out by default');
|
|
417
|
+
await analyzeSource('voicelab/qa', { url: 'https://example.com/a.wav', measureStatus: false, round: false }, {}, 'al_live_selftest', false);
|
|
418
|
+
assert.ok(!('measureStatus' in body), 'measureStatus:false leaves it out');
|
|
419
|
+
assert.ok(!('round' in body), 'round:false leaves it out');
|
|
420
|
+
} finally { globalThis.fetch = realFetch; }
|
|
421
|
+
}
|
|
422
|
+
|
|
394
423
|
// Elke fout die de gebruiker te zien krijgt draagt één regel Docs met een vaste code (mcp/error-docs.mjs; de uitleg staat op /docs/errors).
|
|
395
424
|
{
|
|
396
425
|
const { withDocs, codeFor } = await import('./error-docs.mjs');
|
|
@@ -427,7 +456,7 @@ if (isMain && process.argv.includes('--selftest')) {
|
|
|
427
456
|
if (e?.code !== 'ERR_MODULE_NOT_FOUND') throw e;
|
|
428
457
|
}
|
|
429
458
|
|
|
430
|
-
console.log(`selftest ok · v${PKG_VERSION} · ${expected.length} tools (incl. analyze_profile) + keyless trial and batch-key guard + remote-path refusals + batch guards`);
|
|
459
|
+
console.log(`selftest ok · v${PKG_VERSION} · ${expected.length} tools (incl. analyze_profile) + keyless trial and batch-key guard + remote-path refusals + batch guards + measureStatus and round on by default`);
|
|
431
460
|
process.exit(0);
|
|
432
461
|
}
|
|
433
462
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@audiolabtools/mcp-server",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"mcpName": "tools.audiolab/audiolab",
|
|
5
5
|
"description": "MCP server for AudioLab, loudness (EBU R128 / BS.1770-4), true-peak, voice-quality, and signal analysis for AI agents (Claude, Cursor, any MCP client), via the AudioLab hosted API. No local audio engine required.",
|
|
6
6
|
"type": "module",
|