@speakai/mcp-server 1.21.2 → 1.23.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/dist/index.js +61 -43
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1358,6 +1358,40 @@ var init_dist = __esm({
|
|
|
1358
1358
|
}
|
|
1359
1359
|
});
|
|
1360
1360
|
|
|
1361
|
+
// src/media-utils.ts
|
|
1362
|
+
function isVideoFile(filePath) {
|
|
1363
|
+
return VIDEO_EXTENSIONS.includes(path.extname(filePath).toLowerCase());
|
|
1364
|
+
}
|
|
1365
|
+
function getMimeType(filePath) {
|
|
1366
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
1367
|
+
const isVideo = isVideoFile(filePath);
|
|
1368
|
+
if (ext === ".mp4") return isVideo ? "video/mp4" : "audio/mp4";
|
|
1369
|
+
if (ext === ".webm") return isVideo ? "video/webm" : "audio/webm";
|
|
1370
|
+
return MIME_TYPES[ext] ?? (isVideo ? "video/mp4" : "audio/mpeg");
|
|
1371
|
+
}
|
|
1372
|
+
function detectMediaType(filePath) {
|
|
1373
|
+
return isVideoFile(filePath) ? "video" : "audio";
|
|
1374
|
+
}
|
|
1375
|
+
var path, VIDEO_EXTENSIONS, MIME_TYPES;
|
|
1376
|
+
var init_media_utils = __esm({
|
|
1377
|
+
"src/media-utils.ts"() {
|
|
1378
|
+
"use strict";
|
|
1379
|
+
path = __toESM(require("path"));
|
|
1380
|
+
VIDEO_EXTENSIONS = [".mp4", ".mov", ".avi", ".mkv", ".webm", ".wmv"];
|
|
1381
|
+
MIME_TYPES = {
|
|
1382
|
+
".mp3": "audio/mpeg",
|
|
1383
|
+
".m4a": "audio/mp4",
|
|
1384
|
+
".wav": "audio/wav",
|
|
1385
|
+
".ogg": "audio/ogg",
|
|
1386
|
+
".flac": "audio/flac",
|
|
1387
|
+
".mov": "video/quicktime",
|
|
1388
|
+
".avi": "video/x-msvideo",
|
|
1389
|
+
".mkv": "video/x-matroska",
|
|
1390
|
+
".wmv": "video/x-ms-wmv"
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
});
|
|
1394
|
+
|
|
1361
1395
|
// src/tools/media.ts
|
|
1362
1396
|
var media_exports = {};
|
|
1363
1397
|
__export(media_exports, {
|
|
@@ -1372,9 +1406,9 @@ function register(server, client) {
|
|
|
1372
1406
|
"get_signed_upload_url",
|
|
1373
1407
|
"Get a pre-signed S3 URL for direct file upload to Speak AI storage. After getting the URL, PUT your file to it, then call upload_media with the S3 URL. For a simpler workflow, use upload_local_file instead which handles all steps automatically.",
|
|
1374
1408
|
{
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
mimeType: import_zod2.z.string().describe('MIME type
|
|
1409
|
+
filename: import_zod2.z.string().min(1).describe('Original filename including extension, e.g. "interview.mp4". The extension decides audio vs video and the storage path, so it must match the real file \u2014 a video named ".mp3" is stored as audio and can never be analysed as video.'),
|
|
1410
|
+
isVideo: import_zod2.z.boolean().optional().describe("Override the audio/video decision. Omit to derive it from the filename extension (recommended); only set this when the extension does not reflect the real container."),
|
|
1411
|
+
mimeType: import_zod2.z.string().optional().describe('MIME type, e.g. "video/mp4". Omit to derive it from the filename extension.')
|
|
1378
1412
|
},
|
|
1379
1413
|
{
|
|
1380
1414
|
title: "Get Signed Upload URL",
|
|
@@ -1385,8 +1419,10 @@ function register(server, client) {
|
|
|
1385
1419
|
},
|
|
1386
1420
|
async ({ isVideo, filename, mimeType }) => {
|
|
1387
1421
|
try {
|
|
1422
|
+
const resolvedIsVideo = isVideo ?? isVideoFile(filename);
|
|
1423
|
+
const resolvedMimeType = mimeType ?? getMimeType(filename);
|
|
1388
1424
|
const result = await api.get("/v1/media/upload/signedurl", {
|
|
1389
|
-
params: { isVideo, filename, mimeType }
|
|
1425
|
+
params: { isVideo: resolvedIsVideo, filename, mimeType: resolvedMimeType }
|
|
1390
1426
|
});
|
|
1391
1427
|
return {
|
|
1392
1428
|
content: [
|
|
@@ -1408,7 +1444,7 @@ function register(server, client) {
|
|
|
1408
1444
|
{
|
|
1409
1445
|
name: import_zod2.z.string().min(1).describe("Display name for the media file"),
|
|
1410
1446
|
url: import_zod2.z.string().describe("Direct/public media file URL, pre-signed S3 URL, or a shareable social/video page link (e.g. an Instagram reel or TikTok URL) \u2014 page links are resolved to the underlying media server-side."),
|
|
1411
|
-
mediaType: import_zod2.z.enum([MediaType.AUDIO, MediaType.VIDEO]).describe(
|
|
1447
|
+
mediaType: import_zod2.z.enum([MediaType.AUDIO, MediaType.VIDEO]).optional().describe(`Type of media: "audio" or "video". Omit to derive it from the URL's file extension (recommended). Set it only when the URL has no usable extension; a video labelled "audio" here can never be analysed as video.`),
|
|
1412
1448
|
description: import_zod2.z.string().optional().describe("Description of the media file"),
|
|
1413
1449
|
sourceLanguage: import_zod2.z.string().optional().describe('BCP-47 language code for transcription, e.g. "en-US" or "he-IL"'),
|
|
1414
1450
|
tags: import_zod2.z.string().optional().describe("Comma-separated tags for the media"),
|
|
@@ -1430,7 +1466,9 @@ function register(server, client) {
|
|
|
1430
1466
|
},
|
|
1431
1467
|
async (body) => {
|
|
1432
1468
|
try {
|
|
1433
|
-
const
|
|
1469
|
+
const urlPath = body.url.split(/[?#]/)[0];
|
|
1470
|
+
const mediaType = body.mediaType ?? detectMediaType(urlPath);
|
|
1471
|
+
const result = await api.post("/v1/media/upload", { ...body, mediaType });
|
|
1434
1472
|
return {
|
|
1435
1473
|
content: [
|
|
1436
1474
|
{ type: "text", text: JSON.stringify(result.data, null, 2) }
|
|
@@ -1978,6 +2016,7 @@ var init_media3 = __esm({
|
|
|
1978
2016
|
init_helpers();
|
|
1979
2017
|
init_client();
|
|
1980
2018
|
init_dist();
|
|
2019
|
+
init_media_utils();
|
|
1981
2020
|
LIST_MEDIA_DEFAULT_PAGE_SIZE = 25;
|
|
1982
2021
|
LIST_MEDIA_MAX_PAGE_SIZE = 100;
|
|
1983
2022
|
}
|
|
@@ -3248,8 +3287,21 @@ function register7(server, client) {
|
|
|
3248
3287
|
"Check whether a media file can be analysed as audio or video, and what it will cost, before running ask_ai_chat with analysisInput. Returns { eligible, credits, seconds } and, when not eligible, a plain-English reason \u2014 an unavailable file is a normal result here, not an error. This is the only check that accounts for both the account's premium opt-in and the server-wide switch, so call it before committing to an expensive run.",
|
|
3249
3288
|
{
|
|
3250
3289
|
mediaId: import_zod8.z.string().min(1).describe("Media file to price"),
|
|
3251
|
-
|
|
3252
|
-
|
|
3290
|
+
modelId: import_zod8.z.string().optional().describe("Optional model id to price against. Omit for the workspace default."),
|
|
3291
|
+
assistantType: import_zod8.z.enum(Object.values(AssistantType)).optional().describe("Assistant persona: 'general' (default), 'researcher' (academic), 'marketer' (content), 'sales' (deals), 'recruiter' (hiring). Use 'custom' with assistantTemplateId."),
|
|
3292
|
+
assistantTemplateId: import_zod8.z.string().optional().describe("Required when assistantType is 'custom'. ID of a custom assistant template from list_prompts."),
|
|
3293
|
+
promptId: import_zod8.z.string().optional().describe("ID of an existing conversation to continue. Pass this to maintain chat context across multiple questions."),
|
|
3294
|
+
speakers: import_zod8.z.array(import_zod8.z.string()).optional().describe("Filter to specific speaker IDs from the transcript"),
|
|
3295
|
+
tags: import_zod8.z.array(import_zod8.z.string()).optional().describe("Filter media by tags"),
|
|
3296
|
+
startDate: import_zod8.z.string().optional().describe("Start date for date range filter (ISO 8601, e.g., '2025-01-01')"),
|
|
3297
|
+
endDate: import_zod8.z.string().optional().describe("End date for date range filter (ISO 8601, e.g., '2025-03-31')"),
|
|
3298
|
+
isIndividualPrompt: import_zod8.z.boolean().optional().describe("When true, processes each media file separately instead of combining context. Useful for comparing responses across files."),
|
|
3299
|
+
analysisInput: import_zod8.z.enum(["audio", "video"]).optional().describe(
|
|
3300
|
+
"Send the media itself to a multimodal model, not just its transcript. 'audio' analyses tone, pacing, and delivery; 'video' analyses on-screen visuals, gestures, and slides. Requires analysisMediaId. The workspace must have multimodal analysis enabled and the file must be a supported container within the duration limit, otherwise the turn runs transcript-only."
|
|
3301
|
+
),
|
|
3302
|
+
analysisMediaId: import_zod8.z.string().optional().describe(
|
|
3303
|
+
"The mediaId to analyse multimodally this turn. Required together with analysisInput, and it must be one of the ids in mediaIds; either field alone is rejected."
|
|
3304
|
+
)
|
|
3253
3305
|
},
|
|
3254
3306
|
{
|
|
3255
3307
|
title: "Get Analysis Quote",
|
|
@@ -3847,7 +3899,7 @@ function register9(server, client) {
|
|
|
3847
3899
|
registerSpeakTool(
|
|
3848
3900
|
server,
|
|
3849
3901
|
"list_fields",
|
|
3850
|
-
"List all custom fields defined in the workspace.",
|
|
3902
|
+
"List all custom fields defined in the workspace. Each field returns a `slug` (for example `regulator_comment`) alongside its `id`, `name`, and `type`. Put `{{field.<slug>}}` in the prompt text you send and Speak substitutes that field's value for the media before the model sees it. A slug is unique per company and never changes when the field is renamed, so prefer it over the field name. A field with no slug yet resolves by `id` in the same token.",
|
|
3851
3903
|
{},
|
|
3852
3904
|
{
|
|
3853
3905
|
title: "List Custom Fields",
|
|
@@ -5046,40 +5098,6 @@ var init_clips = __esm({
|
|
|
5046
5098
|
}
|
|
5047
5099
|
});
|
|
5048
5100
|
|
|
5049
|
-
// src/media-utils.ts
|
|
5050
|
-
function isVideoFile(filePath) {
|
|
5051
|
-
return VIDEO_EXTENSIONS.includes(path.extname(filePath).toLowerCase());
|
|
5052
|
-
}
|
|
5053
|
-
function getMimeType(filePath) {
|
|
5054
|
-
const ext = path.extname(filePath).toLowerCase();
|
|
5055
|
-
const isVideo = isVideoFile(filePath);
|
|
5056
|
-
if (ext === ".mp4") return isVideo ? "video/mp4" : "audio/mp4";
|
|
5057
|
-
if (ext === ".webm") return isVideo ? "video/webm" : "audio/webm";
|
|
5058
|
-
return MIME_TYPES[ext] ?? (isVideo ? "video/mp4" : "audio/mpeg");
|
|
5059
|
-
}
|
|
5060
|
-
function detectMediaType(filePath) {
|
|
5061
|
-
return isVideoFile(filePath) ? "video" : "audio";
|
|
5062
|
-
}
|
|
5063
|
-
var path, VIDEO_EXTENSIONS, MIME_TYPES;
|
|
5064
|
-
var init_media_utils = __esm({
|
|
5065
|
-
"src/media-utils.ts"() {
|
|
5066
|
-
"use strict";
|
|
5067
|
-
path = __toESM(require("path"));
|
|
5068
|
-
VIDEO_EXTENSIONS = [".mp4", ".mov", ".avi", ".mkv", ".webm", ".wmv"];
|
|
5069
|
-
MIME_TYPES = {
|
|
5070
|
-
".mp3": "audio/mpeg",
|
|
5071
|
-
".m4a": "audio/mp4",
|
|
5072
|
-
".wav": "audio/wav",
|
|
5073
|
-
".ogg": "audio/ogg",
|
|
5074
|
-
".flac": "audio/flac",
|
|
5075
|
-
".mov": "video/quicktime",
|
|
5076
|
-
".avi": "video/x-msvideo",
|
|
5077
|
-
".mkv": "video/x-matroska",
|
|
5078
|
-
".wmv": "video/x-ms-wmv"
|
|
5079
|
-
};
|
|
5080
|
-
}
|
|
5081
|
-
});
|
|
5082
|
-
|
|
5083
5101
|
// src/tools/workflows.ts
|
|
5084
5102
|
var workflows_exports = {};
|
|
5085
5103
|
__export(workflows_exports, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speakai/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.0",
|
|
4
4
|
"mcpName": "io.github.speakai/mcp-server",
|
|
5
5
|
"description": "Official Speak AI MCP Server — capture meetings, search thousands of recordings, run async voice and video surveys, create clips, and automate workflows from your AI assistant.",
|
|
6
6
|
"homepage": "https://docs.speakai.co/mcp",
|