katto-mcp 0.5.1 → 0.5.3
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 +99 -80
- package/index.mjs +347 -294
- package/package.json +43 -43
package/README.md
CHANGED
|
@@ -1,80 +1,99 @@
|
|
|
1
|
-
# katto-mcp
|
|
2
|
-
|
|
3
|
-
**The AI video clipping MCP server.** Turn long videos into scored, captioned, vertical 9:16 short clips from any MCP client (Claude, Cursor, Claude Code, ChatGPT, VS Code, and other conformant clients). Drop in a YouTube link, a podcast, or a Twitch VOD and get publish-ready shorts back through natural conversation.
|
|
4
|
-
|
|
5
|
-
Powered by [Katto](https://katto.tech), an AI video clipper that turns long-form video (podcasts, interviews, streams, webinars) into short-form clips for TikTok, Reels and YouTube Shorts. Katto is a flat-priced, no-credits alternative to tools like OpusClip: one 25-video quota covers videos up to 90 minutes each, with the API and MCP included on every paid plan (not gated behind an enterprise tier).
|
|
6
|
-
|
|
7
|
-
## What it does
|
|
8
|
-
|
|
9
|
-
Ask your agent something like *"clip the best moments from this podcast and reframe them for TikTok"* and Katto will:
|
|
10
|
-
|
|
11
|
-
- find the strongest 30 to 90 second moments in a long video and score each clip 0 to 100 on Hook, Flow, Value and Trend,
|
|
12
|
-
- reframe to vertical 9:16 with face tracking, split-screen for two speakers, and stacked layouts for gaming,
|
|
13
|
-
- burn word-by-word animated captions (99 languages) and optionally dub into 8 languages,
|
|
14
|
-
- and hand back publish-ready MP4 files plus SRT caption urls.
|
|
15
|
-
|
|
16
|
-
Typical uses: repurpose a YouTube video into shorts, turn a podcast episode into clips, cut highlights from a Twitch VOD, or convert a long interview into vertical social posts.
|
|
17
|
-
|
|
18
|
-
## Two ways to connect
|
|
19
|
-
|
|
20
|
-
### Hosted (zero-install, recommended)
|
|
21
|
-
|
|
22
|
-
Point any OAuth-capable MCP client at the hosted endpoint and sign in with your Katto account. The API key never touches your disk, and you can revoke access anytime:
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
https://mcp.katto.tech/mcp (Streamable HTTP, OAuth 2.1)
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### Local (npx)
|
|
29
|
-
|
|
30
|
-
For Cursor, CI and scripts. Create an API key at **[katto.tech/dashboard/api-keys](https://katto.tech/dashboard/api-keys)**, then add the server to your MCP client config:
|
|
31
|
-
|
|
32
|
-
```json
|
|
33
|
-
{
|
|
34
|
-
"mcpServers": {
|
|
35
|
-
"katto": {
|
|
36
|
-
"command": "npx",
|
|
37
|
-
"args": ["-y", "katto-mcp"],
|
|
38
|
-
"env": { "KATTO_API_KEY": "sk_live_..." }
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
The hosted endpoint above also accepts `Authorization: Bearer sk_live_...` directly for key-based clients.
|
|
45
|
-
|
|
46
|
-
## Tools (15)
|
|
47
|
-
|
|
48
|
-
Clipping:
|
|
49
|
-
- **`katto_create_clip_job(url, config?)`** clip a long video (YouTube, Twitch, Vimeo, Rumble, Zoom, Dailymotion). Returns a job id.
|
|
50
|
-
- **`katto_get_job(id)`** poll until `status` is `completed`; `clips` holds the finished MP4 + caption (SRT) urls.
|
|
51
|
-
- **`katto_get_clips(id)`** just the finished clips of a job (MP4 + SRT + title + virality score).
|
|
52
|
-
- **`katto_get_transcript(id)`** the job's timestamped transcript segments.
|
|
53
|
-
- **`katto_list_jobs(limit?, cursor?, status?)`** your recent jobs, newest first (keyset pagination).
|
|
54
|
-
- **`katto_cancel_job(id)`** cancel a running job and refund the monthly video slot.
|
|
55
|
-
|
|
56
|
-
Editing (no quota):
|
|
57
|
-
- **`katto_rerender_clip(id, clip_index, layout_mode?, caption_style?)`** re-render one clip with a new reframe layout or caption style.
|
|
58
|
-
- **`katto_dub_clip(id, clip_index, languages)`** re-render a clip dubbed into one or more of 8 languages.
|
|
59
|
-
- **`katto_get_rerender(id, rerender_id)`** poll a re-render for the new versioned clip url.
|
|
60
|
-
|
|
61
|
-
Account and reference:
|
|
62
|
-
- **`katto_get_usage()`** your plan and remaining monthly video quota.
|
|
63
|
-
- **`katto_get_account()`** the connected account, this key's scopes, and quota.
|
|
64
|
-
- **`katto_get_brand_kit()`** your saved brand kits (colors, caption font, layout, watermark).
|
|
65
|
-
- **`katto_get_webhook_secret()`** your webhook signing secret and how to verify signed callbacks.
|
|
66
|
-
- **`katto_list_sources()`** the video platforms Katto can clip from, with an example url each.
|
|
67
|
-
- **`katto_list_clip_lengths()`** the valid target clip-length buckets.
|
|
68
|
-
|
|
69
|
-
Jobs draw from your Katto plan's monthly video quota (25 on Creator, 2 on Free), videos up to 90 minutes. The underlying REST API also supports `Idempotency-Key` safe retries, read-only scoped keys, and signed HMAC webhooks. See the [docs](https://katto.tech/docs/api).
|
|
70
|
-
|
|
71
|
-
## Env
|
|
72
|
-
|
|
73
|
-
| var | required | default |
|
|
74
|
-
| --- | --- | --- |
|
|
75
|
-
| `KATTO_API_KEY` | yes | (none) |
|
|
76
|
-
| `KATTO_API_URL` | no | `https://katto.tech` |
|
|
77
|
-
|
|
78
|
-
Full docs: **[katto.tech/docs/api](https://katto.tech/docs/api)**
|
|
79
|
-
|
|
80
|
-
|
|
1
|
+
# katto-mcp
|
|
2
|
+
|
|
3
|
+
**The AI video clipping MCP server.** Turn long videos into scored, captioned, vertical 9:16 short clips from any MCP client (Claude, Cursor, Claude Code, ChatGPT, VS Code, and other conformant clients). Drop in a YouTube link, a podcast, or a Twitch VOD and get publish-ready shorts back through natural conversation.
|
|
4
|
+
|
|
5
|
+
Powered by [Katto](https://katto.tech), an AI video clipper that turns long-form video (podcasts, interviews, streams, webinars) into short-form clips for TikTok, Reels and YouTube Shorts. Katto is a flat-priced, no-credits alternative to tools like OpusClip: one 25-video quota covers videos up to 90 minutes each, with the API and MCP included on every paid plan (not gated behind an enterprise tier).
|
|
6
|
+
|
|
7
|
+
## What it does
|
|
8
|
+
|
|
9
|
+
Ask your agent something like *"clip the best moments from this podcast and reframe them for TikTok"* and Katto will:
|
|
10
|
+
|
|
11
|
+
- find the strongest 30 to 90 second moments in a long video and score each clip 0 to 100 on Hook, Flow, Value and Trend,
|
|
12
|
+
- reframe to vertical 9:16 with face tracking, split-screen for two speakers, and stacked layouts for gaming,
|
|
13
|
+
- burn word-by-word animated captions (99 languages) and optionally dub into 8 languages,
|
|
14
|
+
- and hand back publish-ready MP4 files plus SRT caption urls.
|
|
15
|
+
|
|
16
|
+
Typical uses: repurpose a YouTube video into shorts, turn a podcast episode into clips, cut highlights from a Twitch VOD, or convert a long interview into vertical social posts.
|
|
17
|
+
|
|
18
|
+
## Two ways to connect
|
|
19
|
+
|
|
20
|
+
### Hosted (zero-install, recommended)
|
|
21
|
+
|
|
22
|
+
Point any OAuth-capable MCP client at the hosted endpoint and sign in with your Katto account. The API key never touches your disk, and you can revoke access anytime:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
https://mcp.katto.tech/mcp (Streamable HTTP, OAuth 2.1)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Local (npx)
|
|
29
|
+
|
|
30
|
+
For Cursor, CI and scripts. Create an API key at **[katto.tech/dashboard/api-keys](https://katto.tech/dashboard/api-keys)**, then add the server to your MCP client config:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"mcpServers": {
|
|
35
|
+
"katto": {
|
|
36
|
+
"command": "npx",
|
|
37
|
+
"args": ["-y", "katto-mcp"],
|
|
38
|
+
"env": { "KATTO_API_KEY": "sk_live_..." }
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The hosted endpoint above also accepts `Authorization: Bearer sk_live_...` directly for key-based clients.
|
|
45
|
+
|
|
46
|
+
## Tools (15)
|
|
47
|
+
|
|
48
|
+
Clipping:
|
|
49
|
+
- **`katto_create_clip_job(url, config?)`** clip a long video (YouTube, Twitch, Vimeo, Rumble, Zoom, Dailymotion). Returns a job id.
|
|
50
|
+
- **`katto_get_job(id)`** poll until `status` is `completed`; `clips` holds the finished MP4 + caption (SRT) urls.
|
|
51
|
+
- **`katto_get_clips(id)`** just the finished clips of a job (MP4 + SRT + title + virality score).
|
|
52
|
+
- **`katto_get_transcript(id)`** the job's timestamped transcript segments.
|
|
53
|
+
- **`katto_list_jobs(limit?, cursor?, status?)`** your recent jobs, newest first (keyset pagination).
|
|
54
|
+
- **`katto_cancel_job(id)`** cancel a running job and refund the monthly video slot.
|
|
55
|
+
|
|
56
|
+
Editing (no quota):
|
|
57
|
+
- **`katto_rerender_clip(id, clip_index, layout_mode?, caption_style?)`** re-render one clip with a new reframe layout or caption style.
|
|
58
|
+
- **`katto_dub_clip(id, clip_index, languages)`** re-render a clip dubbed into one or more of 8 languages.
|
|
59
|
+
- **`katto_get_rerender(id, rerender_id)`** poll a re-render for the new versioned clip url.
|
|
60
|
+
|
|
61
|
+
Account and reference:
|
|
62
|
+
- **`katto_get_usage()`** your plan and remaining monthly video quota.
|
|
63
|
+
- **`katto_get_account()`** the connected account, this key's scopes, and quota.
|
|
64
|
+
- **`katto_get_brand_kit()`** your saved brand kits (colors, caption font, layout, watermark).
|
|
65
|
+
- **`katto_get_webhook_secret()`** your webhook signing secret and how to verify signed callbacks.
|
|
66
|
+
- **`katto_list_sources()`** the video platforms Katto can clip from, with an example url each.
|
|
67
|
+
- **`katto_list_clip_lengths()`** the valid target clip-length buckets.
|
|
68
|
+
|
|
69
|
+
Jobs draw from your Katto plan's monthly video quota (25 on Creator, 2 on Free), videos up to 90 minutes. The underlying REST API also supports `Idempotency-Key` safe retries, read-only scoped keys, and signed HMAC webhooks. See the [docs](https://katto.tech/docs/api).
|
|
70
|
+
|
|
71
|
+
## Env
|
|
72
|
+
|
|
73
|
+
| var | required | default |
|
|
74
|
+
| --- | --- | --- |
|
|
75
|
+
| `KATTO_API_KEY` | yes | (none) |
|
|
76
|
+
| `KATTO_API_URL` | no | `https://katto.tech` |
|
|
77
|
+
|
|
78
|
+
Full docs: **[katto.tech/docs/api](https://katto.tech/docs/api)**
|
|
79
|
+
|
|
80
|
+
## Also listed on
|
|
81
|
+
|
|
82
|
+
- npm: [katto-mcp](https://www.npmjs.com/package/katto-mcp)
|
|
83
|
+
- GitHub: [miracleweasel/katto-mcp](https://github.com/miracleweasel/katto-mcp)
|
|
84
|
+
- [mcp.so](https://mcp.so/servers/katto) · [Smithery](https://smithery.ai/server/@dev-4lue/katto-mcp) · [Glama](https://glama.ai/mcp/servers/@miracleweasel/katto-mcp)
|
|
85
|
+
- Official MCP Registry: `io.github.miracleweasel/katto-mcp`
|
|
86
|
+
|
|
87
|
+
## Public Discovery
|
|
88
|
+
|
|
89
|
+
Katto – AI video clipping MCP server: turn long videos and podcasts into scored, captioned, reframed 9:16 clips, from any MCP client (Claude, Cursor, ChatGPT). Hosted, OAuth 2.1, no API key on disk.
|
|
90
|
+
|
|
91
|
+
Intents this server covers: *AI video clipping MCP server*, *MCP server for short-form video*, *MCP to turn podcasts into clips*, *video clipping for AI agents (Claude / Cursor / ChatGPT)*.
|
|
92
|
+
|
|
93
|
+
Example prompts:
|
|
94
|
+
|
|
95
|
+
1. "Clip the best moments from this podcast episode and reframe them for TikTok: `https://youtube.com/watch?v=…`"
|
|
96
|
+
2. "Check the status of my last clipping job and give me the download links for the finished clips."
|
|
97
|
+
3. "Take clip 2 from that job, dub it into Spanish and re-render it with the Bold caption style."
|
|
98
|
+
|
|
99
|
+
MIT
|
package/index.mjs
CHANGED
|
@@ -1,294 +1,347 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Katto MCP server — exposes the Katto clipping API as MCP tools so agents
|
|
4
|
-
* (Claude, Cursor, ...) can turn long videos into scored 9:16 clips. Runs
|
|
5
|
-
* locally over stdio and calls https://katto.tech/api/v1 with your API key.
|
|
6
|
-
*
|
|
7
|
-
* Config:
|
|
8
|
-
* KATTO_API_KEY (required) — create at https://katto.tech/dashboard/api-keys
|
|
9
|
-
* KATTO_API_URL (optional) — defaults to https://katto.tech
|
|
10
|
-
*/
|
|
11
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
12
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
13
|
-
import { ListToolsRequestSchema, CallToolRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
14
|
-
|
|
15
|
-
const API_URL = (process.env.KATTO_API_URL || "https://katto.tech").replace(/\/$/, "");
|
|
16
|
-
const API_KEY = process.env.KATTO_API_KEY;
|
|
17
|
-
|
|
18
|
-
if (!API_KEY) {
|
|
19
|
-
console.error("[katto-mcp] KATTO_API_KEY is required. Create one at https://katto.tech/dashboard/api-keys");
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async function api(path, init = {}) {
|
|
24
|
-
const res = await fetch(`${API_URL}${path}`, {
|
|
25
|
-
...init,
|
|
26
|
-
headers: {
|
|
27
|
-
Authorization: `Bearer ${API_KEY}`,
|
|
28
|
-
"Content-Type": "application/json",
|
|
29
|
-
...(init.headers || {}),
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
const text = await res.text();
|
|
33
|
-
let data;
|
|
34
|
-
try {
|
|
35
|
-
data = JSON.parse(text);
|
|
36
|
-
} catch {
|
|
37
|
-
data = { raw: text };
|
|
38
|
-
}
|
|
39
|
-
if (!res.ok) throw new Error(data.error || `HTTP ${res.status}`);
|
|
40
|
-
return data;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const TOOLS = [
|
|
44
|
-
{
|
|
45
|
-
name: "katto_create_clip_job",
|
|
46
|
-
description:
|
|
47
|
-
"Submit a long video (YouTube, Twitch, Vimeo, Rumble, Zoom, Dailymotion) to Katto. Returns a job id; " +
|
|
48
|
-
"the clips finish asynchronously
|
|
49
|
-
inputSchema: {
|
|
50
|
-
type: "object",
|
|
51
|
-
properties: {
|
|
52
|
-
url: { type: "string", description: "Public video URL to clip." },
|
|
53
|
-
config: {
|
|
54
|
-
type: "object",
|
|
55
|
-
description: "Optional pre-clip settings.",
|
|
56
|
-
properties: {
|
|
57
|
-
genre: { type: "string", description: "e.g. podcast, gaming, sports, interview" },
|
|
58
|
-
clipLength: { type: "string", enum: ["lt30", "30_60", "60_90", "90_180"] },
|
|
59
|
-
customPrompt: { type: "string" },
|
|
60
|
-
topics: { type: "string" },
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
required: ["url"],
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: "katto_get_job",
|
|
69
|
-
description:
|
|
70
|
-
"Get the status and clips of a Katto job by id. When status is 'completed', 'clips' holds the finished " +
|
|
71
|
-
"9:16 MP4 urls and caption (SRT) urls.",
|
|
72
|
-
inputSchema: {
|
|
73
|
-
type: "object",
|
|
74
|
-
properties: { id: { type: "string", description: "Job id from katto_create_clip_job." } },
|
|
75
|
-
required: ["id"],
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
name: "katto_list_jobs",
|
|
80
|
-
description:
|
|
81
|
-
"List your recent Katto jobs, newest first. Paginate with 'cursor' (pass the previous next_cursor) and " +
|
|
82
|
-
"optionally filter by 'status'. Returns { jobs: [{id, status, source, created_at, completed_at}], next_cursor }.",
|
|
83
|
-
inputSchema: {
|
|
84
|
-
type: "object",
|
|
85
|
-
properties: {
|
|
86
|
-
limit: { type: "number", description: "How many jobs to return (1-100, default 20)." },
|
|
87
|
-
cursor: { type: "string", description: "Pass the previous response's next_cursor for the next page." },
|
|
88
|
-
status: { type: "string", description: "Optional filter, e.g. 'completed', 'queued', 'failed'." },
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
name: "katto_get_clips",
|
|
94
|
-
description:
|
|
95
|
-
"Convenience: fetch just the finished clips of a job (9:16 MP4 urls + caption SRT urls). " +
|
|
96
|
-
"Returns an empty list while the job is still processing.",
|
|
97
|
-
inputSchema: {
|
|
98
|
-
type: "object",
|
|
99
|
-
properties: { id: { type: "string", description: "Job id from katto_create_clip_job." } },
|
|
100
|
-
required: ["id"],
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: "katto_get_usage",
|
|
105
|
-
description:
|
|
106
|
-
"Get your current plan and monthly video quota: { plan, videos_used, videos_limit, videos_remaining }.",
|
|
107
|
-
inputSchema: { type: "object", properties: {} },
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: "katto_get_transcript",
|
|
111
|
-
description:
|
|
112
|
-
"Get the compact transcript of a completed job as timestamped segments " +
|
|
113
|
-
"[{ start, end, text }]. Returns 404 while the job is still processing.",
|
|
114
|
-
inputSchema: {
|
|
115
|
-
type: "object",
|
|
116
|
-
properties: { id: { type: "string", description: "Job id from katto_create_clip_job." } },
|
|
117
|
-
required: ["id"],
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
name: "katto_cancel_job",
|
|
122
|
-
description:
|
|
123
|
-
"Cancel a still-running job (queued/processing) and refund the monthly video slot. " +
|
|
124
|
-
"Returns an error if the job already finished, failed, or was cancelled.",
|
|
125
|
-
inputSchema: {
|
|
126
|
-
type: "object",
|
|
127
|
-
properties: { id: { type: "string", description: "Job id from katto_create_clip_job." } },
|
|
128
|
-
required: ["id"],
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
name: "katto_get_account",
|
|
133
|
-
description:
|
|
134
|
-
"Get the account behind this key: plan, this key's scopes, and monthly quota " +
|
|
135
|
-
"{ videos_used, videos_limit, videos_remaining }.",
|
|
136
|
-
inputSchema: { type: "object", properties: {} },
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
name: "katto_list_sources",
|
|
140
|
-
description:
|
|
141
|
-
"List the video platforms Katto can clip from, with an example URL for each. Use this to confirm a " +
|
|
142
|
-
"URL is supported before calling katto_create_clip_job.",
|
|
143
|
-
inputSchema: { type: "object", properties: {} },
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: "katto_list_clip_lengths",
|
|
147
|
-
description:
|
|
148
|
-
"List the valid values for the optional config.clipLength on katto_create_clip_job (target clip " +
|
|
149
|
-
"duration buckets).",
|
|
150
|
-
inputSchema: { type: "object", properties: {} },
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
name: "katto_rerender_clip",
|
|
154
|
-
description:
|
|
155
|
-
"Re-render one finished clip with a new reframe layout and/or caption style. Does NOT use video quota. " +
|
|
156
|
-
"Returns a rerender_id; poll katto_get_rerender for the new clip url.",
|
|
157
|
-
inputSchema: {
|
|
158
|
-
type: "object",
|
|
159
|
-
properties: {
|
|
160
|
-
id: { type: "string", description: "Job id from katto_create_clip_job." },
|
|
161
|
-
clip_index: { type: "number", description: "0-based index of the clip to re-render." },
|
|
162
|
-
layout_mode: {
|
|
163
|
-
type: "string",
|
|
164
|
-
enum: ["face_tracking", "wide", "split_screen", "stacked", "passthrough", "grid_3", "grid_4"],
|
|
165
|
-
},
|
|
166
|
-
caption_style: { type: "string", description: "A caption style preset name." },
|
|
167
|
-
},
|
|
168
|
-
required: ["id", "clip_index"],
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
name: "katto_dub_clip",
|
|
173
|
-
description:
|
|
174
|
-
"Re-render one finished clip dubbed into one or more languages (en, es, fr, it, pt, hi, ja, zh). Does " +
|
|
175
|
-
"NOT use video quota. Returns a rerender_id; poll katto_get_rerender for the result.",
|
|
176
|
-
inputSchema: {
|
|
177
|
-
type: "object",
|
|
178
|
-
properties: {
|
|
179
|
-
id: { type: "string", description: "Job id." },
|
|
180
|
-
clip_index: { type: "number", description: "0-based clip index." },
|
|
181
|
-
languages: {
|
|
182
|
-
type: "array",
|
|
183
|
-
items: { type: "string", enum: ["en", "es", "fr", "it", "pt", "hi", "ja", "zh"] },
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
required: ["id", "clip_index", "languages"],
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
name: "katto_get_rerender",
|
|
191
|
-
description:
|
|
192
|
-
"Poll a re-render started by katto_rerender_clip or katto_dub_clip. Returns { status, clip_url, captions_url }.",
|
|
193
|
-
inputSchema: {
|
|
194
|
-
type: "object",
|
|
195
|
-
properties: {
|
|
196
|
-
id: { type: "string", description: "Job id." },
|
|
197
|
-
rerender_id: { type: "string", description: "The rerender_id returned by rerender/dub." },
|
|
198
|
-
},
|
|
199
|
-
required: ["id", "rerender_id"],
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
name: "katto_get_brand_kit",
|
|
204
|
-
description:
|
|
205
|
-
"Get your saved brand kits (colors, caption font and position, default layout, watermark url).",
|
|
206
|
-
inputSchema: { type: "object", properties: {} },
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
name: "katto_get_webhook_secret",
|
|
210
|
-
description:
|
|
211
|
-
"Get your webhook signing secret and how to verify Katto's signed completion callbacks " +
|
|
212
|
-
"(HMAC-SHA256 of {timestamp}.{body}). Pass webhook_url on a job to receive them.",
|
|
213
|
-
inputSchema: { type: "object", properties: {} },
|
|
214
|
-
},
|
|
215
|
-
];
|
|
216
|
-
|
|
217
|
-
//
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
{
|
|
228
|
-
{
|
|
229
|
-
{
|
|
230
|
-
{
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Katto MCP server — exposes the Katto clipping API as MCP tools so agents
|
|
4
|
+
* (Claude, Cursor, ...) can turn long videos into scored 9:16 clips. Runs
|
|
5
|
+
* locally over stdio and calls https://katto.tech/api/v1 with your API key.
|
|
6
|
+
*
|
|
7
|
+
* Config:
|
|
8
|
+
* KATTO_API_KEY (required) — create at https://katto.tech/dashboard/api-keys
|
|
9
|
+
* KATTO_API_URL (optional) — defaults to https://katto.tech
|
|
10
|
+
*/
|
|
11
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
12
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
13
|
+
import { ListToolsRequestSchema, CallToolRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
14
|
+
|
|
15
|
+
const API_URL = (process.env.KATTO_API_URL || "https://katto.tech").replace(/\/$/, "");
|
|
16
|
+
const API_KEY = process.env.KATTO_API_KEY;
|
|
17
|
+
|
|
18
|
+
if (!API_KEY) {
|
|
19
|
+
console.error("[katto-mcp] KATTO_API_KEY is required. Create one at https://katto.tech/dashboard/api-keys");
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async function api(path, init = {}) {
|
|
24
|
+
const res = await fetch(`${API_URL}${path}`, {
|
|
25
|
+
...init,
|
|
26
|
+
headers: {
|
|
27
|
+
Authorization: `Bearer ${API_KEY}`,
|
|
28
|
+
"Content-Type": "application/json",
|
|
29
|
+
...(init.headers || {}),
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
const text = await res.text();
|
|
33
|
+
let data;
|
|
34
|
+
try {
|
|
35
|
+
data = JSON.parse(text);
|
|
36
|
+
} catch {
|
|
37
|
+
data = { raw: text };
|
|
38
|
+
}
|
|
39
|
+
if (!res.ok) throw new Error(data.error || `HTTP ${res.status}`);
|
|
40
|
+
return data;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const TOOLS = [
|
|
44
|
+
{
|
|
45
|
+
name: "katto_create_clip_job",
|
|
46
|
+
description:
|
|
47
|
+
"Submit a long video (YouTube, Twitch, Vimeo, Rumble, Zoom, Dailymotion) to Katto. Returns a job id; " +
|
|
48
|
+
"the clips finish asynchronously. Poll katto_get_job with the id until status is 'completed'.",
|
|
49
|
+
inputSchema: {
|
|
50
|
+
type: "object",
|
|
51
|
+
properties: {
|
|
52
|
+
url: { type: "string", description: "Public video URL to clip." },
|
|
53
|
+
config: {
|
|
54
|
+
type: "object",
|
|
55
|
+
description: "Optional pre-clip settings.",
|
|
56
|
+
properties: {
|
|
57
|
+
genre: { type: "string", description: "e.g. podcast, gaming, sports, interview" },
|
|
58
|
+
clipLength: { type: "string", enum: ["lt30", "30_60", "60_90", "90_180"] },
|
|
59
|
+
customPrompt: { type: "string" },
|
|
60
|
+
topics: { type: "string" },
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
required: ["url"],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "katto_get_job",
|
|
69
|
+
description:
|
|
70
|
+
"Get the status and clips of a Katto job by id. When status is 'completed', 'clips' holds the finished " +
|
|
71
|
+
"9:16 MP4 urls and caption (SRT) urls.",
|
|
72
|
+
inputSchema: {
|
|
73
|
+
type: "object",
|
|
74
|
+
properties: { id: { type: "string", description: "Job id from katto_create_clip_job." } },
|
|
75
|
+
required: ["id"],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "katto_list_jobs",
|
|
80
|
+
description:
|
|
81
|
+
"List your recent Katto jobs, newest first. Paginate with 'cursor' (pass the previous next_cursor) and " +
|
|
82
|
+
"optionally filter by 'status'. Returns { jobs: [{id, status, source, created_at, completed_at}], next_cursor }.",
|
|
83
|
+
inputSchema: {
|
|
84
|
+
type: "object",
|
|
85
|
+
properties: {
|
|
86
|
+
limit: { type: "number", description: "How many jobs to return (1-100, default 20)." },
|
|
87
|
+
cursor: { type: "string", description: "Pass the previous response's next_cursor for the next page." },
|
|
88
|
+
status: { type: "string", description: "Optional filter, e.g. 'completed', 'queued', 'failed'." },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "katto_get_clips",
|
|
94
|
+
description:
|
|
95
|
+
"Convenience: fetch just the finished clips of a job (9:16 MP4 urls + caption SRT urls). " +
|
|
96
|
+
"Returns an empty list while the job is still processing.",
|
|
97
|
+
inputSchema: {
|
|
98
|
+
type: "object",
|
|
99
|
+
properties: { id: { type: "string", description: "Job id from katto_create_clip_job." } },
|
|
100
|
+
required: ["id"],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "katto_get_usage",
|
|
105
|
+
description:
|
|
106
|
+
"Get your current plan and monthly video quota: { plan, videos_used, videos_limit, videos_remaining }.",
|
|
107
|
+
inputSchema: { type: "object", properties: {} },
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: "katto_get_transcript",
|
|
111
|
+
description:
|
|
112
|
+
"Get the compact transcript of a completed job as timestamped segments " +
|
|
113
|
+
"[{ start, end, text }]. Returns 404 while the job is still processing.",
|
|
114
|
+
inputSchema: {
|
|
115
|
+
type: "object",
|
|
116
|
+
properties: { id: { type: "string", description: "Job id from katto_create_clip_job." } },
|
|
117
|
+
required: ["id"],
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "katto_cancel_job",
|
|
122
|
+
description:
|
|
123
|
+
"Cancel a still-running job (queued/processing) and refund the monthly video slot. " +
|
|
124
|
+
"Returns an error if the job already finished, failed, or was cancelled.",
|
|
125
|
+
inputSchema: {
|
|
126
|
+
type: "object",
|
|
127
|
+
properties: { id: { type: "string", description: "Job id from katto_create_clip_job." } },
|
|
128
|
+
required: ["id"],
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "katto_get_account",
|
|
133
|
+
description:
|
|
134
|
+
"Get the account behind this key: plan, this key's scopes, and monthly quota " +
|
|
135
|
+
"{ videos_used, videos_limit, videos_remaining }.",
|
|
136
|
+
inputSchema: { type: "object", properties: {} },
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "katto_list_sources",
|
|
140
|
+
description:
|
|
141
|
+
"List the video platforms Katto can clip from, with an example URL for each. Use this to confirm a " +
|
|
142
|
+
"URL is supported before calling katto_create_clip_job.",
|
|
143
|
+
inputSchema: { type: "object", properties: {} },
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "katto_list_clip_lengths",
|
|
147
|
+
description:
|
|
148
|
+
"List the valid values for the optional config.clipLength on katto_create_clip_job (target clip " +
|
|
149
|
+
"duration buckets).",
|
|
150
|
+
inputSchema: { type: "object", properties: {} },
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "katto_rerender_clip",
|
|
154
|
+
description:
|
|
155
|
+
"Re-render one finished clip with a new reframe layout and/or caption style. Does NOT use video quota. " +
|
|
156
|
+
"Returns a rerender_id; poll katto_get_rerender for the new clip url.",
|
|
157
|
+
inputSchema: {
|
|
158
|
+
type: "object",
|
|
159
|
+
properties: {
|
|
160
|
+
id: { type: "string", description: "Job id from katto_create_clip_job." },
|
|
161
|
+
clip_index: { type: "number", description: "0-based index of the clip to re-render." },
|
|
162
|
+
layout_mode: {
|
|
163
|
+
type: "string",
|
|
164
|
+
enum: ["face_tracking", "wide", "split_screen", "stacked", "passthrough", "grid_3", "grid_4"],
|
|
165
|
+
},
|
|
166
|
+
caption_style: { type: "string", description: "A caption style preset name." },
|
|
167
|
+
},
|
|
168
|
+
required: ["id", "clip_index"],
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: "katto_dub_clip",
|
|
173
|
+
description:
|
|
174
|
+
"Re-render one finished clip dubbed into one or more languages (en, es, fr, it, pt, hi, ja, zh). Does " +
|
|
175
|
+
"NOT use video quota. Returns a rerender_id; poll katto_get_rerender for the result.",
|
|
176
|
+
inputSchema: {
|
|
177
|
+
type: "object",
|
|
178
|
+
properties: {
|
|
179
|
+
id: { type: "string", description: "Job id." },
|
|
180
|
+
clip_index: { type: "number", description: "0-based clip index." },
|
|
181
|
+
languages: {
|
|
182
|
+
type: "array",
|
|
183
|
+
items: { type: "string", enum: ["en", "es", "fr", "it", "pt", "hi", "ja", "zh"] },
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
required: ["id", "clip_index", "languages"],
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: "katto_get_rerender",
|
|
191
|
+
description:
|
|
192
|
+
"Poll a re-render started by katto_rerender_clip or katto_dub_clip. Returns { status, clip_url, captions_url }.",
|
|
193
|
+
inputSchema: {
|
|
194
|
+
type: "object",
|
|
195
|
+
properties: {
|
|
196
|
+
id: { type: "string", description: "Job id." },
|
|
197
|
+
rerender_id: { type: "string", description: "The rerender_id returned by rerender/dub." },
|
|
198
|
+
},
|
|
199
|
+
required: ["id", "rerender_id"],
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: "katto_get_brand_kit",
|
|
204
|
+
description:
|
|
205
|
+
"Get your saved brand kits (colors, caption font and position, default layout, watermark url).",
|
|
206
|
+
inputSchema: { type: "object", properties: {} },
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "katto_get_webhook_secret",
|
|
210
|
+
description:
|
|
211
|
+
"Get your webhook signing secret and how to verify Katto's signed completion callbacks " +
|
|
212
|
+
"(HMAC-SHA256 of {timestamp}.{body}). Pass webhook_url on a job to receive them.",
|
|
213
|
+
inputSchema: { type: "object", properties: {} },
|
|
214
|
+
},
|
|
215
|
+
];
|
|
216
|
+
|
|
217
|
+
// Tool behaviour hints (MCP annotations). Required by the Claude Connectors
|
|
218
|
+
// Directory review: every tool must declare read-only vs write, plus
|
|
219
|
+
// destructive / idempotent / open-world semantics, so a client can gate calls.
|
|
220
|
+
// All four hints are declared on every tool (explicit > omitted for reviewers).
|
|
221
|
+
// Read tools: read-only, non-destructive, idempotent, closed-world. Writes flip
|
|
222
|
+
// readOnlyHint. create_clip_job fetches a user URL (openWorld) + spends 1 quota
|
|
223
|
+
// slot (not idempotent). rerender/dub each spawn a NEW render (not idempotent —
|
|
224
|
+
// unsafe to blindly retry). cancel_job is the only destructive tool.
|
|
225
|
+
const ANNOTATIONS = {
|
|
226
|
+
katto_create_clip_job: { title: "Create clip job", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
227
|
+
katto_get_job: { title: "Get job status & clips", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
228
|
+
katto_list_jobs: { title: "List jobs", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
229
|
+
katto_get_clips: { title: "Get finished clips", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
230
|
+
katto_get_usage: { title: "Get plan & quota", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
231
|
+
katto_get_transcript: { title: "Get transcript", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
232
|
+
katto_cancel_job: { title: "Cancel job & refund slot", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
233
|
+
katto_get_account: { title: "Get account", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
234
|
+
katto_list_sources: { title: "List supported sources", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
235
|
+
katto_list_clip_lengths: { title: "List clip-length options", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
236
|
+
katto_rerender_clip: { title: "Re-render a clip", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
237
|
+
katto_dub_clip: { title: "Dub a clip", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
238
|
+
katto_get_rerender: { title: "Poll a re-render", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
239
|
+
katto_get_brand_kit: { title: "Get brand kits", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
240
|
+
katto_get_webhook_secret: { title: "Get webhook signing secret", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
// Agent-facing descriptions (when to call, returns, errors, quota cost). Served
|
|
244
|
+
// on tools/list — identical across all sources, enriching the terser inline text.
|
|
245
|
+
const DESCRIPTIONS = {
|
|
246
|
+
katto_create_clip_job: "Submit a long video (YouTube, Twitch, Vimeo, Rumble, Zoom, Dailymotion) for clipping. Consumes 1 video from your monthly quota — check katto_get_usage first. Clips are produced asynchronously; returns a job id, then poll katto_get_job until status is 'completed'. Fails if the URL is unsupported or the video is over 90 minutes.",
|
|
247
|
+
katto_get_job: "Read-only. Get the status, progress and clips of a job by id. When status is 'completed', 'clips' holds the finished 9:16 MP4 urls and caption (SRT) urls; while processing, clips is empty. Returns 404 for an unknown id.",
|
|
248
|
+
katto_list_jobs: "Read-only. List your recent jobs, newest first. Paginate with 'cursor' (pass the previous next_cursor); optional 'status' filter. Returns { jobs: [{id, status, source, created_at, completed_at}], next_cursor }.",
|
|
249
|
+
katto_get_clips: "Read-only convenience: just the finished clips of a job (9:16 MP4 urls + caption SRT urls + title + virality score). Returns an empty list while the job is still processing.",
|
|
250
|
+
katto_get_usage: "Read-only. Your current plan and monthly video quota: { plan, videos_used, videos_limit, videos_remaining }. Call before katto_create_clip_job to confirm remaining quota.",
|
|
251
|
+
katto_get_transcript: "Read-only. The transcript of a completed job as timestamped segments [{ start, end, text }]. Returns 404 while the job is still processing.",
|
|
252
|
+
katto_cancel_job: "Cancel a still-running job (queued/processing) and refund the video back to your monthly quota. Safe to retry (idempotent). Returns an error if the job already finished, failed, or was cancelled.",
|
|
253
|
+
katto_get_account: "Read-only. The account behind this key: plan, this key's scopes (read/write), and monthly quota { videos_used, videos_limit, videos_remaining }.",
|
|
254
|
+
katto_list_sources: "Read-only. The video platforms Katto can clip from, each with an example URL. Use it to confirm a URL is supported before calling katto_create_clip_job.",
|
|
255
|
+
katto_list_clip_lengths: "Read-only. The valid values for the optional config.clipLength on katto_create_clip_job (target clip-duration buckets).",
|
|
256
|
+
katto_rerender_clip: "Re-render one already-finished clip with a new reframe layout and/or caption style. Free — does NOT use video quota. Each call starts a new render (not idempotent); the original clip is kept. Returns a rerender_id; poll katto_get_rerender for the new clip url.",
|
|
257
|
+
katto_dub_clip: "Re-render one finished clip dubbed into one or more of 8 languages (en, es, fr, it, pt, hi, ja, zh). Free — does NOT use video quota. Each call starts a new render (not idempotent). Returns a rerender_id; poll katto_get_rerender for the result.",
|
|
258
|
+
katto_get_rerender: "Read-only. Poll a re-render started by katto_rerender_clip or katto_dub_clip. Returns { status, clip_url, captions_url } — clip_url is null until status is 'completed'.",
|
|
259
|
+
katto_get_brand_kit: "Read-only. Your saved brand kits (colors, caption font and position, default layout, watermark url).",
|
|
260
|
+
katto_get_webhook_secret: "Read-only. Returns your webhook signing SECRET — treat it as a credential (do not display or log it) — plus how to verify Katto's signed completion callbacks (HMAC-SHA256 of {timestamp}.{body}). Pass webhook_url on a job to receive them.",
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
// TOOLS enriched with agent descriptions + annotations — served on tools/list.
|
|
264
|
+
const TOOLS_LISTED = TOOLS.map((t) => ({
|
|
265
|
+
...t,
|
|
266
|
+
description: DESCRIPTIONS[t.name] ?? t.description,
|
|
267
|
+
...(ANNOTATIONS[t.name] ? { annotations: ANNOTATIONS[t.name] } : {}),
|
|
268
|
+
}));
|
|
269
|
+
|
|
270
|
+
// Static reference data — returned by the list_* tools without an API call.
|
|
271
|
+
const SOURCES = [
|
|
272
|
+
{ id: 'youtube', example: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' },
|
|
273
|
+
{ id: 'twitch', example: 'https://www.twitch.tv/videos/123456789' },
|
|
274
|
+
{ id: 'vimeo', example: 'https://vimeo.com/123456789' },
|
|
275
|
+
{ id: 'rumble', example: 'https://rumble.com/v1a2b3c-title.html' },
|
|
276
|
+
{ id: 'zoom', example: 'https://zoom.us/rec/share/abc123' },
|
|
277
|
+
{ id: 'dailymotion', example: 'https://www.dailymotion.com/video/x8abcde' },
|
|
278
|
+
];
|
|
279
|
+
const CLIP_LENGTHS = [
|
|
280
|
+
{ value: 'lt30', label: 'Under 30 seconds' },
|
|
281
|
+
{ value: '30_60', label: '30 to 60 seconds' },
|
|
282
|
+
{ value: '60_90', label: '60 to 90 seconds' },
|
|
283
|
+
{ value: '90_180', label: '90 to 180 seconds' },
|
|
284
|
+
];
|
|
285
|
+
|
|
286
|
+
const server = new Server({ name: "katto", version: "0.5.3" }, { capabilities: { tools: {} } });
|
|
287
|
+
|
|
288
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS_LISTED }));
|
|
289
|
+
|
|
290
|
+
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
291
|
+
const { name, arguments: args = {} } = req.params;
|
|
292
|
+
try {
|
|
293
|
+
let data;
|
|
294
|
+
if (name === "katto_create_clip_job") {
|
|
295
|
+
data = await api("/api/v1/jobs", {
|
|
296
|
+
method: "POST",
|
|
297
|
+
body: JSON.stringify({ url: args.url, config: args.config }),
|
|
298
|
+
});
|
|
299
|
+
} else if (name === "katto_get_job") {
|
|
300
|
+
data = await api(`/api/v1/jobs/${encodeURIComponent(args.id)}`);
|
|
301
|
+
} else if (name === "katto_list_jobs") {
|
|
302
|
+
const qs = new URLSearchParams();
|
|
303
|
+
if (args.limit != null) qs.set("limit", String(args.limit));
|
|
304
|
+
if (args.cursor) qs.set("cursor", String(args.cursor));
|
|
305
|
+
if (args.status) qs.set("status", String(args.status));
|
|
306
|
+
const q = qs.toString();
|
|
307
|
+
data = await api(`/api/v1/jobs${q ? `?${q}` : ""}`);
|
|
308
|
+
} else if (name === "katto_get_clips") {
|
|
309
|
+
const job = await api(`/api/v1/jobs/${encodeURIComponent(args.id)}`);
|
|
310
|
+
data = { id: job.id, status: job.status, clips: job.clips || [] };
|
|
311
|
+
} else if (name === "katto_get_usage") {
|
|
312
|
+
data = await api("/api/v1/usage");
|
|
313
|
+
} else if (name === "katto_get_transcript") {
|
|
314
|
+
data = await api(`/api/v1/jobs/${encodeURIComponent(args.id)}/transcript`);
|
|
315
|
+
} else if (name === "katto_cancel_job") {
|
|
316
|
+
data = await api(`/api/v1/jobs/${encodeURIComponent(args.id)}`, { method: "DELETE" });
|
|
317
|
+
} else if (name === "katto_get_account") {
|
|
318
|
+
data = await api("/api/v1/me");
|
|
319
|
+
} else if (name === "katto_list_sources") {
|
|
320
|
+
data = { sources: SOURCES, note: "You can also clip a local file via the REST API (POST /v1/uploads)." };
|
|
321
|
+
} else if (name === "katto_list_clip_lengths") {
|
|
322
|
+
data = { clip_lengths: CLIP_LENGTHS };
|
|
323
|
+
} else if (name === "katto_rerender_clip") {
|
|
324
|
+
const b = {};
|
|
325
|
+
if (args.layout_mode) b.layout_mode = args.layout_mode;
|
|
326
|
+
if (args.caption_style) b.caption_style = args.caption_style;
|
|
327
|
+
data = await api(`/api/v1/jobs/${encodeURIComponent(args.id)}/clips/${encodeURIComponent(args.clip_index)}/rerender`, { method: "POST", body: JSON.stringify(b) });
|
|
328
|
+
} else if (name === "katto_dub_clip") {
|
|
329
|
+
data = await api(`/api/v1/jobs/${encodeURIComponent(args.id)}/clips/${encodeURIComponent(args.clip_index)}/rerender`, { method: "POST", body: JSON.stringify({ dub: args.languages || [] }) });
|
|
330
|
+
} else if (name === "katto_get_rerender") {
|
|
331
|
+
data = await api(`/api/v1/jobs/${encodeURIComponent(args.id)}/rerenders/${encodeURIComponent(args.rerender_id)}`);
|
|
332
|
+
} else if (name === "katto_get_brand_kit") {
|
|
333
|
+
data = await api("/api/v1/brand-kit");
|
|
334
|
+
} else if (name === "katto_get_webhook_secret") {
|
|
335
|
+
data = await api("/api/v1/webhook");
|
|
336
|
+
} else {
|
|
337
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
338
|
+
}
|
|
339
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
340
|
+
} catch (e) {
|
|
341
|
+
return { content: [{ type: "text", text: `Error: ${e.message}` }], isError: true };
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
const transport = new StdioServerTransport();
|
|
346
|
+
await server.connect(transport);
|
|
347
|
+
console.error("[katto-mcp] ready");
|
package/package.json
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "katto-mcp",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"mcpName": "io.github.miracleweasel/katto-mcp",
|
|
5
|
-
"description": "AI video clipping MCP server: turn long videos, podcasts and Twitch VODs into scored, captioned 9:16 shorts from Claude, Cursor, ChatGPT and any MCP client.",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"bin": {
|
|
8
|
-
"katto-mcp": "index.mjs"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"index.mjs",
|
|
12
|
-
"README.md",
|
|
13
|
-
"LICENSE"
|
|
14
|
-
],
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=18"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [
|
|
19
|
-
"mcp",
|
|
20
|
-
"model-context-protocol",
|
|
21
|
-
"katto",
|
|
22
|
-
"video",
|
|
23
|
-
"clips",
|
|
24
|
-
"shorts",
|
|
25
|
-
"ai",
|
|
26
|
-
"ai-video-clipper",
|
|
27
|
-
"video-to-shorts",
|
|
28
|
-
"youtube-to-shorts",
|
|
29
|
-
"podcast-clips",
|
|
30
|
-
"ai-captions",
|
|
31
|
-
"ai-video-editor",
|
|
32
|
-
"repurpose-video",
|
|
33
|
-
"video-dubbing"
|
|
34
|
-
],
|
|
35
|
-
"homepage": "https://katto.tech/docs/api",
|
|
36
|
-
"repository": { "type": "git", "url": "git+https://github.com/miracleweasel/katto-mcp.git" },
|
|
37
|
-
"bugs": { "url": "https://katto.tech/contact" },
|
|
38
|
-
"author": "Katto (https://katto.tech)",
|
|
39
|
-
"license": "MIT",
|
|
40
|
-
"dependencies": {
|
|
41
|
-
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "katto-mcp",
|
|
3
|
+
"version": "0.5.3",
|
|
4
|
+
"mcpName": "io.github.miracleweasel/katto-mcp",
|
|
5
|
+
"description": "AI video clipping MCP server: turn long videos, podcasts and Twitch VODs into scored, captioned 9:16 shorts from Claude, Cursor, ChatGPT and any MCP client.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"katto-mcp": "index.mjs"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"index.mjs",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=18"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"mcp",
|
|
20
|
+
"model-context-protocol",
|
|
21
|
+
"katto",
|
|
22
|
+
"video",
|
|
23
|
+
"clips",
|
|
24
|
+
"shorts",
|
|
25
|
+
"ai",
|
|
26
|
+
"ai-video-clipper",
|
|
27
|
+
"video-to-shorts",
|
|
28
|
+
"youtube-to-shorts",
|
|
29
|
+
"podcast-clips",
|
|
30
|
+
"ai-captions",
|
|
31
|
+
"ai-video-editor",
|
|
32
|
+
"repurpose-video",
|
|
33
|
+
"video-dubbing"
|
|
34
|
+
],
|
|
35
|
+
"homepage": "https://katto.tech/docs/api",
|
|
36
|
+
"repository": { "type": "git", "url": "git+https://github.com/miracleweasel/katto-mcp.git" },
|
|
37
|
+
"bugs": { "url": "https://katto.tech/contact" },
|
|
38
|
+
"author": "Katto (https://katto.tech)",
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
42
|
+
}
|
|
43
|
+
}
|