@speakai/mcp-server 1.35.0 → 1.36.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 CHANGED
@@ -242,7 +242,7 @@ For questions about data handling, see [speakai.co/privacy](https://speakai.co/p
242
242
 
243
243
  ## What you can do once installed
244
244
 
245
- Speak AI ships 184 tools your AI assistant can call. You don't memorize them — Claude/ChatGPT pick the right ones based on what you ask. Examples by category:
245
+ Speak AI ships 185 tools your AI assistant can call. You don't memorize them — Claude/ChatGPT pick the right ones based on what you ask. Examples by category:
246
246
 
247
247
  | Ask | Tools used (auto) |
248
248
  |---|---|
@@ -394,10 +394,10 @@ SPEAK_API_KEY=your-key npx @speakai/mcp-server
394
394
  | `SPEAK_ACCESS_TOKEN` | No | Auto-managed | JWT access token (auto-fetched and refreshed) |
395
395
  | `SPEAK_BASE_URL` | No | `https://api.speakai.co` | API base URL |
396
396
 
397
- ### MCP Tools (184)
397
+ ### MCP Tools (185)
398
398
 
399
399
  <details>
400
- <summary>Media (18 tools)</summary>
400
+ <summary>Media (19 tools)</summary>
401
401
 
402
402
  | Tool | Description |
403
403
  |---|---|
@@ -414,6 +414,7 @@ SPEAK_API_KEY=your-key npx @speakai/mcp-server
414
414
  | `bulk_update_transcript_speakers` | Rename speaker labels across multiple media files in one call (max 500) |
415
415
  | `get_media_status` | Check processing status (pending → processed) |
416
416
  | `update_media_metadata` | Update name, description, tags, or folder |
417
+ | `set_media_thumbnail` | Set a custom video thumbnail from an image link, base64 image bytes, or a frame at a given second (JPEG, PNG or WebP, up to 10 MB) |
417
418
  | `delete_media` | Permanently delete a media file |
418
419
  | `toggle_media_favorite` | Mark or unmark media as a favorite |
419
420
  | `reanalyze_media` | Re-run AI analysis with latest models |
package/dist/index.js CHANGED
@@ -4414,6 +4414,13 @@ function getMimeType(filePath) {
4414
4414
  function detectMediaType(filePath) {
4415
4415
  return isVideoFile(filePath) ? "video" : "audio";
4416
4416
  }
4417
+ function detectImageMimeType(bytes) {
4418
+ const ascii = (start, end) => String.fromCharCode(...bytes.subarray(start, end));
4419
+ if (bytes[0] === 255 && bytes[1] === 216 && bytes[2] === 255) return "image/jpeg";
4420
+ if (bytes.length >= 8 && bytes[0] === 137 && ascii(1, 8) === "PNG\r\n\n") return "image/png";
4421
+ if (bytes.length >= 12 && ascii(0, 4) === "RIFF" && ascii(8, 12) === "WEBP") return "image/webp";
4422
+ return null;
4423
+ }
4417
4424
  var path, VIDEO_EXTENSIONS, MIME_TYPES, SUPPORTED_URL_SOURCES, UNSUPPORTED_URL_SOURCES;
4418
4425
  var init_media_utils = __esm({
4419
4426
  "src/media-utils.ts"() {
@@ -4583,7 +4590,7 @@ function register(server, client) {
4583
4590
  registerSpeakTool(
4584
4591
  server,
4585
4592
  "get_media_insights",
4586
- "Retrieve AI-generated insights for a processed media file \u2014 topics, sentiment, keywords, action items, summaries, and more. The media must be in 'processed' state (check with get_media_status first). For asking custom questions about a media file, use ask_ai_chat instead.",
4593
+ "Retrieve AI-generated insights for a processed media file \u2014 topics, sentiment, keywords, action items, summaries, and more. The media must be in 'processed' state (check with get_media_status first). For asking custom questions about a media file, use ask_ai_chat instead. For a video, data.thumbnail has the thumbnail: url, source (auto or custom), pending while a requested frame is being made, and error if that frame failed.",
4587
4594
  {
4588
4595
  mediaId: import_zod2.z.string().min(1).describe("Unique identifier of the media file")
4589
4596
  },
@@ -4722,7 +4729,7 @@ function register(server, client) {
4722
4729
  registerSpeakTool(
4723
4730
  server,
4724
4731
  "get_media_status",
4725
- "Check the processing status of a media file. States: pending \u2192 transcribing \u2192 analyzing \u2192 processed (or failed). Poll this after upload_media until state is 'processed', then use get_transcript and get_media_insights to retrieve results.",
4732
+ "Check the processing status of a media file. States: pending \u2192 transcribing \u2192 analyzing \u2192 processed (or failed). Poll this after upload_media until state is 'processed', then use get_transcript and get_media_insights to retrieve results. For a video, data.thumbnail has the thumbnail: url, source (auto or custom), pending while a requested frame is being made, and error if that frame failed.",
4726
4733
  {
4727
4734
  mediaId: import_zod2.z.string().min(1).describe("Unique identifier of the media file")
4728
4735
  },
@@ -5049,8 +5056,74 @@ function register(server, client) {
5049
5056
  }
5050
5057
  }
5051
5058
  );
5059
+ registerSpeakTool(
5060
+ server,
5061
+ "set_media_thumbnail",
5062
+ "Set a custom thumbnail for a video. Send exactly one of imageUrl, imageBase64 or atSeconds. The image must be JPEG, PNG or WebP and at most 10 MB; the type is judged from the file bytes, not the name. atSeconds uses the video frame at that moment; this tool waits up to 60 seconds for the frame and returns its url, or says it is still processing (check later with get_media_status, which carries the thumbnail field). Each call replaces the current custom thumbnail, and there is no way back to the automatic one. Needs permission to edit the media. Errors: 400 bad input, unsupported image, blocked link or failed frame; 413 image too large; 409 a frame is already being made; 503 frame service busy, try again shortly.",
5063
+ {
5064
+ mediaId: import_zod2.z.string().min(1).describe("Unique identifier of the video"),
5065
+ imageUrl: import_zod2.z.string().url().refine((value) => /^https:\/\//i.test(value), "imageUrl must be an https URL").optional().describe("A public https link to a JPEG, PNG or WebP image of at most 10 MB. The server downloads it."),
5066
+ imageBase64: import_zod2.z.string().min(1).optional().describe("The image bytes in base64 (JPEG, PNG or WebP, at most 10 MB once decoded). A data:image/...;base64, prefix is allowed."),
5067
+ atSeconds: import_zod2.z.number().min(0).optional().describe("Use the video frame at this many seconds from the start. Values past the end use the last second.")
5068
+ },
5069
+ {
5070
+ title: "Set Media Thumbnail",
5071
+ readOnlyHint: false,
5072
+ destructiveHint: true,
5073
+ idempotentHint: false,
5074
+ openWorldHint: true
5075
+ },
5076
+ async ({ mediaId, imageUrl, imageBase64, atSeconds }) => {
5077
+ const modes = [imageUrl, imageBase64, atSeconds].filter((value) => value !== void 0);
5078
+ if (modes.length !== 1) {
5079
+ return err(new Error("Send exactly one of imageUrl, imageBase64 or atSeconds."));
5080
+ }
5081
+ const path4 = `/v1/media/${mediaId}/thumbnail`;
5082
+ try {
5083
+ if (imageUrl !== void 0) {
5084
+ const result = await api.put(path4, { url: imageUrl });
5085
+ return ok(result.data);
5086
+ }
5087
+ if (imageBase64 !== void 0) {
5088
+ const bytes = Buffer.from(imageBase64.replace(/^data:[^,]*;base64,/i, ""), "base64");
5089
+ if (bytes.length === 0) {
5090
+ return err(new Error("imageBase64 decoded to an empty file."));
5091
+ }
5092
+ if (bytes.length > THUMBNAIL_MAX_BYTES) {
5093
+ return err(new Error("The image is larger than 10 MB."));
5094
+ }
5095
+ const mimeType = detectImageMimeType(bytes);
5096
+ if (!mimeType) {
5097
+ return err(new Error("The image must be a JPEG, PNG or WebP file."));
5098
+ }
5099
+ const form = new FormData();
5100
+ form.append("image", new Blob([bytes], { type: mimeType }), `thumbnail.${THUMBNAIL_FILE_EXTENSIONS[mimeType]}`);
5101
+ const result = await api.put(path4, form, { headers: { "Content-Type": "multipart/form-data" } });
5102
+ return ok(result.data);
5103
+ }
5104
+ await api.put(path4, { seekSec: atSeconds });
5105
+ const deadline = Date.now() + THUMBNAIL_POLL_TIMEOUT_MS;
5106
+ while (Date.now() < deadline) {
5107
+ await new Promise((resolve) => setTimeout(resolve, THUMBNAIL_POLL_INTERVAL_MS));
5108
+ const detail = await api.get(`/v1/media/status/${mediaId}`);
5109
+ const thumbnail = detail.data?.data?.thumbnail;
5110
+ if (!thumbnail || thumbnail.pending) continue;
5111
+ if (thumbnail?.error) {
5112
+ return err(new Error(`The frame could not be used: ${thumbnail.error}`));
5113
+ }
5114
+ return ok({ thumbnail });
5115
+ }
5116
+ return ok({
5117
+ thumbnail: { pending: true },
5118
+ message: "The frame is still processing. Check the thumbnail field with get_media_status in a minute."
5119
+ });
5120
+ } catch (error) {
5121
+ return err(error);
5122
+ }
5123
+ }
5124
+ );
5052
5125
  }
5053
- var import_zod2, LIST_MEDIA_DEFAULT_PAGE_SIZE, LIST_MEDIA_MAX_PAGE_SIZE;
5126
+ var import_zod2, LIST_MEDIA_DEFAULT_PAGE_SIZE, LIST_MEDIA_MAX_PAGE_SIZE, THUMBNAIL_MAX_BYTES, THUMBNAIL_POLL_TIMEOUT_MS, THUMBNAIL_POLL_INTERVAL_MS, THUMBNAIL_FILE_EXTENSIONS;
5054
5127
  var init_media3 = __esm({
5055
5128
  "src/tools/media.ts"() {
5056
5129
  "use strict";
@@ -5061,6 +5134,14 @@ var init_media3 = __esm({
5061
5134
  init_media_utils();
5062
5135
  LIST_MEDIA_DEFAULT_PAGE_SIZE = 25;
5063
5136
  LIST_MEDIA_MAX_PAGE_SIZE = 100;
5137
+ THUMBNAIL_MAX_BYTES = 10 * 1024 * 1024;
5138
+ THUMBNAIL_POLL_TIMEOUT_MS = 6e4;
5139
+ THUMBNAIL_POLL_INTERVAL_MS = 3e3;
5140
+ THUMBNAIL_FILE_EXTENSIONS = {
5141
+ "image/jpeg": "jpg",
5142
+ "image/png": "png",
5143
+ "image/webp": "webp"
5144
+ };
5064
5145
  }
5065
5146
  });
5066
5147
 
@@ -12682,6 +12763,7 @@ var init_tool_names = __esm({
12682
12763
  "search_media",
12683
12764
  "delete_media",
12684
12765
  "update_media_metadata",
12766
+ "set_media_thumbnail",
12685
12767
  "toggle_media_favorite",
12686
12768
  "reanalyze_media",
12687
12769
  "get_captions",
@@ -13973,7 +14055,8 @@ var SPEAK_MCP_TOOL_CATEGORIES = [
13973
14055
  "toggle_media_favorite",
13974
14056
  "reanalyze_media",
13975
14057
  "bulk_move_media",
13976
- "upload_and_analyze_batch"
14058
+ "upload_and_analyze_batch",
14059
+ "set_media_thumbnail"
13977
14060
  ]
13978
14061
  },
13979
14062
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@speakai/mcp-server",
3
- "version": "1.35.0",
3
+ "version": "1.36.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",