@speakai/mcp-server 1.22.0 → 1.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +60 -67
  2. 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
- isVideo: import_zod2.z.boolean().describe("Set true for video files, false for audio files"),
1376
- filename: import_zod2.z.string().min(1).describe("Original filename including extension"),
1377
- mimeType: import_zod2.z.string().describe('MIME type of the file, e.g. "audio/mp4" or "video/mp4"')
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('Type of media: "audio" or "video"'),
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 result = await api.post("/v1/media/upload", body);
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
  }
@@ -2633,27 +2672,6 @@ var recorder_exports = {};
2633
2672
  __export(recorder_exports, {
2634
2673
  register: () => register5
2635
2674
  });
2636
- function optionsFromMetaType(metaType) {
2637
- const bool = (v, fallback) => typeof v === "boolean" ? v : fallback;
2638
- const upload = metaType?.upload ?? {};
2639
- return {
2640
- audio: bool(metaType?.audio, true),
2641
- video: bool(metaType?.video, true),
2642
- screenShare: bool(metaType?.screenShare, false),
2643
- upload: {
2644
- file: bool(upload.file, true),
2645
- multiple: bool(upload.multiple, false),
2646
- url: bool(upload.url, false)
2647
- },
2648
- liveTranscription: bool(metaType?.liveTranscription, false)
2649
- };
2650
- }
2651
- function addRecorderOptions(recorder) {
2652
- if (recorder && typeof recorder === "object") {
2653
- recorder.options = optionsFromMetaType(recorder.meta?.type);
2654
- }
2655
- return recorder;
2656
- }
2657
2675
  function register5(server, client) {
2658
2676
  const api = client ?? speakClient;
2659
2677
  registerSpeakTool(
@@ -2705,7 +2723,6 @@ function register5(server, client) {
2705
2723
  async (body) => {
2706
2724
  try {
2707
2725
  const result = await api.post("/v1/recorder/create", body);
2708
- addRecorderOptions(result.data?.data?.recorderData);
2709
2726
  return {
2710
2727
  content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }]
2711
2728
  };
@@ -2736,7 +2753,6 @@ function register5(server, client) {
2736
2753
  async (params) => {
2737
2754
  try {
2738
2755
  const result = await api.get("/v1/recorder", { params });
2739
- result.data?.data?.recorderList?.forEach?.(addRecorderOptions);
2740
2756
  return {
2741
2757
  content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }]
2742
2758
  };
@@ -2796,7 +2812,6 @@ function register5(server, client) {
2796
2812
  async ({ recorderId }) => {
2797
2813
  try {
2798
2814
  const result = await api.get(`/v1/recorder/${recorderId}`);
2799
- addRecorderOptions(result.data?.data);
2800
2815
  return {
2801
2816
  content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }]
2802
2817
  };
@@ -2883,7 +2898,6 @@ function register5(server, client) {
2883
2898
  async ({ recorderId, ...body }) => {
2884
2899
  try {
2885
2900
  const result = await api.put(`/v1/recorder/settings/${recorderId}`, body);
2886
- addRecorderOptions(result.data?.data?.recorderData);
2887
2901
  return {
2888
2902
  content: [{ type: "text", text: JSON.stringify(result.data, null, 2) }]
2889
2903
  };
@@ -3248,8 +3262,21 @@ function register7(server, client) {
3248
3262
  "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
3263
  {
3250
3264
  mediaId: import_zod8.z.string().min(1).describe("Media file to price"),
3251
- analysisInput: import_zod8.z.enum(["audio", "video"]).describe("'audio' to hear the recording, 'video' to also see it. Video costs substantially more because frames dominate."),
3252
- modelId: import_zod8.z.string().optional().describe("Optional model id to price against. Omit for the workspace default.")
3265
+ modelId: import_zod8.z.string().optional().describe("Optional model id to price against. Omit for the workspace default."),
3266
+ 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."),
3267
+ assistantTemplateId: import_zod8.z.string().optional().describe("Required when assistantType is 'custom'. ID of a custom assistant template from list_prompts."),
3268
+ promptId: import_zod8.z.string().optional().describe("ID of an existing conversation to continue. Pass this to maintain chat context across multiple questions."),
3269
+ speakers: import_zod8.z.array(import_zod8.z.string()).optional().describe("Filter to specific speaker IDs from the transcript"),
3270
+ tags: import_zod8.z.array(import_zod8.z.string()).optional().describe("Filter media by tags"),
3271
+ startDate: import_zod8.z.string().optional().describe("Start date for date range filter (ISO 8601, e.g., '2025-01-01')"),
3272
+ endDate: import_zod8.z.string().optional().describe("End date for date range filter (ISO 8601, e.g., '2025-03-31')"),
3273
+ isIndividualPrompt: import_zod8.z.boolean().optional().describe("When true, processes each media file separately instead of combining context. Useful for comparing responses across files."),
3274
+ analysisInput: import_zod8.z.enum(["audio", "video"]).optional().describe(
3275
+ "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."
3276
+ ),
3277
+ analysisMediaId: import_zod8.z.string().optional().describe(
3278
+ "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."
3279
+ )
3253
3280
  },
3254
3281
  {
3255
3282
  title: "Get Analysis Quote",
@@ -5046,40 +5073,6 @@ var init_clips = __esm({
5046
5073
  }
5047
5074
  });
5048
5075
 
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
5076
  // src/tools/workflows.ts
5084
5077
  var workflows_exports = {};
5085
5078
  __export(workflows_exports, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@speakai/mcp-server",
3
- "version": "1.22.0",
3
+ "version": "1.23.1",
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",