klamdo-mcp 1.2.1 → 1.4.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/http.js +3 -3
- package/dist/index.js +1 -1
- package/dist/tools.d.ts +214 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +228 -5
- package/dist/tools.js.map +1 -1
- package/package.json +2 -2
- package/smithery.yaml +1 -0
- package/src/http.ts +3 -3
- package/src/index.ts +1 -1
- package/src/tools.ts +279 -5
package/dist/http.js
CHANGED
|
@@ -37,7 +37,7 @@ async function readBody(req) {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
function createMcpServer(apiKey) {
|
|
40
|
-
const server = new index_js_1.Server({ name: "klamdo", version: "1.
|
|
40
|
+
const server = new index_js_1.Server({ name: "klamdo", version: "1.4.0" }, { capabilities: { tools: {}, resources: {} } });
|
|
41
41
|
(0, tools_js_1.registerHandlers)(server, () => apiKey);
|
|
42
42
|
return server;
|
|
43
43
|
}
|
|
@@ -46,7 +46,7 @@ const httpServer = (0, http_1.createServer)(async (req, res) => {
|
|
|
46
46
|
// Health check
|
|
47
47
|
if (req.method === "GET" && url.pathname === "/health") {
|
|
48
48
|
res.writeHead(200, { "Content-Type": "application/json" });
|
|
49
|
-
res.end(JSON.stringify({ ok: true, service: "klamdo-mcp", version: "1.
|
|
49
|
+
res.end(JSON.stringify({ ok: true, service: "klamdo-mcp", version: "1.4.0" }));
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
// CORS preflight
|
|
@@ -99,7 +99,7 @@ const httpServer = (0, http_1.createServer)(async (req, res) => {
|
|
|
99
99
|
res.writeHead(200, { "Content-Type": "application/json" });
|
|
100
100
|
res.end(JSON.stringify({
|
|
101
101
|
service: "Klamdo MCP Server",
|
|
102
|
-
version: "1.
|
|
102
|
+
version: "1.4.0",
|
|
103
103
|
mcpEndpoint: "/mcp",
|
|
104
104
|
docs: "https://klamdo.app/answers",
|
|
105
105
|
getApiKey: "https://klamdo.app/profile"
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ if (!API_KEY) {
|
|
|
23
23
|
process.stderr.write("[klamdo-mcp] Warning: KLAMDO_API_KEY is not set. Set it in your MCP client config.\n");
|
|
24
24
|
}
|
|
25
25
|
async function main() {
|
|
26
|
-
const server = new index_js_1.Server({ name: "klamdo", version: "1.
|
|
26
|
+
const server = new index_js_1.Server({ name: "klamdo", version: "1.4.0" }, { capabilities: { tools: {}, resources: {} } });
|
|
27
27
|
(0, tools_js_1.registerHandlers)(server, () => API_KEY);
|
|
28
28
|
const transport = new stdio_js_1.StdioServerTransport();
|
|
29
29
|
await server.connect(transport);
|
package/dist/tools.d.ts
CHANGED
|
@@ -27,10 +27,20 @@ export declare const TOOLS: ({
|
|
|
27
27
|
description: string;
|
|
28
28
|
default: string;
|
|
29
29
|
};
|
|
30
|
+
startFrameAssetId?: undefined;
|
|
31
|
+
imageUrl?: undefined;
|
|
30
32
|
jobId?: undefined;
|
|
31
33
|
limit?: undefined;
|
|
34
|
+
packageType?: undefined;
|
|
35
|
+
niche?: undefined;
|
|
36
|
+
avatarDurationSeconds?: undefined;
|
|
37
|
+
characterType?: undefined;
|
|
38
|
+
uploadedAssetIds?: undefined;
|
|
39
|
+
options?: undefined;
|
|
40
|
+
packageId?: undefined;
|
|
32
41
|
};
|
|
33
42
|
required: string[];
|
|
43
|
+
additionalProperties?: undefined;
|
|
34
44
|
};
|
|
35
45
|
} | {
|
|
36
46
|
name: string;
|
|
@@ -48,11 +58,56 @@ export declare const TOOLS: ({
|
|
|
48
58
|
type: string;
|
|
49
59
|
description: string;
|
|
50
60
|
};
|
|
61
|
+
startFrameAssetId: {
|
|
62
|
+
type: string;
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
aspectRatio?: undefined;
|
|
66
|
+
imageUrl?: undefined;
|
|
67
|
+
jobId?: undefined;
|
|
68
|
+
limit?: undefined;
|
|
69
|
+
packageType?: undefined;
|
|
70
|
+
niche?: undefined;
|
|
71
|
+
avatarDurationSeconds?: undefined;
|
|
72
|
+
characterType?: undefined;
|
|
73
|
+
uploadedAssetIds?: undefined;
|
|
74
|
+
options?: undefined;
|
|
75
|
+
packageId?: undefined;
|
|
76
|
+
};
|
|
77
|
+
required: string[];
|
|
78
|
+
additionalProperties?: undefined;
|
|
79
|
+
};
|
|
80
|
+
} | {
|
|
81
|
+
name: string;
|
|
82
|
+
description: string;
|
|
83
|
+
annotations: {
|
|
84
|
+
readOnlyHint: boolean;
|
|
85
|
+
destructiveHint: boolean;
|
|
86
|
+
idempotentHint: boolean;
|
|
87
|
+
openWorldHint: boolean;
|
|
88
|
+
};
|
|
89
|
+
inputSchema: {
|
|
90
|
+
type: string;
|
|
91
|
+
properties: {
|
|
92
|
+
imageUrl: {
|
|
93
|
+
type: string;
|
|
94
|
+
description: string;
|
|
95
|
+
};
|
|
96
|
+
prompt?: undefined;
|
|
51
97
|
aspectRatio?: undefined;
|
|
98
|
+
startFrameAssetId?: undefined;
|
|
52
99
|
jobId?: undefined;
|
|
53
100
|
limit?: undefined;
|
|
101
|
+
packageType?: undefined;
|
|
102
|
+
niche?: undefined;
|
|
103
|
+
avatarDurationSeconds?: undefined;
|
|
104
|
+
characterType?: undefined;
|
|
105
|
+
uploadedAssetIds?: undefined;
|
|
106
|
+
options?: undefined;
|
|
107
|
+
packageId?: undefined;
|
|
54
108
|
};
|
|
55
109
|
required: string[];
|
|
110
|
+
additionalProperties?: undefined;
|
|
56
111
|
};
|
|
57
112
|
} | {
|
|
58
113
|
name: string;
|
|
@@ -72,9 +127,19 @@ export declare const TOOLS: ({
|
|
|
72
127
|
};
|
|
73
128
|
prompt?: undefined;
|
|
74
129
|
aspectRatio?: undefined;
|
|
130
|
+
startFrameAssetId?: undefined;
|
|
131
|
+
imageUrl?: undefined;
|
|
75
132
|
limit?: undefined;
|
|
133
|
+
packageType?: undefined;
|
|
134
|
+
niche?: undefined;
|
|
135
|
+
avatarDurationSeconds?: undefined;
|
|
136
|
+
characterType?: undefined;
|
|
137
|
+
uploadedAssetIds?: undefined;
|
|
138
|
+
options?: undefined;
|
|
139
|
+
packageId?: undefined;
|
|
76
140
|
};
|
|
77
141
|
required: string[];
|
|
142
|
+
additionalProperties?: undefined;
|
|
78
143
|
};
|
|
79
144
|
} | {
|
|
80
145
|
name: string;
|
|
@@ -90,10 +155,20 @@ export declare const TOOLS: ({
|
|
|
90
155
|
properties: {
|
|
91
156
|
prompt?: undefined;
|
|
92
157
|
aspectRatio?: undefined;
|
|
158
|
+
startFrameAssetId?: undefined;
|
|
159
|
+
imageUrl?: undefined;
|
|
93
160
|
jobId?: undefined;
|
|
94
161
|
limit?: undefined;
|
|
162
|
+
packageType?: undefined;
|
|
163
|
+
niche?: undefined;
|
|
164
|
+
avatarDurationSeconds?: undefined;
|
|
165
|
+
characterType?: undefined;
|
|
166
|
+
uploadedAssetIds?: undefined;
|
|
167
|
+
options?: undefined;
|
|
168
|
+
packageId?: undefined;
|
|
95
169
|
};
|
|
96
170
|
required?: undefined;
|
|
171
|
+
additionalProperties?: undefined;
|
|
97
172
|
};
|
|
98
173
|
} | {
|
|
99
174
|
name: string;
|
|
@@ -114,10 +189,149 @@ export declare const TOOLS: ({
|
|
|
114
189
|
};
|
|
115
190
|
prompt?: undefined;
|
|
116
191
|
aspectRatio?: undefined;
|
|
192
|
+
startFrameAssetId?: undefined;
|
|
193
|
+
imageUrl?: undefined;
|
|
194
|
+
jobId?: undefined;
|
|
195
|
+
packageType?: undefined;
|
|
196
|
+
niche?: undefined;
|
|
197
|
+
avatarDurationSeconds?: undefined;
|
|
198
|
+
characterType?: undefined;
|
|
199
|
+
uploadedAssetIds?: undefined;
|
|
200
|
+
options?: undefined;
|
|
201
|
+
packageId?: undefined;
|
|
202
|
+
};
|
|
203
|
+
required?: undefined;
|
|
204
|
+
additionalProperties?: undefined;
|
|
205
|
+
};
|
|
206
|
+
} | {
|
|
207
|
+
name: string;
|
|
208
|
+
description: string;
|
|
209
|
+
annotations: {
|
|
210
|
+
readOnlyHint: boolean;
|
|
211
|
+
destructiveHint: boolean;
|
|
212
|
+
idempotentHint: boolean;
|
|
213
|
+
openWorldHint: boolean;
|
|
214
|
+
};
|
|
215
|
+
inputSchema: {
|
|
216
|
+
type: string;
|
|
217
|
+
properties: {
|
|
218
|
+
prompt?: undefined;
|
|
219
|
+
aspectRatio?: undefined;
|
|
220
|
+
startFrameAssetId?: undefined;
|
|
221
|
+
imageUrl?: undefined;
|
|
117
222
|
jobId?: undefined;
|
|
223
|
+
limit?: undefined;
|
|
224
|
+
packageType?: undefined;
|
|
225
|
+
niche?: undefined;
|
|
226
|
+
avatarDurationSeconds?: undefined;
|
|
227
|
+
characterType?: undefined;
|
|
228
|
+
uploadedAssetIds?: undefined;
|
|
229
|
+
options?: undefined;
|
|
230
|
+
packageId?: undefined;
|
|
118
231
|
};
|
|
232
|
+
additionalProperties: boolean;
|
|
119
233
|
required?: undefined;
|
|
120
234
|
};
|
|
235
|
+
} | {
|
|
236
|
+
name: string;
|
|
237
|
+
description: string;
|
|
238
|
+
annotations: {
|
|
239
|
+
readOnlyHint: boolean;
|
|
240
|
+
destructiveHint: boolean;
|
|
241
|
+
idempotentHint: boolean;
|
|
242
|
+
openWorldHint: boolean;
|
|
243
|
+
};
|
|
244
|
+
inputSchema: {
|
|
245
|
+
type: string;
|
|
246
|
+
properties: {
|
|
247
|
+
packageType: {
|
|
248
|
+
type: string;
|
|
249
|
+
enum: string[];
|
|
250
|
+
description: string;
|
|
251
|
+
};
|
|
252
|
+
prompt: {
|
|
253
|
+
type: string;
|
|
254
|
+
description: string;
|
|
255
|
+
};
|
|
256
|
+
niche: {
|
|
257
|
+
type: string;
|
|
258
|
+
description: string;
|
|
259
|
+
};
|
|
260
|
+
aspectRatio: {
|
|
261
|
+
type: string;
|
|
262
|
+
enum: string[];
|
|
263
|
+
description: string;
|
|
264
|
+
default?: undefined;
|
|
265
|
+
};
|
|
266
|
+
avatarDurationSeconds: {
|
|
267
|
+
type: string;
|
|
268
|
+
enum: number[];
|
|
269
|
+
description: string;
|
|
270
|
+
};
|
|
271
|
+
characterType: {
|
|
272
|
+
type: string;
|
|
273
|
+
enum: string[];
|
|
274
|
+
description: string;
|
|
275
|
+
};
|
|
276
|
+
uploadedAssetIds: {
|
|
277
|
+
type: string;
|
|
278
|
+
items: {
|
|
279
|
+
type: string;
|
|
280
|
+
};
|
|
281
|
+
description: string;
|
|
282
|
+
};
|
|
283
|
+
options: {
|
|
284
|
+
type: string;
|
|
285
|
+
properties: {
|
|
286
|
+
useReferencePack: {
|
|
287
|
+
type: string;
|
|
288
|
+
};
|
|
289
|
+
skipVoiceover: {
|
|
290
|
+
type: string;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
startFrameAssetId?: undefined;
|
|
295
|
+
imageUrl?: undefined;
|
|
296
|
+
jobId?: undefined;
|
|
297
|
+
limit?: undefined;
|
|
298
|
+
packageId?: undefined;
|
|
299
|
+
};
|
|
300
|
+
required: string[];
|
|
301
|
+
additionalProperties?: undefined;
|
|
302
|
+
};
|
|
303
|
+
} | {
|
|
304
|
+
name: string;
|
|
305
|
+
description: string;
|
|
306
|
+
annotations: {
|
|
307
|
+
readOnlyHint: boolean;
|
|
308
|
+
destructiveHint: boolean;
|
|
309
|
+
idempotentHint: boolean;
|
|
310
|
+
openWorldHint: boolean;
|
|
311
|
+
};
|
|
312
|
+
inputSchema: {
|
|
313
|
+
type: string;
|
|
314
|
+
properties: {
|
|
315
|
+
packageId: {
|
|
316
|
+
type: string;
|
|
317
|
+
description: string;
|
|
318
|
+
};
|
|
319
|
+
prompt?: undefined;
|
|
320
|
+
aspectRatio?: undefined;
|
|
321
|
+
startFrameAssetId?: undefined;
|
|
322
|
+
imageUrl?: undefined;
|
|
323
|
+
jobId?: undefined;
|
|
324
|
+
limit?: undefined;
|
|
325
|
+
packageType?: undefined;
|
|
326
|
+
niche?: undefined;
|
|
327
|
+
avatarDurationSeconds?: undefined;
|
|
328
|
+
characterType?: undefined;
|
|
329
|
+
uploadedAssetIds?: undefined;
|
|
330
|
+
options?: undefined;
|
|
331
|
+
};
|
|
332
|
+
required: string[];
|
|
333
|
+
additionalProperties?: undefined;
|
|
334
|
+
};
|
|
121
335
|
})[];
|
|
122
336
|
export declare function registerHandlers(server: Server, getApiKey: () => string): void;
|
|
123
337
|
//# sourceMappingURL=tools.d.ts.map
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAExE,eAAO,MAAM,QAAQ,QAAsD,CAAC;AAE5E,wBAAsB,MAAM,CAAC,CAAC,EAC5B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,CAAC,CAAC,CAyBZ;AAED,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAExE,eAAO,MAAM,QAAQ,QAAsD,CAAC;AAE5E,wBAAsB,MAAM,CAAC,CAAC,EAC5B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,CAAC,CAAC,CAyBZ;AAED,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmOjB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,QAyTvE"}
|
package/dist/tools.js
CHANGED
|
@@ -57,8 +57,8 @@ exports.TOOLS = [
|
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
name: "generate_video",
|
|
60
|
-
description: "Generate a 5-second vertical identity-locked video
|
|
61
|
-
"
|
|
60
|
+
description: "Generate a 5-second vertical identity-locked video on Klamdo. " +
|
|
61
|
+
"Requires a startFrameAssetId from upload_start_frame. If omitted, falls back to image generation. Costs 6 credits.",
|
|
62
62
|
annotations: {
|
|
63
63
|
readOnlyHint: false,
|
|
64
64
|
destructiveHint: false,
|
|
@@ -71,11 +71,36 @@ exports.TOOLS = [
|
|
|
71
71
|
prompt: {
|
|
72
72
|
type: "string",
|
|
73
73
|
description: "Describe the video content with motion cues for best results."
|
|
74
|
+
},
|
|
75
|
+
startFrameAssetId: {
|
|
76
|
+
type: "string",
|
|
77
|
+
description: "Asset ID returned by upload_start_frame. Required for video; without it an image is generated instead."
|
|
74
78
|
}
|
|
75
79
|
},
|
|
76
80
|
required: ["prompt"]
|
|
77
81
|
}
|
|
78
82
|
},
|
|
83
|
+
{
|
|
84
|
+
name: "upload_start_frame",
|
|
85
|
+
description: "Upload a start-frame image for video generation. Provide a public HTTPS image URL — " +
|
|
86
|
+
"Klamdo fetches it, stores it, and returns an assetId you pass to generate_video.",
|
|
87
|
+
annotations: {
|
|
88
|
+
readOnlyHint: false,
|
|
89
|
+
destructiveHint: false,
|
|
90
|
+
idempotentHint: true,
|
|
91
|
+
openWorldHint: true
|
|
92
|
+
},
|
|
93
|
+
inputSchema: {
|
|
94
|
+
type: "object",
|
|
95
|
+
properties: {
|
|
96
|
+
imageUrl: {
|
|
97
|
+
type: "string",
|
|
98
|
+
description: "Public HTTPS URL of the image to use as the video start frame. Max 10MB."
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
required: ["imageUrl"]
|
|
102
|
+
}
|
|
103
|
+
},
|
|
79
104
|
{
|
|
80
105
|
name: "check_job",
|
|
81
106
|
description: "Check the status of a Klamdo generation job. Returns status and download URLs when complete.",
|
|
@@ -123,6 +148,107 @@ exports.TOOLS = [
|
|
|
123
148
|
}
|
|
124
149
|
}
|
|
125
150
|
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "list_packages",
|
|
154
|
+
description: "List Klamdo's available agentic packages, including expected deliverables and required plan tier.",
|
|
155
|
+
annotations: {
|
|
156
|
+
readOnlyHint: true,
|
|
157
|
+
destructiveHint: false,
|
|
158
|
+
idempotentHint: true,
|
|
159
|
+
openWorldHint: true
|
|
160
|
+
},
|
|
161
|
+
inputSchema: { type: "object", properties: {}, additionalProperties: false }
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: "create_package",
|
|
165
|
+
description: "Create a Klamdo agentic package job from a business prompt and get back a package ID plus manifest URL.",
|
|
166
|
+
annotations: {
|
|
167
|
+
readOnlyHint: false,
|
|
168
|
+
destructiveHint: false,
|
|
169
|
+
idempotentHint: false,
|
|
170
|
+
openWorldHint: true
|
|
171
|
+
},
|
|
172
|
+
inputSchema: {
|
|
173
|
+
type: "object",
|
|
174
|
+
properties: {
|
|
175
|
+
packageType: {
|
|
176
|
+
type: "string",
|
|
177
|
+
enum: ["digital-marketing", "social-media", "ugc-ad", "coaching-brand", "product-launch", "content-repurpose", "motion-control", "faceless-content", "build-your-own-ai"],
|
|
178
|
+
description: "The Klamdo package to create."
|
|
179
|
+
},
|
|
180
|
+
prompt: {
|
|
181
|
+
type: "string",
|
|
182
|
+
description: "High-level business prompt describing the package goal."
|
|
183
|
+
},
|
|
184
|
+
niche: {
|
|
185
|
+
type: "string",
|
|
186
|
+
description: "Optional niche or audience hint."
|
|
187
|
+
},
|
|
188
|
+
aspectRatio: {
|
|
189
|
+
type: "string",
|
|
190
|
+
enum: ["16:9", "9:16", "1:1"],
|
|
191
|
+
description: "Preferred output aspect ratio. Packages currently support 16:9 and 9:16."
|
|
192
|
+
},
|
|
193
|
+
avatarDurationSeconds: {
|
|
194
|
+
type: "number",
|
|
195
|
+
enum: [30, 60, 90, 180],
|
|
196
|
+
description: "Optional avatar-video duration for packages that include avatar outputs."
|
|
197
|
+
},
|
|
198
|
+
characterType: {
|
|
199
|
+
type: "string",
|
|
200
|
+
enum: ["realistic", "anime", "cartoon", "fantasy", "cyber", "3d"],
|
|
201
|
+
description: "Required for build-your-own-ai packages. Controls the character style and image model."
|
|
202
|
+
},
|
|
203
|
+
uploadedAssetIds: {
|
|
204
|
+
type: "array",
|
|
205
|
+
items: { type: "string" },
|
|
206
|
+
description: "Optional Klamdo asset IDs or URLs to feed into the package."
|
|
207
|
+
},
|
|
208
|
+
options: {
|
|
209
|
+
type: "object",
|
|
210
|
+
properties: {
|
|
211
|
+
useReferencePack: { type: "boolean" },
|
|
212
|
+
skipVoiceover: { type: "boolean" }
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
required: ["packageType", "prompt"]
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: "get_package",
|
|
221
|
+
description: "Get the status, progress, and deliverable counts for a Klamdo package job.",
|
|
222
|
+
annotations: {
|
|
223
|
+
readOnlyHint: true,
|
|
224
|
+
destructiveHint: false,
|
|
225
|
+
idempotentHint: true,
|
|
226
|
+
openWorldHint: true
|
|
227
|
+
},
|
|
228
|
+
inputSchema: {
|
|
229
|
+
type: "object",
|
|
230
|
+
properties: {
|
|
231
|
+
packageId: { type: "string", description: "The package ID returned by create_package." }
|
|
232
|
+
},
|
|
233
|
+
required: ["packageId"]
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: "get_package_manifest",
|
|
238
|
+
description: "Fetch the structured package manifest for downstream agent execution.",
|
|
239
|
+
annotations: {
|
|
240
|
+
readOnlyHint: true,
|
|
241
|
+
destructiveHint: false,
|
|
242
|
+
idempotentHint: true,
|
|
243
|
+
openWorldHint: true
|
|
244
|
+
},
|
|
245
|
+
inputSchema: {
|
|
246
|
+
type: "object",
|
|
247
|
+
properties: {
|
|
248
|
+
packageId: { type: "string", description: "The package ID returned by create_package." }
|
|
249
|
+
},
|
|
250
|
+
required: ["packageId"]
|
|
251
|
+
}
|
|
126
252
|
}
|
|
127
253
|
];
|
|
128
254
|
function registerHandlers(server, getApiKey) {
|
|
@@ -148,12 +274,37 @@ function registerHandlers(server, getApiKey) {
|
|
|
148
274
|
};
|
|
149
275
|
}
|
|
150
276
|
case "generate_video": {
|
|
151
|
-
const
|
|
277
|
+
const startFrameAssetId = input.startFrameAssetId ? String(input.startFrameAssetId) : "";
|
|
278
|
+
const isRealVideo = !!startFrameAssetId;
|
|
279
|
+
const result = await klamdo("/jobs", apiKey, {
|
|
280
|
+
prompt: input.prompt,
|
|
281
|
+
mode: isRealVideo ? "video" : "image",
|
|
282
|
+
aspectRatio: "9:16",
|
|
283
|
+
...(isRealVideo ? { startFrameAssetId } : {}),
|
|
284
|
+
});
|
|
285
|
+
const modeLabel = isRealVideo ? "Video" : "Image (no start frame provided)";
|
|
286
|
+
const timing = isRealVideo
|
|
287
|
+
? "Videos typically complete in 2–5 minutes."
|
|
288
|
+
: "Images typically complete in 30–90 seconds. To generate a video, use upload_start_frame first.";
|
|
289
|
+
return {
|
|
290
|
+
content: [
|
|
291
|
+
{
|
|
292
|
+
type: "text",
|
|
293
|
+
text: `${modeLabel} generation started.\n\nJob ID: ${result.jobId}\nStatus: ${result.status}\nCredits reserved: ${result.creditsReserved}\n\n${timing}\n\nUse check_job("${result.jobId}") to get the result.`
|
|
294
|
+
}
|
|
295
|
+
]
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
case "upload_start_frame": {
|
|
299
|
+
const imageUrl = String(input.imageUrl ?? "");
|
|
300
|
+
if (!imageUrl)
|
|
301
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, "imageUrl is required");
|
|
302
|
+
const result = await klamdo("/upload-frame", apiKey, { imageUrl });
|
|
152
303
|
return {
|
|
153
304
|
content: [
|
|
154
305
|
{
|
|
155
306
|
type: "text",
|
|
156
|
-
text: `
|
|
307
|
+
text: `Start frame uploaded.\n\nAsset ID: ${result.assetId}\nFile: ${result.fileName}\n\nPass this assetId to generate_video:\n generate_video({ prompt: "...", startFrameAssetId: "${result.assetId}" })`
|
|
157
308
|
}
|
|
158
309
|
]
|
|
159
310
|
};
|
|
@@ -220,6 +371,78 @@ function registerHandlers(server, getApiKey) {
|
|
|
220
371
|
content: [{ type: "text", text: lines.length ? lines.join("\n") : "No jobs found." }]
|
|
221
372
|
};
|
|
222
373
|
}
|
|
374
|
+
case "list_packages": {
|
|
375
|
+
const result = await klamdo("/packages", apiKey);
|
|
376
|
+
const lines = [
|
|
377
|
+
`Plan: ${result.planTier}`,
|
|
378
|
+
`Subscription active: ${result.subscriptionActive ? "yes" : "no"}`,
|
|
379
|
+
"",
|
|
380
|
+
...result.packages.map((pkg) => `${pkg.accessible ? "[available]" : "[locked]"} ${pkg.id} — ${pkg.label}\n` +
|
|
381
|
+
` Min tier: ${pkg.minTier}\n` +
|
|
382
|
+
` Estimated credits: ${pkg.estimatedCredits}\n` +
|
|
383
|
+
` Text outputs: ${pkg.expectedOutputs.textRoles.join(", ") || "none"}\n` +
|
|
384
|
+
` Media outputs: ${pkg.expectedOutputs.mediaRoles.join(", ") || "none"}\n` +
|
|
385
|
+
` Document outputs: ${pkg.expectedOutputs.documentRoles.join(", ") || "none"}`),
|
|
386
|
+
];
|
|
387
|
+
return {
|
|
388
|
+
content: [{ type: "text", text: lines.join("\n") }]
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
case "create_package": {
|
|
392
|
+
const result = await klamdo("/packages", apiKey, {
|
|
393
|
+
packageType: input.packageType,
|
|
394
|
+
prompt: input.prompt,
|
|
395
|
+
niche: input.niche,
|
|
396
|
+
aspectRatio: input.aspectRatio,
|
|
397
|
+
avatarDurationSeconds: input.avatarDurationSeconds,
|
|
398
|
+
characterType: input.characterType,
|
|
399
|
+
uploadedAssetIds: input.uploadedAssetIds,
|
|
400
|
+
options: input.options,
|
|
401
|
+
});
|
|
402
|
+
return {
|
|
403
|
+
content: [
|
|
404
|
+
{
|
|
405
|
+
type: "text",
|
|
406
|
+
text: `Package started.\n\nPackage ID: ${result.id}\nType: ${result.packageType}\n` +
|
|
407
|
+
`Status: ${result.status}\nProgress: ${result.progress.completed}/${result.progress.total}\n` +
|
|
408
|
+
`Manifest URL: ${exports.BASE_URL}${result.manifestUrl}\n\n` +
|
|
409
|
+
`Use get_package("${result.id}") for status or get_package_manifest("${result.id}") for the structured deliverables contract.`
|
|
410
|
+
}
|
|
411
|
+
]
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
case "get_package": {
|
|
415
|
+
const packageId = String(input.packageId ?? "");
|
|
416
|
+
if (!packageId)
|
|
417
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, "packageId is required");
|
|
418
|
+
const result = await klamdo(`/packages/${packageId}`, apiKey);
|
|
419
|
+
return {
|
|
420
|
+
content: [
|
|
421
|
+
{
|
|
422
|
+
type: "text",
|
|
423
|
+
text: [
|
|
424
|
+
`Package ${result.id}`,
|
|
425
|
+
`Type: ${result.packageType}`,
|
|
426
|
+
`Status: ${result.status}`,
|
|
427
|
+
`Niche: ${result.niche}`,
|
|
428
|
+
`Tier: ${result.tier}`,
|
|
429
|
+
`Progress: ${result.progress.completed}/${result.progress.total}`,
|
|
430
|
+
`Deliverables: text=${result.deliverableCounts.text}, media=${result.deliverableCounts.media}, documents=${result.deliverableCounts.documents}, errors=${result.deliverableCounts.errors}`,
|
|
431
|
+
`Manifest URL: ${exports.BASE_URL}${result.manifestUrl}`
|
|
432
|
+
].join("\n")
|
|
433
|
+
}
|
|
434
|
+
]
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
case "get_package_manifest": {
|
|
438
|
+
const packageId = String(input.packageId ?? "");
|
|
439
|
+
if (!packageId)
|
|
440
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, "packageId is required");
|
|
441
|
+
const result = await klamdo(`/packages/${packageId}/manifest`, apiKey);
|
|
442
|
+
return {
|
|
443
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
444
|
+
};
|
|
445
|
+
}
|
|
223
446
|
default:
|
|
224
447
|
throw new types_js_1.McpError(types_js_1.ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
225
448
|
}
|
|
@@ -247,7 +470,7 @@ function registerHandlers(server, getApiKey) {
|
|
|
247
470
|
{
|
|
248
471
|
uri: "klamdo://docs",
|
|
249
472
|
mimeType: "text/plain",
|
|
250
|
-
text: `# Klamdo MCP Server\n\nTools: generate_image, generate_video, check_job, get_account, list_jobs\n\nGet your API key at https://klamdo.app/profile\
|
|
473
|
+
text: `# Klamdo MCP Server v1.4.0\n\nTools: generate_image, generate_video, upload_start_frame, check_job, get_account, list_jobs, list_packages, create_package, get_package, get_package_manifest\n\nImage/video workflow:\n1. upload_start_frame({ imageUrl: "https://..." }) → assetId\n2. generate_video({ prompt: "...", startFrameAssetId: "asset_xxx" }) → jobId\n3. check_job({ jobId: "job_xxx" }) → status + download URL\n\nPackage workflow:\n1. list_packages()\n2. create_package({ packageType: "coaching-brand", prompt: "Create a coaching launch package for my offer" })\n3. get_package({ packageId: "pkg_xxx" })\n4. get_package_manifest({ packageId: "pkg_xxx" })\n\nGet your API key at https://klamdo.app/profile\nSee current plans and credits at https://klamdo.app/pricing\n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|
"name": "klamdo-mcp",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "MCP server for Klamdo — AI content generation for coaches and creator-founders. Generate
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "MCP server for Klamdo — AI content generation plus agentic package orchestration for coaches and creator-founders. Generate media, create packages, and hand structured deliverables to downstream AI agents.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"klamdo-mcp": "dist/index.js"
|
package/smithery.yaml
CHANGED
package/src/http.ts
CHANGED
|
@@ -39,7 +39,7 @@ async function readBody(req: IncomingMessage): Promise<Buffer> {
|
|
|
39
39
|
|
|
40
40
|
function createMcpServer(apiKey: string): Server {
|
|
41
41
|
const server = new Server(
|
|
42
|
-
{ name: "klamdo", version: "1.
|
|
42
|
+
{ name: "klamdo", version: "1.4.0" },
|
|
43
43
|
{ capabilities: { tools: {}, resources: {} } }
|
|
44
44
|
);
|
|
45
45
|
registerHandlers(server, () => apiKey);
|
|
@@ -52,7 +52,7 @@ const httpServer = createServer(async (req: IncomingMessage, res: ServerResponse
|
|
|
52
52
|
// Health check
|
|
53
53
|
if (req.method === "GET" && url.pathname === "/health") {
|
|
54
54
|
res.writeHead(200, { "Content-Type": "application/json" });
|
|
55
|
-
res.end(JSON.stringify({ ok: true, service: "klamdo-mcp", version: "1.
|
|
55
|
+
res.end(JSON.stringify({ ok: true, service: "klamdo-mcp", version: "1.4.0" }));
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -113,7 +113,7 @@ const httpServer = createServer(async (req: IncomingMessage, res: ServerResponse
|
|
|
113
113
|
res.writeHead(200, { "Content-Type": "application/json" });
|
|
114
114
|
res.end(JSON.stringify({
|
|
115
115
|
service: "Klamdo MCP Server",
|
|
116
|
-
version: "1.
|
|
116
|
+
version: "1.4.0",
|
|
117
117
|
mcpEndpoint: "/mcp",
|
|
118
118
|
docs: "https://klamdo.app/answers",
|
|
119
119
|
getApiKey: "https://klamdo.app/profile"
|
package/src/index.ts
CHANGED
package/src/tools.ts
CHANGED
|
@@ -79,8 +79,8 @@ export const TOOLS = [
|
|
|
79
79
|
{
|
|
80
80
|
name: "generate_video",
|
|
81
81
|
description:
|
|
82
|
-
"Generate a 5-second vertical identity-locked video
|
|
83
|
-
"
|
|
82
|
+
"Generate a 5-second vertical identity-locked video on Klamdo. " +
|
|
83
|
+
"Requires a startFrameAssetId from upload_start_frame. If omitted, falls back to image generation. Costs 6 credits.",
|
|
84
84
|
annotations: {
|
|
85
85
|
readOnlyHint: false,
|
|
86
86
|
destructiveHint: false,
|
|
@@ -93,11 +93,37 @@ export const TOOLS = [
|
|
|
93
93
|
prompt: {
|
|
94
94
|
type: "string",
|
|
95
95
|
description: "Describe the video content with motion cues for best results."
|
|
96
|
+
},
|
|
97
|
+
startFrameAssetId: {
|
|
98
|
+
type: "string",
|
|
99
|
+
description: "Asset ID returned by upload_start_frame. Required for video; without it an image is generated instead."
|
|
96
100
|
}
|
|
97
101
|
},
|
|
98
102
|
required: ["prompt"]
|
|
99
103
|
}
|
|
100
104
|
},
|
|
105
|
+
{
|
|
106
|
+
name: "upload_start_frame",
|
|
107
|
+
description:
|
|
108
|
+
"Upload a start-frame image for video generation. Provide a public HTTPS image URL — " +
|
|
109
|
+
"Klamdo fetches it, stores it, and returns an assetId you pass to generate_video.",
|
|
110
|
+
annotations: {
|
|
111
|
+
readOnlyHint: false,
|
|
112
|
+
destructiveHint: false,
|
|
113
|
+
idempotentHint: true,
|
|
114
|
+
openWorldHint: true
|
|
115
|
+
},
|
|
116
|
+
inputSchema: {
|
|
117
|
+
type: "object",
|
|
118
|
+
properties: {
|
|
119
|
+
imageUrl: {
|
|
120
|
+
type: "string",
|
|
121
|
+
description: "Public HTTPS URL of the image to use as the video start frame. Max 10MB."
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
required: ["imageUrl"]
|
|
125
|
+
}
|
|
126
|
+
},
|
|
101
127
|
{
|
|
102
128
|
name: "check_job",
|
|
103
129
|
description: "Check the status of a Klamdo generation job. Returns status and download URLs when complete.",
|
|
@@ -145,6 +171,107 @@ export const TOOLS = [
|
|
|
145
171
|
}
|
|
146
172
|
}
|
|
147
173
|
}
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "list_packages",
|
|
177
|
+
description: "List Klamdo's available agentic packages, including expected deliverables and required plan tier.",
|
|
178
|
+
annotations: {
|
|
179
|
+
readOnlyHint: true,
|
|
180
|
+
destructiveHint: false,
|
|
181
|
+
idempotentHint: true,
|
|
182
|
+
openWorldHint: true
|
|
183
|
+
},
|
|
184
|
+
inputSchema: { type: "object", properties: {}, additionalProperties: false }
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "create_package",
|
|
188
|
+
description: "Create a Klamdo agentic package job from a business prompt and get back a package ID plus manifest URL.",
|
|
189
|
+
annotations: {
|
|
190
|
+
readOnlyHint: false,
|
|
191
|
+
destructiveHint: false,
|
|
192
|
+
idempotentHint: false,
|
|
193
|
+
openWorldHint: true
|
|
194
|
+
},
|
|
195
|
+
inputSchema: {
|
|
196
|
+
type: "object",
|
|
197
|
+
properties: {
|
|
198
|
+
packageType: {
|
|
199
|
+
type: "string",
|
|
200
|
+
enum: ["digital-marketing", "social-media", "ugc-ad", "coaching-brand", "product-launch", "content-repurpose", "motion-control", "faceless-content", "build-your-own-ai"],
|
|
201
|
+
description: "The Klamdo package to create."
|
|
202
|
+
},
|
|
203
|
+
prompt: {
|
|
204
|
+
type: "string",
|
|
205
|
+
description: "High-level business prompt describing the package goal."
|
|
206
|
+
},
|
|
207
|
+
niche: {
|
|
208
|
+
type: "string",
|
|
209
|
+
description: "Optional niche or audience hint."
|
|
210
|
+
},
|
|
211
|
+
aspectRatio: {
|
|
212
|
+
type: "string",
|
|
213
|
+
enum: ["16:9", "9:16", "1:1"],
|
|
214
|
+
description: "Preferred output aspect ratio. Packages currently support 16:9 and 9:16."
|
|
215
|
+
},
|
|
216
|
+
avatarDurationSeconds: {
|
|
217
|
+
type: "number",
|
|
218
|
+
enum: [30, 60, 90, 180],
|
|
219
|
+
description: "Optional avatar-video duration for packages that include avatar outputs."
|
|
220
|
+
},
|
|
221
|
+
characterType: {
|
|
222
|
+
type: "string",
|
|
223
|
+
enum: ["realistic", "anime", "cartoon", "fantasy", "cyber", "3d"],
|
|
224
|
+
description: "Required for build-your-own-ai packages. Controls the character style and image model."
|
|
225
|
+
},
|
|
226
|
+
uploadedAssetIds: {
|
|
227
|
+
type: "array",
|
|
228
|
+
items: { type: "string" },
|
|
229
|
+
description: "Optional Klamdo asset IDs or URLs to feed into the package."
|
|
230
|
+
},
|
|
231
|
+
options: {
|
|
232
|
+
type: "object",
|
|
233
|
+
properties: {
|
|
234
|
+
useReferencePack: { type: "boolean" },
|
|
235
|
+
skipVoiceover: { type: "boolean" }
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
required: ["packageType", "prompt"]
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: "get_package",
|
|
244
|
+
description: "Get the status, progress, and deliverable counts for a Klamdo package job.",
|
|
245
|
+
annotations: {
|
|
246
|
+
readOnlyHint: true,
|
|
247
|
+
destructiveHint: false,
|
|
248
|
+
idempotentHint: true,
|
|
249
|
+
openWorldHint: true
|
|
250
|
+
},
|
|
251
|
+
inputSchema: {
|
|
252
|
+
type: "object",
|
|
253
|
+
properties: {
|
|
254
|
+
packageId: { type: "string", description: "The package ID returned by create_package." }
|
|
255
|
+
},
|
|
256
|
+
required: ["packageId"]
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
name: "get_package_manifest",
|
|
261
|
+
description: "Fetch the structured package manifest for downstream agent execution.",
|
|
262
|
+
annotations: {
|
|
263
|
+
readOnlyHint: true,
|
|
264
|
+
destructiveHint: false,
|
|
265
|
+
idempotentHint: true,
|
|
266
|
+
openWorldHint: true
|
|
267
|
+
},
|
|
268
|
+
inputSchema: {
|
|
269
|
+
type: "object",
|
|
270
|
+
properties: {
|
|
271
|
+
packageId: { type: "string", description: "The package ID returned by create_package." }
|
|
272
|
+
},
|
|
273
|
+
required: ["packageId"]
|
|
274
|
+
}
|
|
148
275
|
}
|
|
149
276
|
];
|
|
150
277
|
|
|
@@ -182,16 +309,50 @@ export function registerHandlers(server: Server, getApiKey: () => string) {
|
|
|
182
309
|
}
|
|
183
310
|
|
|
184
311
|
case "generate_video": {
|
|
312
|
+
const startFrameAssetId = input.startFrameAssetId ? String(input.startFrameAssetId) : "";
|
|
313
|
+
const isRealVideo = !!startFrameAssetId;
|
|
314
|
+
|
|
185
315
|
const result = await klamdo<{ jobId: string; status: string; creditsReserved: number }>(
|
|
186
316
|
"/jobs",
|
|
187
317
|
apiKey,
|
|
188
|
-
{
|
|
318
|
+
{
|
|
319
|
+
prompt: input.prompt,
|
|
320
|
+
mode: isRealVideo ? "video" : "image",
|
|
321
|
+
aspectRatio: "9:16",
|
|
322
|
+
...(isRealVideo ? { startFrameAssetId } : {}),
|
|
323
|
+
}
|
|
324
|
+
);
|
|
325
|
+
|
|
326
|
+
const modeLabel = isRealVideo ? "Video" : "Image (no start frame provided)";
|
|
327
|
+
const timing = isRealVideo
|
|
328
|
+
? "Videos typically complete in 2–5 minutes."
|
|
329
|
+
: "Images typically complete in 30–90 seconds. To generate a video, use upload_start_frame first.";
|
|
330
|
+
|
|
331
|
+
return {
|
|
332
|
+
content: [
|
|
333
|
+
{
|
|
334
|
+
type: "text",
|
|
335
|
+
text: `${modeLabel} generation started.\n\nJob ID: ${result.jobId}\nStatus: ${result.status}\nCredits reserved: ${result.creditsReserved}\n\n${timing}\n\nUse check_job("${result.jobId}") to get the result.`
|
|
336
|
+
}
|
|
337
|
+
]
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
case "upload_start_frame": {
|
|
342
|
+
const imageUrl = String(input.imageUrl ?? "");
|
|
343
|
+
if (!imageUrl) throw new McpError(ErrorCode.InvalidParams, "imageUrl is required");
|
|
344
|
+
|
|
345
|
+
const result = await klamdo<{ assetId: string; url: string; fileName: string }>(
|
|
346
|
+
"/upload-frame",
|
|
347
|
+
apiKey,
|
|
348
|
+
{ imageUrl }
|
|
189
349
|
);
|
|
350
|
+
|
|
190
351
|
return {
|
|
191
352
|
content: [
|
|
192
353
|
{
|
|
193
354
|
type: "text",
|
|
194
|
-
text: `
|
|
355
|
+
text: `Start frame uploaded.\n\nAsset ID: ${result.assetId}\nFile: ${result.fileName}\n\nPass this assetId to generate_video:\n generate_video({ prompt: "...", startFrameAssetId: "${result.assetId}" })`
|
|
195
356
|
}
|
|
196
357
|
]
|
|
197
358
|
};
|
|
@@ -280,6 +441,119 @@ export function registerHandlers(server: Server, getApiKey: () => string) {
|
|
|
280
441
|
};
|
|
281
442
|
}
|
|
282
443
|
|
|
444
|
+
case "list_packages": {
|
|
445
|
+
const result = await klamdo<{
|
|
446
|
+
planTier: string;
|
|
447
|
+
subscriptionActive: boolean;
|
|
448
|
+
packages: Array<{
|
|
449
|
+
id: string;
|
|
450
|
+
label: string;
|
|
451
|
+
minTier: string;
|
|
452
|
+
estimatedCredits: number;
|
|
453
|
+
accessible: boolean;
|
|
454
|
+
expectedOutputs: {
|
|
455
|
+
textRoles: string[];
|
|
456
|
+
mediaRoles: string[];
|
|
457
|
+
documentRoles: string[];
|
|
458
|
+
};
|
|
459
|
+
}>;
|
|
460
|
+
}>("/packages", apiKey);
|
|
461
|
+
|
|
462
|
+
const lines = [
|
|
463
|
+
`Plan: ${result.planTier}`,
|
|
464
|
+
`Subscription active: ${result.subscriptionActive ? "yes" : "no"}`,
|
|
465
|
+
"",
|
|
466
|
+
...result.packages.map(
|
|
467
|
+
(pkg) =>
|
|
468
|
+
`${pkg.accessible ? "[available]" : "[locked]"} ${pkg.id} — ${pkg.label}\n` +
|
|
469
|
+
` Min tier: ${pkg.minTier}\n` +
|
|
470
|
+
` Estimated credits: ${pkg.estimatedCredits}\n` +
|
|
471
|
+
` Text outputs: ${pkg.expectedOutputs.textRoles.join(", ") || "none"}\n` +
|
|
472
|
+
` Media outputs: ${pkg.expectedOutputs.mediaRoles.join(", ") || "none"}\n` +
|
|
473
|
+
` Document outputs: ${pkg.expectedOutputs.documentRoles.join(", ") || "none"}`
|
|
474
|
+
),
|
|
475
|
+
];
|
|
476
|
+
return {
|
|
477
|
+
content: [{ type: "text", text: lines.join("\n") }]
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
case "create_package": {
|
|
482
|
+
const result = await klamdo<{
|
|
483
|
+
id: string;
|
|
484
|
+
status: string;
|
|
485
|
+
packageType: string;
|
|
486
|
+
progress: { completed: number; total: number };
|
|
487
|
+
manifestUrl: string;
|
|
488
|
+
}>("/packages", apiKey, {
|
|
489
|
+
packageType: input.packageType,
|
|
490
|
+
prompt: input.prompt,
|
|
491
|
+
niche: input.niche,
|
|
492
|
+
aspectRatio: input.aspectRatio,
|
|
493
|
+
avatarDurationSeconds: input.avatarDurationSeconds,
|
|
494
|
+
characterType: input.characterType,
|
|
495
|
+
uploadedAssetIds: input.uploadedAssetIds,
|
|
496
|
+
options: input.options,
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
return {
|
|
500
|
+
content: [
|
|
501
|
+
{
|
|
502
|
+
type: "text",
|
|
503
|
+
text:
|
|
504
|
+
`Package started.\n\nPackage ID: ${result.id}\nType: ${result.packageType}\n` +
|
|
505
|
+
`Status: ${result.status}\nProgress: ${result.progress.completed}/${result.progress.total}\n` +
|
|
506
|
+
`Manifest URL: ${BASE_URL}${result.manifestUrl}\n\n` +
|
|
507
|
+
`Use get_package("${result.id}") for status or get_package_manifest("${result.id}") for the structured deliverables contract.`
|
|
508
|
+
}
|
|
509
|
+
]
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
case "get_package": {
|
|
514
|
+
const packageId = String(input.packageId ?? "");
|
|
515
|
+
if (!packageId) throw new McpError(ErrorCode.InvalidParams, "packageId is required");
|
|
516
|
+
|
|
517
|
+
const result = await klamdo<{
|
|
518
|
+
id: string;
|
|
519
|
+
packageType: string;
|
|
520
|
+
status: string;
|
|
521
|
+
niche: string;
|
|
522
|
+
tier: string;
|
|
523
|
+
progress: { completed: number; total: number };
|
|
524
|
+
deliverableCounts: { text: number; media: number; documents: number; errors: number };
|
|
525
|
+
manifestUrl: string;
|
|
526
|
+
}>(`/packages/${packageId}`, apiKey);
|
|
527
|
+
|
|
528
|
+
return {
|
|
529
|
+
content: [
|
|
530
|
+
{
|
|
531
|
+
type: "text",
|
|
532
|
+
text: [
|
|
533
|
+
`Package ${result.id}`,
|
|
534
|
+
`Type: ${result.packageType}`,
|
|
535
|
+
`Status: ${result.status}`,
|
|
536
|
+
`Niche: ${result.niche}`,
|
|
537
|
+
`Tier: ${result.tier}`,
|
|
538
|
+
`Progress: ${result.progress.completed}/${result.progress.total}`,
|
|
539
|
+
`Deliverables: text=${result.deliverableCounts.text}, media=${result.deliverableCounts.media}, documents=${result.deliverableCounts.documents}, errors=${result.deliverableCounts.errors}`,
|
|
540
|
+
`Manifest URL: ${BASE_URL}${result.manifestUrl}`
|
|
541
|
+
].join("\n")
|
|
542
|
+
}
|
|
543
|
+
]
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
case "get_package_manifest": {
|
|
548
|
+
const packageId = String(input.packageId ?? "");
|
|
549
|
+
if (!packageId) throw new McpError(ErrorCode.InvalidParams, "packageId is required");
|
|
550
|
+
|
|
551
|
+
const result = await klamdo<Record<string, unknown>>(`/packages/${packageId}/manifest`, apiKey);
|
|
552
|
+
return {
|
|
553
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
|
|
283
557
|
default:
|
|
284
558
|
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
285
559
|
}
|
|
@@ -307,7 +581,7 @@ export function registerHandlers(server: Server, getApiKey: () => string) {
|
|
|
307
581
|
{
|
|
308
582
|
uri: "klamdo://docs",
|
|
309
583
|
mimeType: "text/plain",
|
|
310
|
-
text: `# Klamdo MCP Server\n\nTools: generate_image, generate_video, check_job, get_account, list_jobs\n\nGet your API key at https://klamdo.app/profile\
|
|
584
|
+
text: `# Klamdo MCP Server v1.4.0\n\nTools: generate_image, generate_video, upload_start_frame, check_job, get_account, list_jobs, list_packages, create_package, get_package, get_package_manifest\n\nImage/video workflow:\n1. upload_start_frame({ imageUrl: "https://..." }) → assetId\n2. generate_video({ prompt: "...", startFrameAssetId: "asset_xxx" }) → jobId\n3. check_job({ jobId: "job_xxx" }) → status + download URL\n\nPackage workflow:\n1. list_packages()\n2. create_package({ packageType: "coaching-brand", prompt: "Create a coaching launch package for my offer" })\n3. get_package({ packageId: "pkg_xxx" })\n4. get_package_manifest({ packageId: "pkg_xxx" })\n\nGet your API key at https://klamdo.app/profile\nSee current plans and credits at https://klamdo.app/pricing\n`
|
|
311
585
|
}
|
|
312
586
|
]
|
|
313
587
|
};
|