@quiki/mcp 0.5.0 → 0.6.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 (39) hide show
  1. package/README.md +47 -7
  2. package/dist/index.d.ts +12 -4
  3. package/dist/index.js +29 -8
  4. package/dist/nextCursor.d.ts +3 -0
  5. package/dist/nextCursor.js +11 -0
  6. package/dist/outputSchemas.d.ts +267 -0
  7. package/dist/outputSchemas.js +232 -0
  8. package/dist/tools/addToFolder.d.ts +43 -0
  9. package/dist/tools/addToFolder.js +69 -0
  10. package/dist/tools/bulkImport.d.ts +18 -0
  11. package/dist/tools/bulkImport.js +2 -0
  12. package/dist/tools/bulkImportEstimate.d.ts +17 -0
  13. package/dist/tools/bulkImportEstimate.js +2 -0
  14. package/dist/tools/createFolder.d.ts +41 -0
  15. package/dist/tools/createFolder.js +50 -0
  16. package/dist/tools/getBulkImportStatus.d.ts +21 -0
  17. package/dist/tools/getBulkImportStatus.js +3 -1
  18. package/dist/tools/getScan.d.ts +31 -0
  19. package/dist/tools/getScan.js +2 -0
  20. package/dist/tools/getVideo.d.ts +46 -0
  21. package/dist/tools/getVideo.js +27 -6
  22. package/dist/tools/listBulkImports.d.ts +45 -0
  23. package/dist/tools/listBulkImports.js +55 -0
  24. package/dist/tools/listFolderVideos.d.ts +65 -0
  25. package/dist/tools/listFolderVideos.js +64 -0
  26. package/dist/tools/listFolders.d.ts +27 -0
  27. package/dist/tools/listFolders.js +29 -0
  28. package/dist/tools/listRecentVideos.d.ts +29 -0
  29. package/dist/tools/listRecentVideos.js +22 -4
  30. package/dist/tools/scanUrl.d.ts +31 -0
  31. package/dist/tools/scanUrl.js +2 -0
  32. package/dist/tools/searchVideos.d.ts +88 -0
  33. package/dist/tools/searchVideos.js +91 -0
  34. package/dist/tools/whoami.d.ts +14 -0
  35. package/dist/tools/whoami.js +2 -0
  36. package/dist/types.d.ts +108 -7
  37. package/dist/version.d.ts +1 -1
  38. package/dist/version.js +1 -1
  39. package/package.json +3 -3
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ // search_videos — wraps GET /api/v1/videos/search (server 1.2.72+).
3
+ // Read scope, PRO tier. Same search grammar as the web library search.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.searchVideosTool = exports.searchVideosInputShape = void 0;
6
+ const zod_1 = require("zod");
7
+ const outputSchemas_1 = require("../outputSchemas");
8
+ const nextCursor_1 = require("../nextCursor");
9
+ exports.searchVideosInputShape = {
10
+ q: zod_1.z
11
+ .string()
12
+ .max(500)
13
+ .optional()
14
+ .describe('Search text, up to 500 characters. Supports "exact phrase", -excluded, A OR B, and the filters platform:, author:, folder:"Name", folder:unfiled and has:transcript.'),
15
+ platform: zod_1.z
16
+ .enum(['tiktok', 'youtube', 'instagram', 'youtube-shorts'])
17
+ .optional()
18
+ .describe('Only videos from this platform.'),
19
+ folder_id: zod_1.z
20
+ .string()
21
+ .min(1)
22
+ .optional()
23
+ .describe('Only videos in this folder (an id from `list_folders`), or "unfiled" for videos in no folder.'),
24
+ author: zod_1.z
25
+ .string()
26
+ .max(200)
27
+ .optional()
28
+ .describe('Only videos whose author name contains this text.'),
29
+ limit: zod_1.z
30
+ .number()
31
+ .int()
32
+ .min(1)
33
+ .max(50)
34
+ .optional()
35
+ .describe('Results per page. Default 10, max 50.'),
36
+ cursor: zod_1.z
37
+ .string()
38
+ .min(1)
39
+ .optional()
40
+ .describe('The `nextCursor` from the previous page. Send the same q and filters with it.'),
41
+ };
42
+ const InputSchema = zod_1.z.object(exports.searchVideosInputShape);
43
+ exports.searchVideosTool = {
44
+ name: 'search_videos',
45
+ // Reads only; safe for a client to auto-approve.
46
+ annotations: {
47
+ title: 'Search the video library',
48
+ readOnlyHint: true,
49
+ destructiveHint: false,
50
+ idempotentHint: true,
51
+ openWorldHint: false,
52
+ },
53
+ outputSchema: outputSchemas_1.SearchVideosOutput,
54
+ description: [
55
+ "Searches the authenticated user's video library, the same search as the Quiki web app. Give at least one of `q`, `platform`, `folder_id` or `author`.",
56
+ '',
57
+ 'Search text (`q`) matches title, description, hashtags, author, AI summary, notes, transcript and the detailed AI analysis, case-insensitively. Grammar:',
58
+ '- words: every word must match (AND). Words shorter than 2 characters are ignored.',
59
+ '- "exact phrase": match the phrase as written.',
60
+ '- -word or -"phrase": leave out videos that match.',
61
+ '- A OR B (uppercase OR): either term.',
62
+ '- platform:tiktok (or youtube, instagram, youtube-shorts), author:name, folder:"Folder Name", folder:unfiled, has:transcript.',
63
+ 'The `platform`, `folder_id` and `author` arguments do the same as the filters inside `q`, and combine with it.',
64
+ '',
65
+ 'Results are newest first by publish date. Each result is the same trimmed shape as `list_recent_videos`, plus `matched_in` naming the fields that matched (e.g. "title", "transcript"). Call `get_video(id)` for the full record, or with `fields: ["summary"]` to skim. `total` is the number of matches across all pages. `warnings` explains parts of `q` that were ignored or reinterpreted (a short term, an unknown filter value, a folder name that matched several folders). `unknown_folder` means a `folder:"Name"` matched none of your folders, so nothing is returned rather than searching everything; check names with `list_folders`. `results_truncated` means only the first 10,000 matches can be paged: when `nextCursor` is null with that warning, more matches exist, so narrow the search; if nothing searchable is left you get no results and a `no_searchable_terms` warning.',
66
+ '',
67
+ 'Paging: when `nextCursor` is not null, call again with `cursor` set to it and the SAME `q`, filters and `limit`, otherwise the cursor is rejected. A page can hold fewer than `limit` results even when more follow (failed scans are left out), so keep going until `nextCursor` is null rather than stopping at a short page. Searches are limited to 30 per minute per token.',
68
+ '',
69
+ "The starter videos Quiki adds to a new account are part of the library, so they can appear in results. Failed scans never do.",
70
+ '',
71
+ 'Read scope, PRO plan.',
72
+ ].join('\n'),
73
+ inputShape: InputSchema,
74
+ async handler(client, args) {
75
+ const parsed = InputSchema.parse(args);
76
+ const params = {};
77
+ if (parsed.q !== undefined)
78
+ params.q = parsed.q;
79
+ if (parsed.platform !== undefined)
80
+ params.platform = parsed.platform;
81
+ if (parsed.folder_id !== undefined)
82
+ params.folder_id = parsed.folder_id;
83
+ if (parsed.author !== undefined)
84
+ params.author = parsed.author;
85
+ if (parsed.limit !== undefined)
86
+ params.limit = parsed.limit;
87
+ if (parsed.cursor !== undefined)
88
+ params.cursor = parsed.cursor;
89
+ return (0, nextCursor_1.withNextCursor)(await client.get('/videos/search', params));
90
+ },
91
+ };
@@ -10,6 +10,20 @@ export declare const whoamiTool: {
10
10
  idempotentHint: true;
11
11
  openWorldHint: false;
12
12
  };
13
+ outputSchema: z.ZodObject<{
14
+ id: z.ZodString;
15
+ email: z.ZodNullable<z.ZodString>;
16
+ tier: z.ZodString;
17
+ credits: z.ZodOptional<z.ZodObject<{
18
+ balance: z.ZodNumber;
19
+ }, z.core.$loose>>;
20
+ dailyScans: z.ZodOptional<z.ZodNullable<z.ZodObject<{
21
+ limit: z.ZodNumber;
22
+ used: z.ZodNumber;
23
+ remaining: z.ZodNumber;
24
+ resetsAt: z.ZodString;
25
+ }, z.core.$loose>>>;
26
+ }, z.core.$loose>;
13
27
  description: string;
14
28
  inputSchema: {};
15
29
  inputShape: z.ZodObject<{}, z.core.$strip>;
@@ -5,6 +5,7 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.whoamiTool = void 0;
7
7
  const zod_1 = require("zod");
8
+ const outputSchemas_1 = require("../outputSchemas");
8
9
  exports.whoamiTool = {
9
10
  name: 'whoami',
10
11
  // Reads only; safe for a client to auto-approve.
@@ -15,6 +16,7 @@ exports.whoamiTool = {
15
16
  idempotentHint: true,
16
17
  openWorldHint: false,
17
18
  },
19
+ outputSchema: outputSchemas_1.WhoamiOutput,
18
20
  // v0.5.0: mentions the credit fields added to GET /api/v1/me in server
19
21
  // v1.2.71. The old text said scan_url needs `pro` or `admin`; FREE has been
20
22
  // able to run fast scans since server v1.1.7, so that line was dropped.
package/dist/types.d.ts CHANGED
@@ -11,7 +11,8 @@ export interface DailyScanAllowance {
11
11
  }
12
12
  export interface WhoamiResponse {
13
13
  id: string;
14
- email: string;
14
+ /** null for an account created with Sign in with Apple that shared no email. */
15
+ email: string | null;
15
16
  tier: Tier;
16
17
  credits?: {
17
18
  balance: number;
@@ -42,6 +43,11 @@ export interface ScanResponse {
42
43
  mode: Mode;
43
44
  created_at: string;
44
45
  completed_at?: string;
46
+ /** Present while a queued scan waits for a delayed retry (server 1.2.42+). */
47
+ retry?: {
48
+ attempt: number;
49
+ next_attempt_at: string;
50
+ };
45
51
  video_id?: number;
46
52
  result?: ScanResult;
47
53
  error?: {
@@ -75,16 +81,25 @@ interface VideoCore {
75
81
  first_scanned_at: string;
76
82
  scanned_at: string;
77
83
  }
78
- export type VideoResponse = (VideoCore & {
84
+ /**
85
+ * The optional sections of get_video. Without `fields` the server returns all
86
+ * that apply; with `fields` it returns core + metadata plus only those listed
87
+ * (server 1.2.72+), so every section is optional here.
88
+ */
89
+ export type VideoField = 'summary' | 'transcript' | 'ai_analysis' | 'images';
90
+ interface VideoSections {
91
+ /** Short AI summary (server 1.2.72+). null when the video has none. */
92
+ summary?: string | null;
93
+ ai_analysis?: Record<string, unknown>;
94
+ }
95
+ export type VideoResponse = (VideoCore & VideoSections & {
79
96
  media_type: 'video';
80
97
  metadata: VideoMetadataVideo;
81
- transcript: string | null;
82
- ai_analysis?: Record<string, unknown>;
83
- }) | (VideoCore & {
98
+ transcript?: string | null;
99
+ }) | (VideoCore & VideoSections & {
84
100
  media_type: 'photo';
85
101
  metadata: VideoMetadataPhoto;
86
- images: string[];
87
- ai_analysis?: Record<string, unknown>;
102
+ images?: string[];
88
103
  });
89
104
  export type VideoSummary = (VideoCore & {
90
105
  media_type: 'video';
@@ -102,6 +117,74 @@ export type VideoSummaryWithStatus = VideoSummary & {
102
117
  };
103
118
  export interface RecentVideosResponse {
104
119
  videos: Array<VideoSummary | VideoSummaryWithStatus>;
120
+ /**
121
+ * Cursor for the next page (server 1.2.72+). The tool returns null when the
122
+ * server omits it (older servers do not page).
123
+ */
124
+ nextCursor: string | null;
125
+ }
126
+ export interface SearchWarning {
127
+ code: string;
128
+ message?: string;
129
+ token?: string;
130
+ [extra: string]: unknown;
131
+ }
132
+ export type SearchVideoSummary = VideoSummary & {
133
+ /** Which fields matched, e.g. 'title', 'transcript'. */
134
+ matched_in?: string[];
135
+ };
136
+ export interface SearchVideosResponse {
137
+ videos: SearchVideoSummary[];
138
+ /** Total matches across all pages. */
139
+ total: number;
140
+ nextCursor: string | null;
141
+ warnings?: SearchWarning[];
142
+ }
143
+ export interface Folder {
144
+ id: string;
145
+ name: string;
146
+ parent_id: string | null;
147
+ sort_order: number;
148
+ video_count: number;
149
+ created_at: string;
150
+ updated_at: string;
151
+ }
152
+ export interface ListFoldersResponse {
153
+ folders: Folder[];
154
+ }
155
+ export interface FolderVideosResponse {
156
+ /** null for `unfiled`. */
157
+ folder: {
158
+ id: string;
159
+ name: string;
160
+ } | null;
161
+ videos: Array<VideoSummary | VideoSummaryWithStatus>;
162
+ nextCursor: string | null;
163
+ }
164
+ export interface CreateFolderResponse {
165
+ folder: Folder;
166
+ /** false when an existing folder with the same name (any case) under the same parent was returned. */
167
+ created: boolean;
168
+ }
169
+ /**
170
+ * POST /folders/:id/videos. Each group lists the ids of the requested videos
171
+ * it applies to; every requested id lands in exactly one group.
172
+ */
173
+ export interface AddToFolderResponse {
174
+ folder: {
175
+ id: string;
176
+ name: string;
177
+ };
178
+ /** Was in no folder; now in this one. */
179
+ added: number[];
180
+ /** Was in another folder; moved here (only with move: true). */
181
+ moved_from_other_folder: number[];
182
+ /** Already in this folder; nothing written. */
183
+ already_in_folder: number[];
184
+ /** In another folder and left there (move was false). */
185
+ in_other_folder: number[];
186
+ /** No such video in this library. */
187
+ not_found: number[];
105
188
  }
106
189
  export interface BulkImportSubmitResponse {
107
190
  bulkImportId: string;
@@ -187,4 +270,22 @@ export interface BulkImportStatusResponse {
187
270
  /** Same value as `jobStats.skipped`. Not included in `failedVideos`. */
188
271
  skippedVideos: number;
189
272
  }
273
+ /** One row of GET /bulk-imports: the stored counters, no live jobStats. */
274
+ export interface BulkImportListItem {
275
+ id: string;
276
+ fileName: string | null;
277
+ status: string;
278
+ totalVideos: number;
279
+ processedVideos: number;
280
+ failedVideos: number;
281
+ skippedVideos: number;
282
+ skippedAsDuplicate: number;
283
+ createdAt: string;
284
+ updatedAt: string;
285
+ completedAt: string | null;
286
+ }
287
+ export interface ListBulkImportsResponse {
288
+ bulkImports: BulkImportListItem[];
289
+ nextCursor: string | null;
290
+ }
190
291
  export {};
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "0.5.0";
1
+ export declare const PACKAGE_VERSION = "0.6.0";
package/dist/version.js CHANGED
@@ -4,4 +4,4 @@ exports.PACKAGE_VERSION = void 0;
4
4
  // Single source for the package version: reported to MCP clients by the
5
5
  // server (index.ts) and sent to Quiki as the User-Agent (apiClient.ts).
6
6
  // Keep in step with package.json (a test checks this).
7
- exports.PACKAGE_VERSION = '0.5.0';
7
+ exports.PACKAGE_VERSION = '0.6.0';
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@quiki/mcp",
3
- "version": "0.5.0",
4
- "description": "Quiki.io MCP server — whoami, scan_url, get_scan, list_recent_videos, get_video, bulk_import, bulk_import_estimate, get_bulk_import_status over stdio.",
3
+ "version": "0.6.1",
4
+ "description": "Quiki.io MCP server: whoami, scan_url, get_scan, list_recent_videos, get_video, search_videos, list_folders, list_folder_videos, create_folder, add_to_folder, bulk_import, bulk_import_estimate, get_bulk_import_status, list_bulk_imports over stdio.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
7
7
  "bin": {
8
- "quiki-mcp": "./dist/index.js"
8
+ "quiki-mcp": "dist/index.js"
9
9
  },
10
10
  "main": "./dist/index.js",
11
11
  "files": [