klamdo-mcp 1.3.0 → 1.4.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.
- package/README.md +161 -0
- package/dist/http.js +3 -3
- package/dist/index.js +1 -1
- package/dist/tools.d.ts +191 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +191 -2
- package/dist/tools.js.map +1 -1
- package/package.json +11 -4
- package/src/http.ts +3 -3
- package/src/index.ts +1 -1
- package/src/tools.ts +233 -2
package/README.md
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# klamdo-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for [Klamdo](https://klamdo.app) — connect your AI agent to Klamdo's creative engine to generate images, videos, and full agentic content packages.
|
|
4
|
+
|
|
5
|
+
## What this does
|
|
6
|
+
|
|
7
|
+
Klamdo is a structured content generation backend. This MCP server exposes its capabilities so any MCP-compatible AI agent (Claude, GPT-4o, custom agents) can:
|
|
8
|
+
|
|
9
|
+
- Generate identity-locked 4K images and 5-second vertical videos from a single reference photo
|
|
10
|
+
- Create **agentic packages** — structured bundles of scripts, captions, images, videos, voiceovers, ebooks, and slide decks generated in one shot
|
|
11
|
+
- Receive machine-readable deliverables via the **package manifest** — a typed contract your agent uses to build landing pages, schedule posts, assemble ebooks, and distribute content downstream
|
|
12
|
+
|
|
13
|
+
## Quick start
|
|
14
|
+
|
|
15
|
+
### stdio (Claude Desktop, local agents)
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx klamdo-mcp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Set your API key via environment variable:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
KLAMDO_API_KEY=your_api_key npx klamdo-mcp
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Get your key at [klamdo.app/profile](https://klamdo.app/profile).
|
|
28
|
+
|
|
29
|
+
### Claude Desktop config
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"mcpServers": {
|
|
34
|
+
"klamdo": {
|
|
35
|
+
"command": "npx",
|
|
36
|
+
"args": ["klamdo-mcp"],
|
|
37
|
+
"env": {
|
|
38
|
+
"KLAMDO_API_KEY": "your_api_key_here"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### HTTP (Smithery / remote agents)
|
|
46
|
+
|
|
47
|
+
Available at `mcp.klamdo.app` — connect via Smithery or any HTTP MCP client with your API key as the `Authorization: Bearer` header.
|
|
48
|
+
|
|
49
|
+
## Tools
|
|
50
|
+
|
|
51
|
+
| Tool | Description |
|
|
52
|
+
|---|---|
|
|
53
|
+
| `get_account` | Credit balance, plan tier, free sample eligibility |
|
|
54
|
+
| `list_jobs` | Recent generation jobs, newest first |
|
|
55
|
+
| `generate_image` | Start a 4K image generation job (3 credits) |
|
|
56
|
+
| `generate_video` | Start a 5-second vertical video job (6 credits) |
|
|
57
|
+
| `upload_start_frame` | Upload a reference image for video generation |
|
|
58
|
+
| `check_job` | Poll a job for status and download URLs |
|
|
59
|
+
| `list_packages` | List available agentic packages with deliverable breakdown |
|
|
60
|
+
| `create_package` | Start an agentic package job from a business prompt |
|
|
61
|
+
| `get_package` | Poll a package for status and progress |
|
|
62
|
+
| `get_package_manifest` | Fetch the structured deliverables manifest for downstream agent use |
|
|
63
|
+
|
|
64
|
+
## Image / video workflow
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
1. upload_start_frame({ imageUrl: "https://your-cdn.com/photo.jpg" })
|
|
68
|
+
→ { assetId: "asset_xxx" }
|
|
69
|
+
|
|
70
|
+
2. generate_video({ prompt: "...", startFrameAssetId: "asset_xxx" })
|
|
71
|
+
→ { jobId: "job_xxx" }
|
|
72
|
+
|
|
73
|
+
3. check_job({ jobId: "job_xxx" })
|
|
74
|
+
→ { status: "completed", assets: [{ kind: "video", url: "..." }] }
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Agentic package workflow
|
|
78
|
+
|
|
79
|
+
Packages generate a full content bundle in one call — scripts, images, videos, voiceover, ebook outline, slide deck, captions — and return a typed manifest your agent can use to build and distribute.
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
1. list_packages({ accessibleOnly: true })
|
|
83
|
+
→ see what's available on your plan
|
|
84
|
+
|
|
85
|
+
2. create_package({
|
|
86
|
+
packageType: "coaching-brand",
|
|
87
|
+
prompt: "Launch package for my 90-day coaching offer targeting new entrepreneurs",
|
|
88
|
+
niche: "business coaching",
|
|
89
|
+
avatarDurationSeconds: 60
|
|
90
|
+
})
|
|
91
|
+
→ { id: "pkg_xxx", manifestUrl: "/api/mcp/packages/pkg_xxx/manifest" }
|
|
92
|
+
|
|
93
|
+
3. get_package({ packageId: "pkg_xxx" })
|
|
94
|
+
→ { status: "processing", progress: { completed: 4, total: 11 } }
|
|
95
|
+
|
|
96
|
+
4. get_package_manifest({ packageId: "pkg_xxx" })
|
|
97
|
+
→ structured manifest with text[], media[], documents[], buildHints
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Package manifest
|
|
101
|
+
|
|
102
|
+
The manifest is a machine-readable contract — not just a list of files. Each deliverable has a typed `role` so your agent knows what to do with it:
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"outputs": {
|
|
107
|
+
"text": [
|
|
108
|
+
{ "role": "script", "text": "..." },
|
|
109
|
+
{ "role": "landing_page_copy", "text": "..." },
|
|
110
|
+
{ "role": "email_sequence", "text": "..." }
|
|
111
|
+
],
|
|
112
|
+
"media": [
|
|
113
|
+
{ "role": "hero_image", "url": "https://..." },
|
|
114
|
+
{ "role": "avatar_video", "url": "https://..." }
|
|
115
|
+
],
|
|
116
|
+
"documents": [
|
|
117
|
+
{ "role": "slide_deck", "url": "https://..." },
|
|
118
|
+
{ "role": "pdf_ebook", "url": "https://..." }
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
"buildHints": {
|
|
122
|
+
"primaryOffer": "...",
|
|
123
|
+
"primaryCTA": "...",
|
|
124
|
+
"recommendedExecutionOrder": ["landing_page_copy", "hero_image", "avatar_video", ...],
|
|
125
|
+
"heroAssetIds": ["..."],
|
|
126
|
+
"landingPageSourceIds": ["..."]
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Your agent fans out: builds the landing page from `landing_page_copy`, populates the ebook from `ebook_outline`, schedules the `avatar_video`, posts the `hero_image` — all from a single manifest.
|
|
132
|
+
|
|
133
|
+
## Package types
|
|
134
|
+
|
|
135
|
+
| Package | Min tier | Key outputs |
|
|
136
|
+
|---|---|---|
|
|
137
|
+
| `digital-marketing` | Starter | scripts, images, video, avatar video, voiceover |
|
|
138
|
+
| `social-media` | Starter | captions, content calendar, images, avatar video |
|
|
139
|
+
| `ugc-ad` | Creator | UGC scripts, ad images, ad video |
|
|
140
|
+
| `coaching-brand` | Creator | scripts, avatar video, slide deck, PDF lead magnet |
|
|
141
|
+
| `product-launch` | Pro | landing page copy, email sequence, images, avatar video, slide deck |
|
|
142
|
+
| `content-repurpose` | Starter | repurposed text, images, video, slide deck |
|
|
143
|
+
| `motion-control` | Creator | motion-controlled video |
|
|
144
|
+
| `faceless-content` | Creator | faceless video with voiceover |
|
|
145
|
+
| `build-your-own-ai` | Starter | 10 AI character images (realistic/anime/cartoon/fantasy/cyber/3D) |
|
|
146
|
+
|
|
147
|
+
## Auth
|
|
148
|
+
|
|
149
|
+
All tools require a Klamdo API key. Get yours at [klamdo.app/profile](https://klamdo.app/profile).
|
|
150
|
+
|
|
151
|
+
- **stdio**: set `KLAMDO_API_KEY` environment variable
|
|
152
|
+
- **HTTP**: pass `Authorization: Bearer <key>` header
|
|
153
|
+
|
|
154
|
+
## Requirements
|
|
155
|
+
|
|
156
|
+
- Node.js ≥ 18
|
|
157
|
+
- A Klamdo account with an agentic plan tier for package tools (free sample available for image/video)
|
|
158
|
+
|
|
159
|
+
## Issues
|
|
160
|
+
|
|
161
|
+
[github.com/Markus864/klamdo-mcp/issues](https://github.com/Markus864/klamdo-mcp/issues)
|
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
|
@@ -31,8 +31,17 @@ export declare const TOOLS: ({
|
|
|
31
31
|
imageUrl?: undefined;
|
|
32
32
|
jobId?: undefined;
|
|
33
33
|
limit?: undefined;
|
|
34
|
+
accessibleOnly?: undefined;
|
|
35
|
+
packageType?: undefined;
|
|
36
|
+
niche?: undefined;
|
|
37
|
+
avatarDurationSeconds?: undefined;
|
|
38
|
+
characterType?: undefined;
|
|
39
|
+
uploadedAssetIds?: undefined;
|
|
40
|
+
options?: undefined;
|
|
41
|
+
packageId?: undefined;
|
|
34
42
|
};
|
|
35
43
|
required: string[];
|
|
44
|
+
additionalProperties?: undefined;
|
|
36
45
|
};
|
|
37
46
|
} | {
|
|
38
47
|
name: string;
|
|
@@ -58,8 +67,17 @@ export declare const TOOLS: ({
|
|
|
58
67
|
imageUrl?: undefined;
|
|
59
68
|
jobId?: undefined;
|
|
60
69
|
limit?: undefined;
|
|
70
|
+
accessibleOnly?: undefined;
|
|
71
|
+
packageType?: undefined;
|
|
72
|
+
niche?: undefined;
|
|
73
|
+
avatarDurationSeconds?: undefined;
|
|
74
|
+
characterType?: undefined;
|
|
75
|
+
uploadedAssetIds?: undefined;
|
|
76
|
+
options?: undefined;
|
|
77
|
+
packageId?: undefined;
|
|
61
78
|
};
|
|
62
79
|
required: string[];
|
|
80
|
+
additionalProperties?: undefined;
|
|
63
81
|
};
|
|
64
82
|
} | {
|
|
65
83
|
name: string;
|
|
@@ -82,8 +100,17 @@ export declare const TOOLS: ({
|
|
|
82
100
|
startFrameAssetId?: undefined;
|
|
83
101
|
jobId?: undefined;
|
|
84
102
|
limit?: undefined;
|
|
103
|
+
accessibleOnly?: undefined;
|
|
104
|
+
packageType?: undefined;
|
|
105
|
+
niche?: undefined;
|
|
106
|
+
avatarDurationSeconds?: undefined;
|
|
107
|
+
characterType?: undefined;
|
|
108
|
+
uploadedAssetIds?: undefined;
|
|
109
|
+
options?: undefined;
|
|
110
|
+
packageId?: undefined;
|
|
85
111
|
};
|
|
86
112
|
required: string[];
|
|
113
|
+
additionalProperties?: undefined;
|
|
87
114
|
};
|
|
88
115
|
} | {
|
|
89
116
|
name: string;
|
|
@@ -106,8 +133,17 @@ export declare const TOOLS: ({
|
|
|
106
133
|
startFrameAssetId?: undefined;
|
|
107
134
|
imageUrl?: undefined;
|
|
108
135
|
limit?: undefined;
|
|
136
|
+
accessibleOnly?: undefined;
|
|
137
|
+
packageType?: undefined;
|
|
138
|
+
niche?: undefined;
|
|
139
|
+
avatarDurationSeconds?: undefined;
|
|
140
|
+
characterType?: undefined;
|
|
141
|
+
uploadedAssetIds?: undefined;
|
|
142
|
+
options?: undefined;
|
|
143
|
+
packageId?: undefined;
|
|
109
144
|
};
|
|
110
145
|
required: string[];
|
|
146
|
+
additionalProperties?: undefined;
|
|
111
147
|
};
|
|
112
148
|
} | {
|
|
113
149
|
name: string;
|
|
@@ -127,8 +163,17 @@ export declare const TOOLS: ({
|
|
|
127
163
|
imageUrl?: undefined;
|
|
128
164
|
jobId?: undefined;
|
|
129
165
|
limit?: undefined;
|
|
166
|
+
accessibleOnly?: undefined;
|
|
167
|
+
packageType?: undefined;
|
|
168
|
+
niche?: undefined;
|
|
169
|
+
avatarDurationSeconds?: undefined;
|
|
170
|
+
characterType?: undefined;
|
|
171
|
+
uploadedAssetIds?: undefined;
|
|
172
|
+
options?: undefined;
|
|
173
|
+
packageId?: undefined;
|
|
130
174
|
};
|
|
131
|
-
required
|
|
175
|
+
required: never[];
|
|
176
|
+
additionalProperties: boolean;
|
|
132
177
|
};
|
|
133
178
|
} | {
|
|
134
179
|
name: string;
|
|
@@ -152,8 +197,153 @@ export declare const TOOLS: ({
|
|
|
152
197
|
startFrameAssetId?: undefined;
|
|
153
198
|
imageUrl?: undefined;
|
|
154
199
|
jobId?: undefined;
|
|
200
|
+
accessibleOnly?: undefined;
|
|
201
|
+
packageType?: undefined;
|
|
202
|
+
niche?: undefined;
|
|
203
|
+
avatarDurationSeconds?: undefined;
|
|
204
|
+
characterType?: undefined;
|
|
205
|
+
uploadedAssetIds?: undefined;
|
|
206
|
+
options?: undefined;
|
|
207
|
+
packageId?: undefined;
|
|
155
208
|
};
|
|
156
209
|
required?: undefined;
|
|
210
|
+
additionalProperties?: undefined;
|
|
211
|
+
};
|
|
212
|
+
} | {
|
|
213
|
+
name: string;
|
|
214
|
+
description: string;
|
|
215
|
+
annotations: {
|
|
216
|
+
readOnlyHint: boolean;
|
|
217
|
+
destructiveHint: boolean;
|
|
218
|
+
idempotentHint: boolean;
|
|
219
|
+
openWorldHint: boolean;
|
|
220
|
+
};
|
|
221
|
+
inputSchema: {
|
|
222
|
+
type: string;
|
|
223
|
+
properties: {
|
|
224
|
+
accessibleOnly: {
|
|
225
|
+
type: string;
|
|
226
|
+
description: string;
|
|
227
|
+
default: boolean;
|
|
228
|
+
};
|
|
229
|
+
prompt?: undefined;
|
|
230
|
+
aspectRatio?: undefined;
|
|
231
|
+
startFrameAssetId?: undefined;
|
|
232
|
+
imageUrl?: undefined;
|
|
233
|
+
jobId?: undefined;
|
|
234
|
+
limit?: undefined;
|
|
235
|
+
packageType?: undefined;
|
|
236
|
+
niche?: undefined;
|
|
237
|
+
avatarDurationSeconds?: undefined;
|
|
238
|
+
characterType?: undefined;
|
|
239
|
+
uploadedAssetIds?: undefined;
|
|
240
|
+
options?: undefined;
|
|
241
|
+
packageId?: undefined;
|
|
242
|
+
};
|
|
243
|
+
required: never[];
|
|
244
|
+
additionalProperties: boolean;
|
|
245
|
+
};
|
|
246
|
+
} | {
|
|
247
|
+
name: string;
|
|
248
|
+
description: string;
|
|
249
|
+
annotations: {
|
|
250
|
+
readOnlyHint: boolean;
|
|
251
|
+
destructiveHint: boolean;
|
|
252
|
+
idempotentHint: boolean;
|
|
253
|
+
openWorldHint: boolean;
|
|
254
|
+
};
|
|
255
|
+
inputSchema: {
|
|
256
|
+
type: string;
|
|
257
|
+
properties: {
|
|
258
|
+
packageType: {
|
|
259
|
+
type: string;
|
|
260
|
+
enum: string[];
|
|
261
|
+
description: string;
|
|
262
|
+
};
|
|
263
|
+
prompt: {
|
|
264
|
+
type: string;
|
|
265
|
+
description: string;
|
|
266
|
+
};
|
|
267
|
+
niche: {
|
|
268
|
+
type: string;
|
|
269
|
+
description: string;
|
|
270
|
+
};
|
|
271
|
+
aspectRatio: {
|
|
272
|
+
type: string;
|
|
273
|
+
enum: string[];
|
|
274
|
+
description: string;
|
|
275
|
+
default?: undefined;
|
|
276
|
+
};
|
|
277
|
+
avatarDurationSeconds: {
|
|
278
|
+
type: string;
|
|
279
|
+
enum: number[];
|
|
280
|
+
description: string;
|
|
281
|
+
};
|
|
282
|
+
characterType: {
|
|
283
|
+
type: string;
|
|
284
|
+
enum: string[];
|
|
285
|
+
description: string;
|
|
286
|
+
};
|
|
287
|
+
uploadedAssetIds: {
|
|
288
|
+
type: string;
|
|
289
|
+
items: {
|
|
290
|
+
type: string;
|
|
291
|
+
};
|
|
292
|
+
description: string;
|
|
293
|
+
};
|
|
294
|
+
options: {
|
|
295
|
+
type: string;
|
|
296
|
+
properties: {
|
|
297
|
+
useReferencePack: {
|
|
298
|
+
type: string;
|
|
299
|
+
};
|
|
300
|
+
skipVoiceover: {
|
|
301
|
+
type: string;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
startFrameAssetId?: undefined;
|
|
306
|
+
imageUrl?: undefined;
|
|
307
|
+
jobId?: undefined;
|
|
308
|
+
limit?: undefined;
|
|
309
|
+
accessibleOnly?: undefined;
|
|
310
|
+
packageId?: undefined;
|
|
311
|
+
};
|
|
312
|
+
required: string[];
|
|
313
|
+
additionalProperties?: undefined;
|
|
314
|
+
};
|
|
315
|
+
} | {
|
|
316
|
+
name: string;
|
|
317
|
+
description: string;
|
|
318
|
+
annotations: {
|
|
319
|
+
readOnlyHint: boolean;
|
|
320
|
+
destructiveHint: boolean;
|
|
321
|
+
idempotentHint: boolean;
|
|
322
|
+
openWorldHint: boolean;
|
|
323
|
+
};
|
|
324
|
+
inputSchema: {
|
|
325
|
+
type: string;
|
|
326
|
+
properties: {
|
|
327
|
+
packageId: {
|
|
328
|
+
type: string;
|
|
329
|
+
description: string;
|
|
330
|
+
};
|
|
331
|
+
prompt?: undefined;
|
|
332
|
+
aspectRatio?: undefined;
|
|
333
|
+
startFrameAssetId?: undefined;
|
|
334
|
+
imageUrl?: undefined;
|
|
335
|
+
jobId?: undefined;
|
|
336
|
+
limit?: undefined;
|
|
337
|
+
accessibleOnly?: undefined;
|
|
338
|
+
packageType?: undefined;
|
|
339
|
+
niche?: undefined;
|
|
340
|
+
avatarDurationSeconds?: undefined;
|
|
341
|
+
characterType?: undefined;
|
|
342
|
+
uploadedAssetIds?: undefined;
|
|
343
|
+
options?: undefined;
|
|
344
|
+
};
|
|
345
|
+
required: string[];
|
|
346
|
+
additionalProperties?: undefined;
|
|
157
347
|
};
|
|
158
348
|
})[];
|
|
159
349
|
export declare function registerHandlers(server: Server, getApiKey: () => string): void;
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8OjB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,QA+TvE"}
|
package/dist/tools.js
CHANGED
|
@@ -127,7 +127,7 @@ exports.TOOLS = [
|
|
|
127
127
|
idempotentHint: true,
|
|
128
128
|
openWorldHint: true
|
|
129
129
|
},
|
|
130
|
-
inputSchema: { type: "object", properties: {} }
|
|
130
|
+
inputSchema: { type: "object", properties: {}, required: [], additionalProperties: false }
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
133
|
name: "list_jobs",
|
|
@@ -148,6 +148,118 @@ exports.TOOLS = [
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
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: {
|
|
162
|
+
type: "object",
|
|
163
|
+
properties: {
|
|
164
|
+
accessibleOnly: {
|
|
165
|
+
type: "boolean",
|
|
166
|
+
description: "When true, returns only packages accessible on the user's current plan tier. Default: false (returns all packages with an 'accessible' flag on each).",
|
|
167
|
+
default: false
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
required: [],
|
|
171
|
+
additionalProperties: false
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: "create_package",
|
|
176
|
+
description: "Create a Klamdo agentic package job from a business prompt and get back a package ID plus manifest URL.",
|
|
177
|
+
annotations: {
|
|
178
|
+
readOnlyHint: false,
|
|
179
|
+
destructiveHint: false,
|
|
180
|
+
idempotentHint: false,
|
|
181
|
+
openWorldHint: true
|
|
182
|
+
},
|
|
183
|
+
inputSchema: {
|
|
184
|
+
type: "object",
|
|
185
|
+
properties: {
|
|
186
|
+
packageType: {
|
|
187
|
+
type: "string",
|
|
188
|
+
enum: ["digital-marketing", "social-media", "ugc-ad", "coaching-brand", "product-launch", "content-repurpose", "motion-control", "faceless-content", "build-your-own-ai"],
|
|
189
|
+
description: "The Klamdo package to create."
|
|
190
|
+
},
|
|
191
|
+
prompt: {
|
|
192
|
+
type: "string",
|
|
193
|
+
description: "High-level business prompt describing the package goal."
|
|
194
|
+
},
|
|
195
|
+
niche: {
|
|
196
|
+
type: "string",
|
|
197
|
+
description: "Optional niche or audience hint."
|
|
198
|
+
},
|
|
199
|
+
aspectRatio: {
|
|
200
|
+
type: "string",
|
|
201
|
+
enum: ["16:9", "9:16", "1:1"],
|
|
202
|
+
description: "Preferred output aspect ratio. Packages currently support 16:9 and 9:16."
|
|
203
|
+
},
|
|
204
|
+
avatarDurationSeconds: {
|
|
205
|
+
type: "number",
|
|
206
|
+
enum: [30, 60, 90, 180],
|
|
207
|
+
description: "Optional avatar-video duration for packages that include avatar outputs."
|
|
208
|
+
},
|
|
209
|
+
characterType: {
|
|
210
|
+
type: "string",
|
|
211
|
+
enum: ["realistic", "anime", "cartoon", "fantasy", "cyber", "3d"],
|
|
212
|
+
description: "Required for build-your-own-ai packages. Controls the character style and image model."
|
|
213
|
+
},
|
|
214
|
+
uploadedAssetIds: {
|
|
215
|
+
type: "array",
|
|
216
|
+
items: { type: "string" },
|
|
217
|
+
description: "Optional Klamdo asset IDs or URLs to feed into the package."
|
|
218
|
+
},
|
|
219
|
+
options: {
|
|
220
|
+
type: "object",
|
|
221
|
+
properties: {
|
|
222
|
+
useReferencePack: { type: "boolean" },
|
|
223
|
+
skipVoiceover: { type: "boolean" }
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
required: ["packageType", "prompt"]
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
name: "get_package",
|
|
232
|
+
description: "Get the status, progress, and deliverable counts for a Klamdo package job.",
|
|
233
|
+
annotations: {
|
|
234
|
+
readOnlyHint: true,
|
|
235
|
+
destructiveHint: false,
|
|
236
|
+
idempotentHint: true,
|
|
237
|
+
openWorldHint: true
|
|
238
|
+
},
|
|
239
|
+
inputSchema: {
|
|
240
|
+
type: "object",
|
|
241
|
+
properties: {
|
|
242
|
+
packageId: { type: "string", description: "The package ID returned by create_package." }
|
|
243
|
+
},
|
|
244
|
+
required: ["packageId"]
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
name: "get_package_manifest",
|
|
249
|
+
description: "Fetch the structured package manifest for downstream agent execution.",
|
|
250
|
+
annotations: {
|
|
251
|
+
readOnlyHint: true,
|
|
252
|
+
destructiveHint: false,
|
|
253
|
+
idempotentHint: true,
|
|
254
|
+
openWorldHint: true
|
|
255
|
+
},
|
|
256
|
+
inputSchema: {
|
|
257
|
+
type: "object",
|
|
258
|
+
properties: {
|
|
259
|
+
packageId: { type: "string", description: "The package ID returned by create_package." }
|
|
260
|
+
},
|
|
261
|
+
required: ["packageId"]
|
|
262
|
+
}
|
|
151
263
|
}
|
|
152
264
|
];
|
|
153
265
|
function registerHandlers(server, getApiKey) {
|
|
@@ -270,6 +382,83 @@ function registerHandlers(server, getApiKey) {
|
|
|
270
382
|
content: [{ type: "text", text: lines.length ? lines.join("\n") : "No jobs found." }]
|
|
271
383
|
};
|
|
272
384
|
}
|
|
385
|
+
case "list_packages": {
|
|
386
|
+
const result = await klamdo("/packages", apiKey);
|
|
387
|
+
const accessibleOnly = input.accessibleOnly === true;
|
|
388
|
+
const packages = accessibleOnly
|
|
389
|
+
? result.packages.filter((pkg) => pkg.accessible)
|
|
390
|
+
: result.packages;
|
|
391
|
+
const lines = [
|
|
392
|
+
`Plan: ${result.planTier}`,
|
|
393
|
+
`Subscription active: ${result.subscriptionActive ? "yes" : "no"}`,
|
|
394
|
+
accessibleOnly ? `Showing: accessible packages only` : `Showing: all packages (${result.packages.filter((p) => p.accessible).length} accessible on your plan)`,
|
|
395
|
+
"",
|
|
396
|
+
...packages.map((pkg) => `${pkg.accessible ? "[available]" : "[locked]"} ${pkg.id} — ${pkg.label}\n` +
|
|
397
|
+
` Min tier: ${pkg.minTier}\n` +
|
|
398
|
+
` Estimated credits: ${pkg.estimatedCredits}\n` +
|
|
399
|
+
` Text outputs: ${pkg.expectedOutputs.textRoles.join(", ") || "none"}\n` +
|
|
400
|
+
` Media outputs: ${pkg.expectedOutputs.mediaRoles.join(", ") || "none"}\n` +
|
|
401
|
+
` Document outputs: ${pkg.expectedOutputs.documentRoles.join(", ") || "none"}`),
|
|
402
|
+
];
|
|
403
|
+
return {
|
|
404
|
+
content: [{ type: "text", text: lines.join("\n") }]
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
case "create_package": {
|
|
408
|
+
const result = await klamdo("/packages", apiKey, {
|
|
409
|
+
packageType: input.packageType,
|
|
410
|
+
prompt: input.prompt,
|
|
411
|
+
niche: input.niche,
|
|
412
|
+
aspectRatio: input.aspectRatio,
|
|
413
|
+
avatarDurationSeconds: input.avatarDurationSeconds,
|
|
414
|
+
characterType: input.characterType,
|
|
415
|
+
uploadedAssetIds: input.uploadedAssetIds,
|
|
416
|
+
options: input.options,
|
|
417
|
+
});
|
|
418
|
+
return {
|
|
419
|
+
content: [
|
|
420
|
+
{
|
|
421
|
+
type: "text",
|
|
422
|
+
text: `Package started.\n\nPackage ID: ${result.id}\nType: ${result.packageType}\n` +
|
|
423
|
+
`Status: ${result.status}\nProgress: ${result.progress.completed}/${result.progress.total}\n` +
|
|
424
|
+
`Manifest URL: ${exports.BASE_URL}${result.manifestUrl}\n\n` +
|
|
425
|
+
`Use get_package("${result.id}") for status or get_package_manifest("${result.id}") for the structured deliverables contract.`
|
|
426
|
+
}
|
|
427
|
+
]
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
case "get_package": {
|
|
431
|
+
const packageId = String(input.packageId ?? "");
|
|
432
|
+
if (!packageId)
|
|
433
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, "packageId is required");
|
|
434
|
+
const result = await klamdo(`/packages/${packageId}`, apiKey);
|
|
435
|
+
return {
|
|
436
|
+
content: [
|
|
437
|
+
{
|
|
438
|
+
type: "text",
|
|
439
|
+
text: [
|
|
440
|
+
`Package ${result.id}`,
|
|
441
|
+
`Type: ${result.packageType}`,
|
|
442
|
+
`Status: ${result.status}`,
|
|
443
|
+
`Niche: ${result.niche}`,
|
|
444
|
+
`Tier: ${result.tier}`,
|
|
445
|
+
`Progress: ${result.progress.completed}/${result.progress.total}`,
|
|
446
|
+
`Deliverables: text=${result.deliverableCounts.text}, media=${result.deliverableCounts.media}, documents=${result.deliverableCounts.documents}, errors=${result.deliverableCounts.errors}`,
|
|
447
|
+
`Manifest URL: ${exports.BASE_URL}${result.manifestUrl}`
|
|
448
|
+
].join("\n")
|
|
449
|
+
}
|
|
450
|
+
]
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
case "get_package_manifest": {
|
|
454
|
+
const packageId = String(input.packageId ?? "");
|
|
455
|
+
if (!packageId)
|
|
456
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, "packageId is required");
|
|
457
|
+
const result = await klamdo(`/packages/${packageId}/manifest`, apiKey);
|
|
458
|
+
return {
|
|
459
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
460
|
+
};
|
|
461
|
+
}
|
|
273
462
|
default:
|
|
274
463
|
throw new types_js_1.McpError(types_js_1.ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
275
464
|
}
|
|
@@ -297,7 +486,7 @@ function registerHandlers(server, getApiKey) {
|
|
|
297
486
|
{
|
|
298
487
|
uri: "klamdo://docs",
|
|
299
488
|
mimeType: "text/plain",
|
|
300
|
-
text: `# Klamdo MCP Server v1.
|
|
489
|
+
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`
|
|
301
490
|
}
|
|
302
491
|
]
|
|
303
492
|
};
|
package/dist/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
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AChG,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,iBAAiB,CAAC,qCAA0B,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAChE,SAAS,EAAE;YACT;gBACE,GAAG,EAAE,eAAe;gBACpB,IAAI,EAAE,0BAA0B;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,qwBAAqwB;qBAC5wB;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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"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.1",
|
|
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"
|
|
@@ -13,9 +13,16 @@
|
|
|
13
13
|
"dev": "ts-node src/index.ts",
|
|
14
14
|
"dev:http": "ts-node src/http.ts"
|
|
15
15
|
},
|
|
16
|
-
"
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/Markus864/klamdo-mcp.git"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/Markus864/klamdo-mcp#readme",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/Markus864/klamdo-mcp/issues"
|
|
23
|
+
},
|
|
17
24
|
"author": "Klamdo <hello@klamdo.app> (https://klamdo.app)",
|
|
18
|
-
"keywords": ["mcp", "klamdo", "ai-content", "image-generation", "video-generation", "creator-tools"],
|
|
25
|
+
"keywords": ["mcp", "klamdo", "ai-content", "image-generation", "video-generation", "creator-tools", "agentic", "content-generation", "model-context-protocol"],
|
|
19
26
|
"license": "MIT",
|
|
20
27
|
"dependencies": {
|
|
21
28
|
"@modelcontextprotocol/sdk": "^1.10.0"
|
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
|
@@ -150,7 +150,7 @@ export const TOOLS = [
|
|
|
150
150
|
idempotentHint: true,
|
|
151
151
|
openWorldHint: true
|
|
152
152
|
},
|
|
153
|
-
inputSchema: { type: "object", properties: {} }
|
|
153
|
+
inputSchema: { type: "object", properties: {}, required: [], additionalProperties: false }
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
156
|
name: "list_jobs",
|
|
@@ -171,6 +171,118 @@ export const TOOLS = [
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
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: {
|
|
185
|
+
type: "object",
|
|
186
|
+
properties: {
|
|
187
|
+
accessibleOnly: {
|
|
188
|
+
type: "boolean",
|
|
189
|
+
description: "When true, returns only packages accessible on the user's current plan tier. Default: false (returns all packages with an 'accessible' flag on each).",
|
|
190
|
+
default: false
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
required: [],
|
|
194
|
+
additionalProperties: false
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: "create_package",
|
|
199
|
+
description: "Create a Klamdo agentic package job from a business prompt and get back a package ID plus manifest URL.",
|
|
200
|
+
annotations: {
|
|
201
|
+
readOnlyHint: false,
|
|
202
|
+
destructiveHint: false,
|
|
203
|
+
idempotentHint: false,
|
|
204
|
+
openWorldHint: true
|
|
205
|
+
},
|
|
206
|
+
inputSchema: {
|
|
207
|
+
type: "object",
|
|
208
|
+
properties: {
|
|
209
|
+
packageType: {
|
|
210
|
+
type: "string",
|
|
211
|
+
enum: ["digital-marketing", "social-media", "ugc-ad", "coaching-brand", "product-launch", "content-repurpose", "motion-control", "faceless-content", "build-your-own-ai"],
|
|
212
|
+
description: "The Klamdo package to create."
|
|
213
|
+
},
|
|
214
|
+
prompt: {
|
|
215
|
+
type: "string",
|
|
216
|
+
description: "High-level business prompt describing the package goal."
|
|
217
|
+
},
|
|
218
|
+
niche: {
|
|
219
|
+
type: "string",
|
|
220
|
+
description: "Optional niche or audience hint."
|
|
221
|
+
},
|
|
222
|
+
aspectRatio: {
|
|
223
|
+
type: "string",
|
|
224
|
+
enum: ["16:9", "9:16", "1:1"],
|
|
225
|
+
description: "Preferred output aspect ratio. Packages currently support 16:9 and 9:16."
|
|
226
|
+
},
|
|
227
|
+
avatarDurationSeconds: {
|
|
228
|
+
type: "number",
|
|
229
|
+
enum: [30, 60, 90, 180],
|
|
230
|
+
description: "Optional avatar-video duration for packages that include avatar outputs."
|
|
231
|
+
},
|
|
232
|
+
characterType: {
|
|
233
|
+
type: "string",
|
|
234
|
+
enum: ["realistic", "anime", "cartoon", "fantasy", "cyber", "3d"],
|
|
235
|
+
description: "Required for build-your-own-ai packages. Controls the character style and image model."
|
|
236
|
+
},
|
|
237
|
+
uploadedAssetIds: {
|
|
238
|
+
type: "array",
|
|
239
|
+
items: { type: "string" },
|
|
240
|
+
description: "Optional Klamdo asset IDs or URLs to feed into the package."
|
|
241
|
+
},
|
|
242
|
+
options: {
|
|
243
|
+
type: "object",
|
|
244
|
+
properties: {
|
|
245
|
+
useReferencePack: { type: "boolean" },
|
|
246
|
+
skipVoiceover: { type: "boolean" }
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
required: ["packageType", "prompt"]
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
name: "get_package",
|
|
255
|
+
description: "Get the status, progress, and deliverable counts for a Klamdo package job.",
|
|
256
|
+
annotations: {
|
|
257
|
+
readOnlyHint: true,
|
|
258
|
+
destructiveHint: false,
|
|
259
|
+
idempotentHint: true,
|
|
260
|
+
openWorldHint: true
|
|
261
|
+
},
|
|
262
|
+
inputSchema: {
|
|
263
|
+
type: "object",
|
|
264
|
+
properties: {
|
|
265
|
+
packageId: { type: "string", description: "The package ID returned by create_package." }
|
|
266
|
+
},
|
|
267
|
+
required: ["packageId"]
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
name: "get_package_manifest",
|
|
272
|
+
description: "Fetch the structured package manifest for downstream agent execution.",
|
|
273
|
+
annotations: {
|
|
274
|
+
readOnlyHint: true,
|
|
275
|
+
destructiveHint: false,
|
|
276
|
+
idempotentHint: true,
|
|
277
|
+
openWorldHint: true
|
|
278
|
+
},
|
|
279
|
+
inputSchema: {
|
|
280
|
+
type: "object",
|
|
281
|
+
properties: {
|
|
282
|
+
packageId: { type: "string", description: "The package ID returned by create_package." }
|
|
283
|
+
},
|
|
284
|
+
required: ["packageId"]
|
|
285
|
+
}
|
|
174
286
|
}
|
|
175
287
|
];
|
|
176
288
|
|
|
@@ -340,6 +452,125 @@ export function registerHandlers(server: Server, getApiKey: () => string) {
|
|
|
340
452
|
};
|
|
341
453
|
}
|
|
342
454
|
|
|
455
|
+
case "list_packages": {
|
|
456
|
+
const result = await klamdo<{
|
|
457
|
+
planTier: string;
|
|
458
|
+
subscriptionActive: boolean;
|
|
459
|
+
packages: Array<{
|
|
460
|
+
id: string;
|
|
461
|
+
label: string;
|
|
462
|
+
minTier: string;
|
|
463
|
+
estimatedCredits: number;
|
|
464
|
+
accessible: boolean;
|
|
465
|
+
expectedOutputs: {
|
|
466
|
+
textRoles: string[];
|
|
467
|
+
mediaRoles: string[];
|
|
468
|
+
documentRoles: string[];
|
|
469
|
+
};
|
|
470
|
+
}>;
|
|
471
|
+
}>("/packages", apiKey);
|
|
472
|
+
|
|
473
|
+
const accessibleOnly = input.accessibleOnly === true;
|
|
474
|
+
const packages = accessibleOnly
|
|
475
|
+
? result.packages.filter((pkg) => pkg.accessible)
|
|
476
|
+
: result.packages;
|
|
477
|
+
|
|
478
|
+
const lines = [
|
|
479
|
+
`Plan: ${result.planTier}`,
|
|
480
|
+
`Subscription active: ${result.subscriptionActive ? "yes" : "no"}`,
|
|
481
|
+
accessibleOnly ? `Showing: accessible packages only` : `Showing: all packages (${result.packages.filter((p) => p.accessible).length} accessible on your plan)`,
|
|
482
|
+
"",
|
|
483
|
+
...packages.map(
|
|
484
|
+
(pkg) =>
|
|
485
|
+
`${pkg.accessible ? "[available]" : "[locked]"} ${pkg.id} — ${pkg.label}\n` +
|
|
486
|
+
` Min tier: ${pkg.minTier}\n` +
|
|
487
|
+
` Estimated credits: ${pkg.estimatedCredits}\n` +
|
|
488
|
+
` Text outputs: ${pkg.expectedOutputs.textRoles.join(", ") || "none"}\n` +
|
|
489
|
+
` Media outputs: ${pkg.expectedOutputs.mediaRoles.join(", ") || "none"}\n` +
|
|
490
|
+
` Document outputs: ${pkg.expectedOutputs.documentRoles.join(", ") || "none"}`
|
|
491
|
+
),
|
|
492
|
+
];
|
|
493
|
+
return {
|
|
494
|
+
content: [{ type: "text", text: lines.join("\n") }]
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
case "create_package": {
|
|
499
|
+
const result = await klamdo<{
|
|
500
|
+
id: string;
|
|
501
|
+
status: string;
|
|
502
|
+
packageType: string;
|
|
503
|
+
progress: { completed: number; total: number };
|
|
504
|
+
manifestUrl: string;
|
|
505
|
+
}>("/packages", apiKey, {
|
|
506
|
+
packageType: input.packageType,
|
|
507
|
+
prompt: input.prompt,
|
|
508
|
+
niche: input.niche,
|
|
509
|
+
aspectRatio: input.aspectRatio,
|
|
510
|
+
avatarDurationSeconds: input.avatarDurationSeconds,
|
|
511
|
+
characterType: input.characterType,
|
|
512
|
+
uploadedAssetIds: input.uploadedAssetIds,
|
|
513
|
+
options: input.options,
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
return {
|
|
517
|
+
content: [
|
|
518
|
+
{
|
|
519
|
+
type: "text",
|
|
520
|
+
text:
|
|
521
|
+
`Package started.\n\nPackage ID: ${result.id}\nType: ${result.packageType}\n` +
|
|
522
|
+
`Status: ${result.status}\nProgress: ${result.progress.completed}/${result.progress.total}\n` +
|
|
523
|
+
`Manifest URL: ${BASE_URL}${result.manifestUrl}\n\n` +
|
|
524
|
+
`Use get_package("${result.id}") for status or get_package_manifest("${result.id}") for the structured deliverables contract.`
|
|
525
|
+
}
|
|
526
|
+
]
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
case "get_package": {
|
|
531
|
+
const packageId = String(input.packageId ?? "");
|
|
532
|
+
if (!packageId) throw new McpError(ErrorCode.InvalidParams, "packageId is required");
|
|
533
|
+
|
|
534
|
+
const result = await klamdo<{
|
|
535
|
+
id: string;
|
|
536
|
+
packageType: string;
|
|
537
|
+
status: string;
|
|
538
|
+
niche: string;
|
|
539
|
+
tier: string;
|
|
540
|
+
progress: { completed: number; total: number };
|
|
541
|
+
deliverableCounts: { text: number; media: number; documents: number; errors: number };
|
|
542
|
+
manifestUrl: string;
|
|
543
|
+
}>(`/packages/${packageId}`, apiKey);
|
|
544
|
+
|
|
545
|
+
return {
|
|
546
|
+
content: [
|
|
547
|
+
{
|
|
548
|
+
type: "text",
|
|
549
|
+
text: [
|
|
550
|
+
`Package ${result.id}`,
|
|
551
|
+
`Type: ${result.packageType}`,
|
|
552
|
+
`Status: ${result.status}`,
|
|
553
|
+
`Niche: ${result.niche}`,
|
|
554
|
+
`Tier: ${result.tier}`,
|
|
555
|
+
`Progress: ${result.progress.completed}/${result.progress.total}`,
|
|
556
|
+
`Deliverables: text=${result.deliverableCounts.text}, media=${result.deliverableCounts.media}, documents=${result.deliverableCounts.documents}, errors=${result.deliverableCounts.errors}`,
|
|
557
|
+
`Manifest URL: ${BASE_URL}${result.manifestUrl}`
|
|
558
|
+
].join("\n")
|
|
559
|
+
}
|
|
560
|
+
]
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
case "get_package_manifest": {
|
|
565
|
+
const packageId = String(input.packageId ?? "");
|
|
566
|
+
if (!packageId) throw new McpError(ErrorCode.InvalidParams, "packageId is required");
|
|
567
|
+
|
|
568
|
+
const result = await klamdo<Record<string, unknown>>(`/packages/${packageId}/manifest`, apiKey);
|
|
569
|
+
return {
|
|
570
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
|
|
343
574
|
default:
|
|
344
575
|
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
345
576
|
}
|
|
@@ -367,7 +598,7 @@ export function registerHandlers(server: Server, getApiKey: () => string) {
|
|
|
367
598
|
{
|
|
368
599
|
uri: "klamdo://docs",
|
|
369
600
|
mimeType: "text/plain",
|
|
370
|
-
text: `# Klamdo MCP Server v1.
|
|
601
|
+
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`
|
|
371
602
|
}
|
|
372
603
|
]
|
|
373
604
|
};
|