klamdo-mcp 1.2.0 → 1.3.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 +37 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +55 -5
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
- package/smithery.yaml +2 -1
- package/src/http.ts +3 -3
- package/src/index.ts +1 -1
- package/src/tools.ts +65 -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.3.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.3.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.3.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.3.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,6 +27,8 @@ 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;
|
|
32
34
|
};
|
|
@@ -48,7 +50,36 @@ export declare const TOOLS: ({
|
|
|
48
50
|
type: string;
|
|
49
51
|
description: string;
|
|
50
52
|
};
|
|
53
|
+
startFrameAssetId: {
|
|
54
|
+
type: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
aspectRatio?: undefined;
|
|
58
|
+
imageUrl?: undefined;
|
|
59
|
+
jobId?: undefined;
|
|
60
|
+
limit?: undefined;
|
|
61
|
+
};
|
|
62
|
+
required: string[];
|
|
63
|
+
};
|
|
64
|
+
} | {
|
|
65
|
+
name: string;
|
|
66
|
+
description: string;
|
|
67
|
+
annotations: {
|
|
68
|
+
readOnlyHint: boolean;
|
|
69
|
+
destructiveHint: boolean;
|
|
70
|
+
idempotentHint: boolean;
|
|
71
|
+
openWorldHint: boolean;
|
|
72
|
+
};
|
|
73
|
+
inputSchema: {
|
|
74
|
+
type: string;
|
|
75
|
+
properties: {
|
|
76
|
+
imageUrl: {
|
|
77
|
+
type: string;
|
|
78
|
+
description: string;
|
|
79
|
+
};
|
|
80
|
+
prompt?: undefined;
|
|
51
81
|
aspectRatio?: undefined;
|
|
82
|
+
startFrameAssetId?: undefined;
|
|
52
83
|
jobId?: undefined;
|
|
53
84
|
limit?: undefined;
|
|
54
85
|
};
|
|
@@ -72,6 +103,8 @@ export declare const TOOLS: ({
|
|
|
72
103
|
};
|
|
73
104
|
prompt?: undefined;
|
|
74
105
|
aspectRatio?: undefined;
|
|
106
|
+
startFrameAssetId?: undefined;
|
|
107
|
+
imageUrl?: undefined;
|
|
75
108
|
limit?: undefined;
|
|
76
109
|
};
|
|
77
110
|
required: string[];
|
|
@@ -90,6 +123,8 @@ export declare const TOOLS: ({
|
|
|
90
123
|
properties: {
|
|
91
124
|
prompt?: undefined;
|
|
92
125
|
aspectRatio?: undefined;
|
|
126
|
+
startFrameAssetId?: undefined;
|
|
127
|
+
imageUrl?: undefined;
|
|
93
128
|
jobId?: undefined;
|
|
94
129
|
limit?: undefined;
|
|
95
130
|
};
|
|
@@ -114,6 +149,8 @@ export declare const TOOLS: ({
|
|
|
114
149
|
};
|
|
115
150
|
prompt?: undefined;
|
|
116
151
|
aspectRatio?: undefined;
|
|
152
|
+
startFrameAssetId?: undefined;
|
|
153
|
+
imageUrl?: undefined;
|
|
117
154
|
jobId?: undefined;
|
|
118
155
|
};
|
|
119
156
|
required?: undefined;
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8HjB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,QAwMvE"}
|
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.",
|
|
@@ -148,12 +173,37 @@ function registerHandlers(server, getApiKey) {
|
|
|
148
173
|
};
|
|
149
174
|
}
|
|
150
175
|
case "generate_video": {
|
|
151
|
-
const
|
|
176
|
+
const startFrameAssetId = input.startFrameAssetId ? String(input.startFrameAssetId) : "";
|
|
177
|
+
const isRealVideo = !!startFrameAssetId;
|
|
178
|
+
const result = await klamdo("/jobs", apiKey, {
|
|
179
|
+
prompt: input.prompt,
|
|
180
|
+
mode: isRealVideo ? "video" : "image",
|
|
181
|
+
aspectRatio: "9:16",
|
|
182
|
+
...(isRealVideo ? { startFrameAssetId } : {}),
|
|
183
|
+
});
|
|
184
|
+
const modeLabel = isRealVideo ? "Video" : "Image (no start frame provided)";
|
|
185
|
+
const timing = isRealVideo
|
|
186
|
+
? "Videos typically complete in 2–5 minutes."
|
|
187
|
+
: "Images typically complete in 30–90 seconds. To generate a video, use upload_start_frame first.";
|
|
188
|
+
return {
|
|
189
|
+
content: [
|
|
190
|
+
{
|
|
191
|
+
type: "text",
|
|
192
|
+
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.`
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
case "upload_start_frame": {
|
|
198
|
+
const imageUrl = String(input.imageUrl ?? "");
|
|
199
|
+
if (!imageUrl)
|
|
200
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, "imageUrl is required");
|
|
201
|
+
const result = await klamdo("/upload-frame", apiKey, { imageUrl });
|
|
152
202
|
return {
|
|
153
203
|
content: [
|
|
154
204
|
{
|
|
155
205
|
type: "text",
|
|
156
|
-
text: `
|
|
206
|
+
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
207
|
}
|
|
158
208
|
]
|
|
159
209
|
};
|
|
@@ -247,7 +297,7 @@ function registerHandlers(server, getApiKey) {
|
|
|
247
297
|
{
|
|
248
298
|
uri: "klamdo://docs",
|
|
249
299
|
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\nPricing: $
|
|
300
|
+
text: `# Klamdo MCP Server v1.3.0\n\nTools: generate_image, generate_video, upload_start_frame, check_job, get_account, list_jobs\n\nVideo 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\nGet your API key at https://klamdo.app/profile\nPricing: Plans from $29/mo. Image: 3 credits, Video: 6 credits.\n`
|
|
251
301
|
}
|
|
252
302
|
]
|
|
253
303
|
};
|
package/dist/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAcH,wBA6BC;
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAcH,wBA6BC;AAkID,4CAwMC;AAnXD,iEAO4C;AAG/B,QAAA,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,oBAAoB,CAAC;AAErE,KAAK,UAAU,MAAM,CAC1B,IAAY,EACZ,MAAc,EACd,IAA8B;IAE9B,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,gBAAQ,WAAW,IAAI,EAAE,EAAE;QACpD,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK;QAC7B,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,MAAM,EAAE;SAClC;QACD,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;KAC9C,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9C,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YACvB,MAAM,IAAI,mBAAQ,CAChB,oBAAS,CAAC,cAAc,EACxB,6DAA6D,CAC9D,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,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;gBAChC,WAAW,EAAE,+BAA+B;gBAC5C,QAAQ,EAAE,YAAY;aACvB;SACF;KACF,CAAC,CAAC,CAAC;IAEJ,MAAM,CAAC,iBAAiB,CAAC,oCAAyB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QACpE,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,eAAe,EAAE,CAAC;YAC3C,OAAO;gBACL,QAAQ,EAAE;oBACR;wBACE,GAAG,EAAE,eAAe;wBACpB,QAAQ,EAAE,YAAY;wBACtB,IAAI,EAAE,4cAA4c;qBACnd;iBACF;aACF,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,mBAAQ,CAAC,oBAAS,CAAC,cAAc,EAAE,uBAAuB,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5F,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "klamdo-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "MCP server for Klamdo — AI content generation for coaches and creator-founders. Generate 4K images and 5-second vertical videos from a reference photo via Claude Desktop or any MCP-compatible client.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
package/smithery.yaml
CHANGED
|
@@ -8,9 +8,10 @@ description: |
|
|
|
8
8
|
|
|
9
9
|
Requires a Klamdo API key — get yours free at https://klamdo.app/profile
|
|
10
10
|
|
|
11
|
-
version: "1.1
|
|
11
|
+
version: "1.2.1"
|
|
12
12
|
homepage: https://klamdo.app
|
|
13
13
|
documentationUrl: https://klamdo.app/answers
|
|
14
|
+
iconUrl: https://klamdo.app/favicon.ico
|
|
14
15
|
|
|
15
16
|
startCommand:
|
|
16
17
|
type: http
|
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.3.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.3.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.3.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.",
|
|
@@ -182,16 +208,50 @@ export function registerHandlers(server: Server, getApiKey: () => string) {
|
|
|
182
208
|
}
|
|
183
209
|
|
|
184
210
|
case "generate_video": {
|
|
211
|
+
const startFrameAssetId = input.startFrameAssetId ? String(input.startFrameAssetId) : "";
|
|
212
|
+
const isRealVideo = !!startFrameAssetId;
|
|
213
|
+
|
|
185
214
|
const result = await klamdo<{ jobId: string; status: string; creditsReserved: number }>(
|
|
186
215
|
"/jobs",
|
|
187
216
|
apiKey,
|
|
188
|
-
{
|
|
217
|
+
{
|
|
218
|
+
prompt: input.prompt,
|
|
219
|
+
mode: isRealVideo ? "video" : "image",
|
|
220
|
+
aspectRatio: "9:16",
|
|
221
|
+
...(isRealVideo ? { startFrameAssetId } : {}),
|
|
222
|
+
}
|
|
189
223
|
);
|
|
224
|
+
|
|
225
|
+
const modeLabel = isRealVideo ? "Video" : "Image (no start frame provided)";
|
|
226
|
+
const timing = isRealVideo
|
|
227
|
+
? "Videos typically complete in 2–5 minutes."
|
|
228
|
+
: "Images typically complete in 30–90 seconds. To generate a video, use upload_start_frame first.";
|
|
229
|
+
|
|
230
|
+
return {
|
|
231
|
+
content: [
|
|
232
|
+
{
|
|
233
|
+
type: "text",
|
|
234
|
+
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.`
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
case "upload_start_frame": {
|
|
241
|
+
const imageUrl = String(input.imageUrl ?? "");
|
|
242
|
+
if (!imageUrl) throw new McpError(ErrorCode.InvalidParams, "imageUrl is required");
|
|
243
|
+
|
|
244
|
+
const result = await klamdo<{ assetId: string; url: string; fileName: string }>(
|
|
245
|
+
"/upload-frame",
|
|
246
|
+
apiKey,
|
|
247
|
+
{ imageUrl }
|
|
248
|
+
);
|
|
249
|
+
|
|
190
250
|
return {
|
|
191
251
|
content: [
|
|
192
252
|
{
|
|
193
253
|
type: "text",
|
|
194
|
-
text: `
|
|
254
|
+
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
255
|
}
|
|
196
256
|
]
|
|
197
257
|
};
|
|
@@ -307,7 +367,7 @@ export function registerHandlers(server: Server, getApiKey: () => string) {
|
|
|
307
367
|
{
|
|
308
368
|
uri: "klamdo://docs",
|
|
309
369
|
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\nPricing: $
|
|
370
|
+
text: `# Klamdo MCP Server v1.3.0\n\nTools: generate_image, generate_video, upload_start_frame, check_job, get_account, list_jobs\n\nVideo 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\nGet your API key at https://klamdo.app/profile\nPricing: Plans from $29/mo. Image: 3 credits, Video: 6 credits.\n`
|
|
311
371
|
}
|
|
312
372
|
]
|
|
313
373
|
};
|