@quiki/mcp 0.4.2 → 0.6.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.
Files changed (39) hide show
  1. package/README.md +68 -10
  2. package/dist/index.d.ts +28 -0
  3. package/dist/index.js +62 -99
  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 +25 -0
  11. package/dist/tools/bulkImport.js +11 -0
  12. package/dist/tools/bulkImportEstimate.d.ts +24 -0
  13. package/dist/tools/bulkImportEstimate.js +10 -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 +28 -0
  17. package/dist/tools/getBulkImportStatus.js +10 -0
  18. package/dist/tools/getScan.d.ts +38 -0
  19. package/dist/tools/getScan.js +10 -0
  20. package/dist/tools/getVideo.d.ts +53 -0
  21. package/dist/tools/getVideo.js +35 -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 +36 -0
  29. package/dist/tools/listRecentVideos.js +30 -4
  30. package/dist/tools/scanUrl.d.ts +38 -0
  31. package/dist/tools/scanUrl.js +11 -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 +21 -0
  35. package/dist/tools/whoami.js +20 -1
  36. package/dist/types.d.ts +121 -8
  37. package/dist/version.d.ts +1 -1
  38. package/dist/version.js +1 -1
  39. package/package.json +3 -3
@@ -0,0 +1,88 @@
1
+ import { z } from 'zod';
2
+ import type { ApiClient } from '../apiClient';
3
+ import type { SearchVideosResponse } from '../types';
4
+ export declare const searchVideosInputShape: {
5
+ q: z.ZodOptional<z.ZodString>;
6
+ platform: z.ZodOptional<z.ZodEnum<{
7
+ tiktok: "tiktok";
8
+ youtube: "youtube";
9
+ instagram: "instagram";
10
+ "youtube-shorts": "youtube-shorts";
11
+ }>>;
12
+ folder_id: z.ZodOptional<z.ZodString>;
13
+ author: z.ZodOptional<z.ZodString>;
14
+ limit: z.ZodOptional<z.ZodNumber>;
15
+ cursor: z.ZodOptional<z.ZodString>;
16
+ };
17
+ declare const InputSchema: z.ZodObject<{
18
+ q: z.ZodOptional<z.ZodString>;
19
+ platform: z.ZodOptional<z.ZodEnum<{
20
+ tiktok: "tiktok";
21
+ youtube: "youtube";
22
+ instagram: "instagram";
23
+ "youtube-shorts": "youtube-shorts";
24
+ }>>;
25
+ folder_id: z.ZodOptional<z.ZodString>;
26
+ author: z.ZodOptional<z.ZodString>;
27
+ limit: z.ZodOptional<z.ZodNumber>;
28
+ cursor: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>;
30
+ type Input = z.infer<typeof InputSchema>;
31
+ export declare const searchVideosTool: {
32
+ name: string;
33
+ annotations: {
34
+ title: string;
35
+ readOnlyHint: true;
36
+ destructiveHint: false;
37
+ idempotentHint: true;
38
+ openWorldHint: false;
39
+ };
40
+ outputSchema: z.ZodObject<{
41
+ videos: z.ZodArray<z.ZodObject<{
42
+ id: z.ZodNumber;
43
+ url: z.ZodString;
44
+ platform_video_id: z.ZodNullable<z.ZodString>;
45
+ platform: z.ZodString;
46
+ media_type: z.ZodString;
47
+ mode: z.ZodString;
48
+ source: z.ZodString;
49
+ metadata: z.ZodObject<{
50
+ title: z.ZodNullable<z.ZodString>;
51
+ author: z.ZodNullable<z.ZodString>;
52
+ posted_at: z.ZodNullable<z.ZodString>;
53
+ duration_s: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
54
+ thumbnail_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
+ }, z.core.$loose>;
56
+ first_scanned_at: z.ZodString;
57
+ scanned_at: z.ZodString;
58
+ status: z.ZodOptional<z.ZodString>;
59
+ error: z.ZodOptional<z.ZodObject<{
60
+ code: z.ZodString;
61
+ detail: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$loose>>;
63
+ matched_in: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
+ }, z.core.$loose>>;
65
+ total: z.ZodNumber;
66
+ nextCursor: z.ZodNullable<z.ZodString>;
67
+ warnings: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
68
+ code: z.ZodOptional<z.ZodString>;
69
+ message: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$loose>]>>>;
71
+ }, z.core.$loose>;
72
+ description: string;
73
+ inputShape: z.ZodObject<{
74
+ q: z.ZodOptional<z.ZodString>;
75
+ platform: z.ZodOptional<z.ZodEnum<{
76
+ tiktok: "tiktok";
77
+ youtube: "youtube";
78
+ instagram: "instagram";
79
+ "youtube-shorts": "youtube-shorts";
80
+ }>>;
81
+ folder_id: z.ZodOptional<z.ZodString>;
82
+ author: z.ZodOptional<z.ZodString>;
83
+ limit: z.ZodOptional<z.ZodNumber>;
84
+ cursor: z.ZodOptional<z.ZodString>;
85
+ }, z.core.$strip>;
86
+ handler(client: ApiClient, args: Input): Promise<SearchVideosResponse>;
87
+ };
88
+ export {};
@@ -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
+ };
@@ -3,6 +3,27 @@ import type { ApiClient } from '../apiClient';
3
3
  import type { WhoamiResponse } from '../types';
4
4
  export declare const whoamiTool: {
5
5
  name: string;
6
+ annotations: {
7
+ title: string;
8
+ readOnlyHint: true;
9
+ destructiveHint: false;
10
+ idempotentHint: true;
11
+ openWorldHint: false;
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>;
6
27
  description: string;
7
28
  inputSchema: {};
8
29
  inputShape: z.ZodObject<{}, z.core.$strip>;
@@ -5,9 +5,28 @@
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
- description: 'Returns the identity and subscription tier of the authenticated Quiki account. Use this to verify the token is valid and to check whether the account has API scan access (tier must be `pro` or `admin` to use `scan_url`).',
11
+ // Reads only; safe for a client to auto-approve.
12
+ annotations: {
13
+ title: 'Who am I',
14
+ readOnlyHint: true,
15
+ destructiveHint: false,
16
+ idempotentHint: true,
17
+ openWorldHint: false,
18
+ },
19
+ outputSchema: outputSchemas_1.WhoamiOutput,
20
+ // v0.5.0: mentions the credit fields added to GET /api/v1/me in server
21
+ // v1.2.71. The old text said scan_url needs `pro` or `admin`; FREE has been
22
+ // able to run fast scans since server v1.1.7, so that line was dropped.
23
+ description: [
24
+ 'Returns the authenticated Quiki account: `id`, `email`, `tier` (`free`, `pro` or `admin`) and the credit balance (`credits.balance`). Use it to check the token works and to see what the account can spend before calling `scan_url` or `bulk_import`.',
25
+ '',
26
+ 'On FREE it also returns `dailyScans` (`limit`, `used`, `remaining`, `resetsAt`): the daily scan allowance `scan_url` enforces. When `remaining` is 0, `scan_url` is refused until `resetsAt`. `dailyScans` is null on other tiers.',
27
+ '',
28
+ 'FREE can run `fast` TikTok and YouTube scans within the daily allowance. Deep analysis, transcripts, Instagram and bulk imports need credits (tier `pro`). `admin` is not charged. Older Quiki servers return only `id`, `email` and `tier`.',
29
+ ].join('\n'),
11
30
  inputSchema: {},
12
31
  inputShape: zod_1.z.object({}),
13
32
  async handler(client, _args) {
package/dist/types.d.ts CHANGED
@@ -1,11 +1,24 @@
1
- export type Tier = 'free' | 'play' | 'pro' | 'admin';
1
+ export type Tier = 'free' | 'pro' | 'admin' | 'play' | 'agency';
2
2
  export type Platform = 'tiktok' | 'youtube' | 'instagram';
3
3
  export type Mode = 'fast' | 'deep' | 'transcript_only';
4
4
  export type ScanStatus = 'queued' | 'running' | 'completed' | 'failed';
5
+ export interface DailyScanAllowance {
6
+ limit: number;
7
+ used: number;
8
+ remaining: number;
9
+ /** ISO 8601. When the allowance resets. */
10
+ resetsAt: string;
11
+ }
5
12
  export interface WhoamiResponse {
6
13
  id: string;
7
- email: string;
14
+ /** null for an account created with Sign in with Apple that shared no email. */
15
+ email: string | null;
8
16
  tier: Tier;
17
+ credits?: {
18
+ balance: number;
19
+ };
20
+ /** FREE only: the daily scan allowance `scan_url` enforces. null on other tiers. */
21
+ dailyScans?: DailyScanAllowance | null;
9
22
  }
10
23
  export interface ScanMetadata {
11
24
  title: string | null;
@@ -30,6 +43,11 @@ export interface ScanResponse {
30
43
  mode: Mode;
31
44
  created_at: string;
32
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
+ };
33
51
  video_id?: number;
34
52
  result?: ScanResult;
35
53
  error?: {
@@ -63,16 +81,25 @@ interface VideoCore {
63
81
  first_scanned_at: string;
64
82
  scanned_at: string;
65
83
  }
66
- 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 & {
67
96
  media_type: 'video';
68
97
  metadata: VideoMetadataVideo;
69
- transcript: string | null;
70
- ai_analysis?: Record<string, unknown>;
71
- }) | (VideoCore & {
98
+ transcript?: string | null;
99
+ }) | (VideoCore & VideoSections & {
72
100
  media_type: 'photo';
73
101
  metadata: VideoMetadataPhoto;
74
- images: string[];
75
- ai_analysis?: Record<string, unknown>;
102
+ images?: string[];
76
103
  });
77
104
  export type VideoSummary = (VideoCore & {
78
105
  media_type: 'video';
@@ -90,6 +117,74 @@ export type VideoSummaryWithStatus = VideoSummary & {
90
117
  };
91
118
  export interface RecentVideosResponse {
92
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[];
93
188
  }
94
189
  export interface BulkImportSubmitResponse {
95
190
  bulkImportId: string;
@@ -175,4 +270,22 @@ export interface BulkImportStatusResponse {
175
270
  /** Same value as `jobStats.skipped`. Not included in `failedVideos`. */
176
271
  skippedVideos: number;
177
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
+ }
178
291
  export {};
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "0.4.2";
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.4.2';
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.4.2",
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.0",
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": [