@rendobar/mcp 1.8.3 → 1.9.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 +80 -5
- package/dist/bin.js +10 -8
- package/dist/index.js +6 -4
- package/package.json +13 -4
package/README.md
CHANGED
|
@@ -28,7 +28,15 @@
|
|
|
28
28
|
<img src="https://img.shields.io/node/v/@rendobar/mcp?style=flat-square&color=059669" alt="Node version">
|
|
29
29
|
</p>
|
|
30
30
|
|
|
31
|
-
`@rendobar/mcp` is the official Model Context Protocol server for [Rendobar](https://rendobar.com), a serverless media processing API. The server runs locally over stdio and reads files straight from your disk, so an AI agent can take a
|
|
31
|
+
`@rendobar/mcp` is the official Model Context Protocol server for [Rendobar](https://rendobar.com), a serverless media processing API. The server runs locally over stdio and reads files straight from your disk, so an AI agent can take a file off your machine, process it on Rendobar's infrastructure, and hand back a hosted URL.
|
|
32
|
+
|
|
33
|
+
Rendobar covers both sides of media work.
|
|
34
|
+
|
|
35
|
+
**Transform what you have.** Run any FFmpeg command against video, audio or images the way you would write it locally. Inspect a file and get a normalized summary plus the full ffprobe report. Compose video from a declarative JSON timeline. Compress to a target size or quality, where the encoder searches candidate encodes and returns the smallest file that clears the bar. Burn in subtitles from SRT, VTT or ASS, or let it transcribe when none is given.
|
|
36
|
+
|
|
37
|
+
**Generate what you do not.** Create an image from a text prompt on hosted open-weight diffusion models. Edit up to four reference images from a written instruction, no masks and no coordinates. Upscale on a one-step diffusion restoration model that reconstructs detail rather than only sharpening. The same model-backed layer drives the transcription and keyword highlighting behind animated captions, so this is not an image-only capability.
|
|
38
|
+
|
|
39
|
+
The job list grows over time, so this README names families rather than types. `list_job_types` reads the current set live from the registry on every call.
|
|
32
40
|
|
|
33
41
|
Published to npm as `@rendobar/mcp` and to the [official MCP Registry](https://registry.modelcontextprotocol.io) as `com.rendobar/mcp`.
|
|
34
42
|
|
|
@@ -61,6 +69,50 @@ get_job { "jobId": "job_9f2a", "wait": true }
|
|
|
61
69
|
The agent writes the filter. Rendobar runs it. Nothing gets installed on your
|
|
62
70
|
machine, and `-c:v copy` means the video stream is never re-encoded.
|
|
63
71
|
|
|
72
|
+
## Two more things to ask for
|
|
73
|
+
|
|
74
|
+
**Hit a size budget.**
|
|
75
|
+
|
|
76
|
+
> **You:** Get `demo.mov` under 25 MB so I can email it.
|
|
77
|
+
|
|
78
|
+
```jsonc
|
|
79
|
+
upload_file { "path": "~/recordings/demo.mov" }
|
|
80
|
+
// → { "downloadUrl": "https://cdn.rendobar.com/u/7c1e/demo.mov", "sizeBytes": 251658240 }
|
|
81
|
+
|
|
82
|
+
submit_job { "type": "compress.target",
|
|
83
|
+
"inputs": { "source": "https://cdn.rendobar.com/u/7c1e/demo.mov" },
|
|
84
|
+
"params": { "for": "web", "target": { "maxSize": "25MB" } } }
|
|
85
|
+
// → { "jobId": "job_4b8d", "status": "waiting" }
|
|
86
|
+
|
|
87
|
+
get_job { "jobId": "job_4b8d", "wait": true }
|
|
88
|
+
// → complete · https://cdn.rendobar.com/o/job_4b8d/out.mp4 · 23.8 MB
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
You give it the ceiling, not a bitrate. The encoder searches candidate encodes
|
|
92
|
+
and returns the smallest file that still clears the quality bar, so you are not
|
|
93
|
+
guessing at CRF values to land under a mail server's limit.
|
|
94
|
+
|
|
95
|
+
**Generate an image.**
|
|
96
|
+
|
|
97
|
+
> **You:** Make a 1920x1080 title card for a video about deep sea diving.
|
|
98
|
+
|
|
99
|
+
```jsonc
|
|
100
|
+
submit_job { "type": "image.generate",
|
|
101
|
+
"inputs": {},
|
|
102
|
+
"params": { "model": "standard",
|
|
103
|
+
"prompt": "Title card for a deep sea diving documentary. Shafts of light through deep blue water, small diver silhouette, empty space across the upper third for a title.",
|
|
104
|
+
"width": 1920, "height": 1080 } }
|
|
105
|
+
// → { "jobId": "job_2fa7", "status": "waiting" }
|
|
106
|
+
|
|
107
|
+
get_job { "jobId": "job_2fa7", "wait": true }
|
|
108
|
+
// → complete · https://cdn.rendobar.com/o/job_2fa7/out.png
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
`inputs` is empty because nothing is being transformed. Ask for a tier
|
|
112
|
+
(`economy`, `standard`, `premium`) and the platform picks the model, or pin an
|
|
113
|
+
exact model id to reach its own controls. Requested dimensions are snapped to
|
|
114
|
+
what the chosen model can actually render.
|
|
115
|
+
|
|
64
116
|
## Install
|
|
65
117
|
|
|
66
118
|
Rendobar has two MCP servers. Pick by whether the agent needs your filesystem.
|
|
@@ -89,7 +141,9 @@ Already ran `rb login` with the Rendobar CLI? Drop `--env`. The server finds the
|
|
|
89
141
|
<details>
|
|
90
142
|
<summary><strong>Claude Desktop, Cursor, Cline, Windsurf</strong></summary>
|
|
91
143
|
|
|
92
|
-
Same block for all four. Claude Desktop: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows). Cursor: `~/.cursor/mcp.json
|
|
144
|
+
Same block for all four. Claude Desktop: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows). Cursor: `~/.cursor/mcp.json` on every OS. Windsurf: `~/.codeium/windsurf/mcp_config.json` on every OS. Cline: MCP panel → Configure.
|
|
145
|
+
|
|
146
|
+
On Linux, use Cursor, Windsurf, Cline, Zed, VS Code or Continue. Claude Desktop has no Linux build, so it is the one client on this list you cannot use there. The server itself runs fine on Linux.
|
|
93
147
|
|
|
94
148
|
```json
|
|
95
149
|
{
|
|
@@ -150,7 +204,7 @@ env:
|
|
|
150
204
|
```
|
|
151
205
|
</details>
|
|
152
206
|
|
|
153
|
-
Needs Node 20.10 or later
|
|
207
|
+
Runs on **macOS, Linux and Windows**. Every release is tested on all three in CI. There are no native dependencies, so architecture does not matter: x64 and arm64 both work. Needs Node 20.10 or later, and the server checks at startup and exits with a clear message on older versions.
|
|
154
208
|
|
|
155
209
|
## Tools
|
|
156
210
|
|
|
@@ -176,8 +230,11 @@ Beyond that there are purpose-built types for
|
|
|
176
230
|
[timeline composition](https://rendobar.com/docs/jobs/compose),
|
|
177
231
|
[compression to a size budget](https://rendobar.com/docs/jobs/compress),
|
|
178
232
|
[subtitle burn-in](https://rendobar.com/docs/jobs/captions/burn),
|
|
179
|
-
[animated captions](https://rendobar.com/docs/jobs/captions/animate),
|
|
180
|
-
[media inspection](https://rendobar.com/docs/jobs/ffprobe)
|
|
233
|
+
[animated captions](https://rendobar.com/docs/jobs/captions/animate),
|
|
234
|
+
[media inspection](https://rendobar.com/docs/jobs/ffprobe),
|
|
235
|
+
[image generation](https://rendobar.com/docs/jobs/image-generate),
|
|
236
|
+
[image editing](https://rendobar.com/docs/jobs/image-edit), and
|
|
237
|
+
[image upscaling](https://rendobar.com/docs/jobs/image-upscale).
|
|
181
238
|
|
|
182
239
|
Full reference: **[rendobar.com/docs/jobs](https://rendobar.com/docs/jobs)**. Or
|
|
183
240
|
call `list_job_types`, which reads the registry live and is always current. This
|
|
@@ -221,6 +278,24 @@ DO_NOT_TRACK=1 # or RENDOBAR_TELEMETRY=0
|
|
|
221
278
|
**The server won't start.** It writes JSON lines to stderr. Check your client's output panel for entries with `level: "error"`.
|
|
222
279
|
</details>
|
|
223
280
|
|
|
281
|
+
## Privacy Policy
|
|
282
|
+
|
|
283
|
+
Full policy: **[rendobar.com/privacy](https://rendobar.com/privacy/)**. What this server does specifically:
|
|
284
|
+
|
|
285
|
+
**Collected.** Your API key, read from the flag, the environment, or the credentials file. Job inputs you pass to a tool, and files you point `upload_file` at, are sent to the Rendobar API to run the job you asked for. Anonymous telemetry covers the tool name, whether it succeeded, how long it took, and the agent's stated intent.
|
|
286
|
+
|
|
287
|
+
**Not collected.** Tool parameters and responses. File URLs, job configs, and outputs are stripped before any telemetry leaves the process. Telemetry carries no account identity and builds no person profile. Nothing is read from your disk except the file paths you explicitly pass to `upload_file`.
|
|
288
|
+
|
|
289
|
+
**Storage.** Uploaded inputs and job outputs live in Rendobar's storage and are removed on the retention schedule for your plan. Telemetry goes to PostHog. The server keeps nothing on your machine beyond the credentials file the CLI writes.
|
|
290
|
+
|
|
291
|
+
**Third parties.** Rendobar (job execution and storage) and PostHog (anonymous telemetry). Opt out of telemetry entirely with `DO_NOT_TRACK=1` or `RENDOBAR_TELEMETRY=0`.
|
|
292
|
+
|
|
293
|
+
**Contact.** [support@rendobar.com](mailto:support@rendobar.com), or open an issue on this repo.
|
|
294
|
+
|
|
295
|
+
## Security
|
|
296
|
+
|
|
297
|
+
Reporting a vulnerability: see [SECURITY.md](./SECURITY.md).
|
|
298
|
+
|
|
224
299
|
## Contributing
|
|
225
300
|
|
|
226
301
|
See [CONTRIBUTING.md](./CONTRIBUTING.md). For AI-assisted development, [AGENTS.md](./AGENTS.md) and [CLAUDE.md](./CLAUDE.md).
|
package/dist/bin.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{StdioServerTransport as Ie}from"@modelcontextprotocol/sdk/server/stdio.js";import{homedir as z,platform as ke}from"os";import _ from"path";var
|
|
3
|
-
`)};if(e.patchConsole===!0&&f===null){f={log:console.log.bind(console),info:console.info.bind(console),warn:console.warn.bind(console),debug:console.debug.bind(console)};let r=s=>(...a)=>{let i=a.map(l=>typeof l=="string"?l:JSON.stringify(l)).join(" ");o(s,{msg:i,source:"console"})};console.log=r("info"),console.info=r("info"),console.warn=r("warn"),console.debug=r("debug")}return{debug:r=>o("debug",r),info:r=>o("info",r),warn:r=>o("warn",r),error:r=>o("error",r),restoreConsole:()=>{f!==null&&(console.log=f.log,console.info=f.info,console.warn=f.warn,console.debug=f.debug,f=null)}}}import{promises as J}from"fs";var g=class extends Error{constructor(n){super(n),this.name="ConfigError"}},G="https://api.rendobar.com",V=new Set(["debug","info","warn","error"]);async function x(e){let n=T(e.argv,"--api-key"),o=T(e.argv,"--api-base"),r={};try{let c=await J.readFile(e.credsPath,"utf8"),p=JSON.parse(c);p!==null&&typeof p=="object"&&(r=p)}catch{}let s=n??e.env.RENDOBAR_API_KEY??r.apiKey,a=o??r.apiBase??G,i=s===void 0||s===""?null:s;if(i!==null&&!i.startsWith("rb_"))throw new g(`Invalid Rendobar API key: must start with 'rb_' (got '${i.slice(0,4)}...').`);let l=e.env.RENDOBAR_LOG_LEVEL??"info";if(!V.has(l))throw new g(`Invalid RENDOBAR_LOG_LEVEL='${l}'. Use one of: debug, info, warn, error.`);return{apiKey:i,apiBase:a,logLevel:l}}function T(e,n){let o=`${n}=`;for(let r=0;r<e.length;r++){let s=e[r];if(s!==void 0){if(s.startsWith(o))return s.slice(o.length);if(s===n){let a=e[r+1];if(a!==void 0&&!a.startsWith("--"))return a}}}}import{McpServer as
|
|
2
|
+
import{StdioServerTransport as Ie}from"@modelcontextprotocol/sdk/server/stdio.js";import{homedir as z,platform as ke}from"os";import _ from"path";var v={debug:10,info:20,warn:30,error:40},f=null;function S(e){let n=v[e.level],o=(r,s)=>{if(v[r]<n)return;let a={level:r,time:Date.now(),...s};e.name!==void 0&&(a.name=e.name),process.stderr.write(JSON.stringify(a)+`
|
|
3
|
+
`)};if(e.patchConsole===!0&&f===null){f={log:console.log.bind(console),info:console.info.bind(console),warn:console.warn.bind(console),debug:console.debug.bind(console)};let r=s=>(...a)=>{let i=a.map(l=>typeof l=="string"?l:JSON.stringify(l)).join(" ");o(s,{msg:i,source:"console"})};console.log=r("info"),console.info=r("info"),console.warn=r("warn"),console.debug=r("debug")}return{debug:r=>o("debug",r),info:r=>o("info",r),warn:r=>o("warn",r),error:r=>o("error",r),restoreConsole:()=>{f!==null&&(console.log=f.log,console.info=f.info,console.warn=f.warn,console.debug=f.debug,f=null)}}}import{promises as J}from"fs";var g=class extends Error{constructor(n){super(n),this.name="ConfigError"}},G="https://api.rendobar.com",V=new Set(["debug","info","warn","error"]);async function x(e){let n=T(e.argv,"--api-key"),o=T(e.argv,"--api-base"),r={};try{let c=await J.readFile(e.credsPath,"utf8"),p=JSON.parse(c);p!==null&&typeof p=="object"&&(r=p)}catch{}let s=n??e.env.RENDOBAR_API_KEY??r.apiKey,a=o??r.apiBase??G,i=s===void 0||s===""?null:s;if(i!==null&&!i.startsWith("rb_"))throw new g(`Invalid Rendobar API key: must start with 'rb_' (got '${i.slice(0,4)}...').`);let l=e.env.RENDOBAR_LOG_LEVEL??"info";if(!V.has(l))throw new g(`Invalid RENDOBAR_LOG_LEVEL='${l}'. Use one of: debug, info, warn, error.`);return{apiKey:i,apiBase:a,logLevel:l}}function T(e,n){let o=`${n}=`;for(let r=0;r<e.length;r++){let s=e[r];if(s!==void 0){if(s.startsWith(o))return s.slice(o.length);if(s===n){let a=e[r+1];if(a!==void 0&&!a.startsWith("--"))return a}}}}import{McpServer as Ce}from"@modelcontextprotocol/sdk/server/mcp.js";import{createClient as Z}from"@rendobar/sdk";function E(e,n){let o=e.apiKey===null?null:Z({apiKey:e.apiKey,baseUrl:e.apiBase});return{logger:n,sdk:o,config:e,cachedMaxFileSize:null}}function d(e){if(e.sdk===null)throw new g(`No Rendobar API key configured. Provide one via:
|
|
4
4
|
1. --api-key=<key> command-line flag
|
|
5
5
|
2. RENDOBAR_API_KEY environment variable
|
|
6
6
|
3. credentials file (written by 'rb login' from the Rendobar CLI)
|
|
7
7
|
|
|
8
|
-
Get an API key at https://app.rendobar.com/settings/api-keys`);return e.sdk}var
|
|
8
|
+
Get an API key at https://app.rendobar.com/settings/api-keys`);return e.sdk}var C=`Rendobar runs media jobs in the cloud and returns hosted output URLs.
|
|
9
9
|
|
|
10
10
|
Call list_job_types first. It reads the job registry live, so it is the only
|
|
11
11
|
current answer to "can Rendobar do this". The job types are not listed here on
|
|
@@ -24,15 +24,17 @@ What Rendobar cannot do:
|
|
|
24
24
|
- Stream live media
|
|
25
25
|
- Run arbitrary local binaries (sharp, imagemagick, yt-dlp) \u2014 submit a job instead
|
|
26
26
|
|
|
27
|
-
For anything list_job_types does not cover, tell the user instead of improvising locally.`;import{isApiError as $}from"@rendobar/sdk";function
|
|
27
|
+
For anything list_job_types does not cover, tell the user instead of improvising locally.`;import{isApiError as $}from"@rendobar/sdk";function A(e,n,o){return async()=>{let r=Date.now();try{let s=await o();return e.logger.info({tool:n,durationMs:Date.now()-r,ok:!0}),{content:[{type:"text",text:JSON.stringify(s,null,2)}],structuredContent:s}}catch(s){let a=Date.now()-r;if($(s))return e.logger.error({tool:n,durationMs:a,ok:!1,errCode:s.code,errMsg:s.message}),{isError:!0,content:[{type:"text",text:JSON.stringify({error:{code:s.code,message:s.message,retryable:s.statusCode===429}})}]};throw e.logger.error({tool:n,durationMs:a,ok:!1,err:String(s)}),s}}}function h(e,n,o){let r={title:o.title,description:o.description,inputSchema:o.inputSchema,annotations:o.annotations};o.outputSchema!==void 0&&(r.outputSchema=o.outputSchema);let s=async(a,i)=>A(n,o.name,()=>o.execute(a,n,i))();e.registerTool(o.name,r,s)}import{z as m}from"zod";function Y(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GB`:e>=1048576?`${(e/1048576).toFixed(0)} MB`:e>=1024?`${(e/1024).toFixed(0)} KB`:`${e} B`}var W={name:"get_account",title:"Get Rendobar Account",description:"Get the authenticated account's credit balance, plan, and limits. Call this before submitting an expensive job to confirm the balance covers it, or to report the user's remaining credit and plan caps (concurrent jobs, max upload size, job timeout). Takes no arguments. Read-only and idempotent \u2014 it never spends credit or changes anything. Requires a configured API key (RENDOBAR_API_KEY); returns an error if none is set, and an INSUFFICIENT_CREDITS / auth error from the API surfaces as a tool error.",inputSchema:{},outputSchema:{balance:m.string(),balanceUsd:m.number(),plan:m.string(),isPro:m.boolean(),limits:m.object({concurrentJobs:m.number(),maxFileSize:m.string(),maxFileSizeBytes:m.number(),jobTimeoutMin:m.number()})},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},execute:async(e,n)=>{let o=await d(n).billing.state();return n.cachedMaxFileSize=o.plan.limits.maxInputFileSize,{balance:`$${o.balance.amount.toFixed(2)}`,balanceUsd:o.balance.amount,plan:o.plan.slug,isPro:o.isPro,limits:{concurrentJobs:o.plan.limits.concurrentJobs,maxFileSize:Y(o.plan.limits.maxInputFileSize),maxFileSizeBytes:o.plan.limits.maxInputFileSize,jobTimeoutMin:Math.floor(o.plan.limits.maxJobTimeout/60)}}}};function k(){return[W]}import{z as t}from"zod";import{ApiError as q,WaitTimeoutError as X,isApiError as Q}from"@rendobar/sdk";var y=t.object({url:t.string(),path:t.string(),type:t.string(),size:t.number(),meta:t.record(t.string(),t.unknown()).optional()}),ee=t.object({data:t.unknown(),file:y.nullable(),files:y.array(),expiresAt:t.number().nullable()}),te=t.object({output:ee.nullish(),error:t.object({code:t.string(),message:t.string(),detail:t.string().nullable(),retryable:t.boolean()}).nullish(),cost:t.object({amount:t.number(),currency:t.string(),formatted:t.string()}).nullable().optional()});function O(e){let n=te.safeParse(e);return n.success?n.data:{}}function oe(e){let n={};return e.data!==null&&e.data!==void 0&&(n.data=e.data),e.file!==null&&(n.file=e.file),e.files.length>0&&(n.fileCount=e.files.length,n.files=e.files),e.expiresAt!==null&&(n.expiresAt=e.expiresAt),n}var ne=t.object({data:t.unknown().optional().describe("Computed JSON answer (probe info, detections, transcript)"),file:y.optional().describe("Headline produced file"),fileCount:t.number().optional(),files:y.array().optional().describe("Every produced file"),expiresAt:t.number().optional().describe("Epoch ms when the file URLs expire")}),re=t.object({code:t.string(),message:t.string(),detail:t.string().nullable(),retryable:t.boolean()}),se={name:"list_jobs",title:"List Recent Rendobar Jobs",description:"List recent jobs for the authenticated account, newest first. Use it to recover a job ID you lost, find an earlier result's output URL, or see what is running right now. Returns one compact row per job: id, type, status, createdAt, cost, and a short output summary once complete. Call get_job for a single job's full output and logs. Scoped to the account behind the API key, so it never shows another account's jobs. Filter with status or type, and cap the result with limit (1-50, default 10). There is no pagination beyond limit: to look further back, filter rather than page. Read-only. It never submits, cancels or changes a job. Requires a configured API key (RENDOBAR_API_KEY) and errors if none is set.",inputSchema:{status:t.enum(["waiting","dispatched","running","complete","failed","cancelled"]).optional().describe("Only return jobs in this status. Omit to return all statuses."),type:t.string().optional().describe("Only return jobs of this type, e.g. 'ffmpeg'. Omit to return all types."),limit:t.number().int().min(1).max(50).default(10).describe("How many jobs to return, newest first (1\u201350, default 10).")},outputSchema:{jobs:t.array(t.object({id:t.string(),type:t.string(),status:t.string(),createdAt:t.string().describe("ISO 8601"),cost:t.string().nullable(),output:t.object({url:t.string().optional().describe("Headline file URL"),fileCount:t.number().optional(),hasData:t.boolean().optional().describe("True when a computed data answer exists \u2014 fetch it with get_job")}).optional().describe("Compact summary, present on complete jobs only")})),total:t.number()},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},execute:async(e,n)=>{let o=await d(n).jobs.list({status:e.status,type:e.type,limit:e.limit});return{jobs:o.data.map(r=>{let s=O(r),a={id:r.id,type:r.type,status:r.status,createdAt:new Date(r.createdAt).toISOString(),cost:s.cost?.formatted??null};if(r.status==="complete"&&s.output){let i=s.output,l={};i.file!==null&&(l.url=i.file.url),i.files.length>0&&(l.fileCount=i.files.length),i.data!==null&&i.data!==void 0&&(l.hasData=!0),a.output=l}return a}),total:o.meta.total}}},ie=5e4,ae={name:"get_job",title:"Get Rendobar Job",description:"Check status and get results of a submitted job. PREFER wait:true after submit_job \u2014 it long-polls server-side (up to ~50s) and returns as soon as the job finishes, instead of you polling in a loop; if the job is still running when the wait times out it returns the latest snapshot, so just call again with wait:true. Returns progress, current step, cost, and output when done. The output is one unified shape for every job type: `data` is the computed JSON answer (probe info, detections, transcript) when the job produces one; `file` is the headline produced file (`{ url, type, path, size, meta }`) \u2014 a single output or a stream manifest (.m3u8/.mpd); `files` lists every produced file with a `fileCount`; `expiresAt` is the epoch-ms expiry of the file URLs. Data-only jobs have `file` null and no files; file-only jobs have no `data`. Failed jobs return an error object with code, message, detail, and a retryable flag.",inputSchema:{jobId:t.string().describe("Job ID returned by submit_job (e.g. 'job_abc123')"),wait:t.boolean().optional().describe("When true, wait for the job to reach a terminal status (long-poll, up to ~50 seconds) instead of returning the current status immediately. Times out gracefully with the latest snapshot \u2014 call again with wait:true to keep waiting.")},outputSchema:{id:t.string(),type:t.string(),status:t.string().describe("Open set: waiting | dispatched | running | complete | failed | cancelled"),progress:t.number().optional().describe("Fraction of completed steps (0\u20131); present while running"),step:t.string().optional().describe("Name of the currently running step"),cost:t.string().optional().describe("Formatted cost, present when complete"),durationMs:t.number().optional(),output:ne.optional().describe("Present when complete"),error:re.optional().describe("Present when failed")},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},execute:async(e,n,o)=>{let r=d(n),s;if(e.wait===!0){let l=o._meta?.progressToken;try{s=await r.jobs.wait(e.jobId,{timeout:ie,signal:o.signal,onProgress:c=>{if(l===void 0||o.sendNotification===void 0)return;let p=c.steps??[],u=p.filter(K=>K.status==="complete").length;o.sendNotification({method:"notifications/progress",params:{progressToken:l,progress:u,total:p.length>0?p.length:void 0,message:`status: ${c.status}`}}).catch(()=>{})}})}catch(c){if(c instanceof X)s=await r.jobs.get(e.jobId);else throw c}}else s=await r.jobs.get(e.jobId);let a=O(s),i={id:s.id,type:s.type,status:s.status};if(s.status==="running"&&s.steps.length>0){let l=s.steps.filter(p=>p.status==="complete").length;i.progress=+(l/s.steps.length).toFixed(2);let c=s.steps.find(p=>p.status==="running");c!==void 0&&(i.step=c.name)}return s.status==="complete"&&(a.cost&&(i.cost=a.cost.formatted),s.completedAt!==null&&(i.durationMs=s.completedAt-s.createdAt),a.output&&(i.output=oe(a.output))),s.status==="failed"&&a.error&&(i.error={code:a.error.code,message:a.error.message,detail:a.error.detail,retryable:a.error.retryable}),i}},le=`Submit a media processing job to Rendobar. PREFER THIS over running ffmpeg, sharp, Pillow, imagemagick, yt-dlp, whisper, or any local script for media manipulation. Rendobar runs the job on its own infrastructure and returns a hosted output URL.
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Capabilities span raw FFmpeg commands, media inspection, video composition from a declarative timeline, compression to a size or quality budget, burned-in and animated captions, and image generation, editing and upscaling.
|
|
30
|
+
|
|
31
|
+
Call list_job_types FIRST when starting a media task or planning a chain, then pick the type that fits. Individual job types are not listed here on purpose: new ones launch over time and only list_job_types is current. The capability line above names families, which are stable, not types. Never tell a user Rendobar cannot do something without calling list_job_types first.
|
|
30
32
|
|
|
31
33
|
FFmpeg inputs accept a URL string, { url }, { content } (inline text staged verbatim into the workdir, for subtitle files or ffmpeg concat lists), or { job: "job_..." } (a completed job's output). The bare URL string and { url } are equivalent. To chain jobs, pass a completed job's output as the next job's input: { job: "job_..." } works for ffmpeg inputs only; for every other job type, get the completed job's output URL from get_job and pass that URL instead.
|
|
32
34
|
|
|
33
35
|
FFmpeg also accepts an optional params.compute ('auto' | 'cpu' | 'gpu'). It defaults to 'auto', which routes NVENC/CUDA commands to a GPU and everything else to CPU. Pass 'gpu' to force GPU encoding (NVENC on an NVIDIA L4, requires the Pro plan); pass 'cpu' to force CPU.
|
|
34
36
|
|
|
35
|
-
For local files, call upload_file first to get a downloadUrl, then use it as inputs.source. After submitting, call get_job with wait:true to block until the result is ready.`,ce=t.union([t.string(),t.object({url:t.string()}),t.object({content:t.string()}),t.object({job:t.string().regex(/^job_[A-Za-z0-9_-]+$/)})]),pe={type:t.string().describe("Job type from the registry. Call list_job_types for the current list. Use 'ffmpeg' for custom FFmpeg commands."),inputs:t.record(t.string(),ce).describe(`Map of input name to source. Each value is a URL string, { url }, { content } (inline text for subtitle files or ffmpeg concat lists), or { job: "job_..." } (a completed job's output, resolves only for ffmpeg inputs; for other job types pass the prior job's output URL from get_job instead). For FFmpeg: keys match filenames in the command.`),params:t.record(t.string(),t.unknown()).optional().describe("Type-specific parameters. For ffmpeg: { command: '...', compute?: 'auto' | 'cpu' | 'gpu' } \u2014 compute defaults to 'auto' and routes NVENC/CUDA commands to a GPU; 'gpu' forces GPU encoding (NVIDIA L4, Pro plan), 'cpu' forces CPU."),idempotencyKey:t.string().optional().describe("Prevents duplicate jobs on retry. Unique value per logical operation.")};async function
|
|
37
|
+
For local files, call upload_file first to get a downloadUrl, then use it as inputs.source. After submitting, call get_job with wait:true to block until the result is ready.`,ce=t.union([t.string(),t.object({url:t.string()}),t.object({content:t.string()}),t.object({job:t.string().regex(/^job_[A-Za-z0-9_-]+$/)})]),pe={type:t.string().describe("Job type from the registry. Call list_job_types for the current list. Use 'ffmpeg' for custom FFmpeg commands."),inputs:t.record(t.string(),ce).describe(`Map of input name to source. Each value is a URL string, { url }, { content } (inline text for subtitle files or ffmpeg concat lists), or { job: "job_..." } (a completed job's output, resolves only for ffmpeg inputs; for other job types pass the prior job's output URL from get_job instead). For FFmpeg: keys match filenames in the command.`),params:t.record(t.string(),t.unknown()).optional().describe("Type-specific parameters. For ffmpeg: { command: '...', compute?: 'auto' | 'cpu' | 'gpu' } \u2014 compute defaults to 'auto' and routes NVENC/CUDA commands to a GPU; 'gpu' forces GPU encoding (NVIDIA L4, Pro plan), 'cpu' forces CPU."),idempotencyKey:t.string().optional().describe("Prevents duplicate jobs on retry. Unique value per logical operation.")};async function de(e,n){if(!Q(e)||e.code!=="INVALID_JOB_TYPE")return e;let o=[e.message];try{let r=await d(n).jobs.types();o.push(`Live types right now: ${r.map(s=>s.type).join(", ")}.`)}catch{}return e.message.includes("list_job_types")||o.push("Call list_job_types for the current list."),new q(e.code,e.statusCode,o.join(" "),e.details,e.retryAfter)}var ue={name:"submit_job",title:"Submit Rendobar Job",description:le,inputSchema:pe,outputSchema:{jobId:t.string(),status:t.string().describe("Initial status, normally 'waiting'")},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},execute:async(e,n)=>{try{let o=await d(n).jobs.create({type:e.type,inputs:e.inputs,params:e.params,idempotencyKey:e.idempotencyKey});return{jobId:o.id,status:o.status}}catch(o){throw await de(o,n)}}},me={name:"cancel_job",title:"Cancel Rendobar Job",description:"Cancel a job. Jobs in status 'waiting', 'dispatched' or 'running' can be cancelled (a running job's upstream execution is stopped too). Use when the user changes their mind, or when you submitted the wrong job. Completed, failed, or already-cancelled jobs cannot be cancelled.",inputSchema:{jobId:t.string().describe("Job ID to cancel (e.g. 'job_abc123')")},outputSchema:{id:t.string(),status:t.string().describe("'cancelled' on success")},annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!0},execute:async(e,n)=>{let o=await d(n).jobs.cancel(e.jobId);return{id:o.id,status:o.status}}},fe=t.object({type:t.string(),tag:t.string(),summary:t.string(),acceptsMedia:t.array(t.string())}),ge=`Pick a type by its summary and acceptsMedia (the media kinds it takes), then call submit_job with that type. To chain jobs, pass a completed job's output as the next job's input: use { job: "job_..." } for ffmpeg; for every other job type, get the completed job's output URL from get_job and pass that URL instead.`,be={name:"list_job_types",title:"List Rendobar Job Types",description:"List every active Rendobar job type with its summary and the media kinds it accepts. Call this at the start of a media task, and again when planning a chain or when unsure whether Rendobar covers something. Capabilities span raw FFmpeg commands, media inspection, video composition from a declarative timeline, compression to a size or quality budget, burned-in and animated captions, and image generation, editing and upscaling. The type list is read live from the job registry on every call, so it is always current and is never cached in this description. Takes no arguments. Read-only: it never submits or changes a job.",inputSchema:{},outputSchema:{jobTypes:t.array(t.object({type:t.string().describe("Job type identifier, e.g. 'ffmpeg'"),tag:t.string().describe("Category tag"),summary:t.string().describe("Short description"),acceptsMedia:t.array(t.string()).describe("Media kinds this type accepts, e.g. video, image, audio")})),guidance:t.string()},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},execute:async(e,n)=>({jobTypes:(await d(n).jobs.types()).map(r=>fe.parse(r)),guidance:ge})},b=e=>e;function P(){return[b(se),b(ae),b(ue),b(me),b(be)]}import{z as w}from"zod";import{promises as he}from"fs";import R from"path";import{promises as L}from"fs";import D from"path";async function F(e,n){let o=D.resolve(n.cwd,e),r=await L.realpath(o);if(n.roots!==void 0&&n.roots.length>0&&!(await Promise.all(n.roots.map(i=>L.realpath(i).catch(()=>null)))).some(i=>i!==null&&(r===i||r.startsWith(i+D.sep))))throw new Error(`Path is outside the allowed MCP roots: ${r}`);return r}async function ye(e){if(e.cachedMaxFileSize!==null)return e.cachedMaxFileSize;let n=await d(e).billing.state();return e.cachedMaxFileSize=n.plan.limits.maxInputFileSize,e.cachedMaxFileSize}var we={name:"upload_file",title:"Upload Local File to Rendobar",description:"Read a local file and upload it to Rendobar. Returns a downloadUrl to use as input in submit_job. If the file is already at a public HTTPS URL, skip this and pass the URL directly to submit_job.",inputSchema:{path:w.string().describe("Absolute or working-dir-relative path to the file"),filename:w.string().optional().describe("Filename hint sent to Rendobar (defaults to basename of path)")},outputSchema:{downloadUrl:w.string().url(),sizeBytes:w.number()},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},execute:async(e,n,o)=>{let r=await F(e.path,{cwd:process.cwd()}),s=await he.open(r,"r");try{let a=await s.stat();if(!a.isFile())throw new Error(`Path is not a regular file: ${R.basename(r)}`);let i=a.size,l=await ye(n);if(i>l)throw new Error(`File size (${i} bytes) exceeds plan limit (${l} bytes). Upgrade your plan for larger uploads.`);n.logger.debug({msg:"upload_start",basename:R.basename(r),sizeBytes:i});let c=await s.readFile(),p=new Blob([c]),u=await d(n).uploads.create(p,{filename:e.filename??R.basename(r),signal:o.signal});return n.logger.info({msg:"upload_complete",basename:R.basename(r),sizeBytes:i}),{downloadUrl:u.url,sizeBytes:i}}finally{await s.close()}}},Re=e=>e;function N(){return[Re(we)]}function U(e,n){for(let o of k())h(e,n,o);for(let o of P())h(e,n,o);for(let o of N())h(e,n,o)}import{PostHog as _e}from"posthog-node";import{instrument as je}from"@posthog/mcp";var M=process.env.RENDOBAR_TELEMETRY_KEY??"phc_pf4JwZ5WGtDcWDG6kYEkDZtEAy7dbunkNHthLj8JRa9v",ve=process.env.RENDOBAR_TELEMETRY_HOST??"https://e.rendobar.com",Se=["$mcp_parameters","$mcp_response"];function Te(){if(process.env.DO_NOT_TRACK&&process.env.DO_NOT_TRACK!=="0")return!0;let e=(process.env.RENDOBAR_TELEMETRY??"").toLowerCase();return!!(e==="0"||e==="false"||e==="off"||e==="no"||process.env.RENDOBAR_NO_TELEMETRY||process.env.RENDOBAR_DISABLE_TELEMETRY||process.env.CI==="true")}function xe(){return M.length>0&&!Te()}function Ee(e){for(let n of Se)delete e[n];return e}function B(e,n){if(!xe())return null;let o=new _e(M,{host:ve,flushAt:1,flushInterval:0});return je(e,o,{beforeSend:r=>(r.properties=Ee(r.properties),r)}),n.info({msg:"Anonymous MCP usage analytics on (tool name, success, duration, intent \u2014 never your parameters, responses, or credentials). Disable with DO_NOT_TRACK=1 or RENDOBAR_TELEMETRY=0."}),async()=>{try{await o.shutdown()}catch{}}}var Ae="1.9.1";async function H(e){let n=E(e.config,e.logger),o=new Ce({name:"rendobar",version:Ae},{capabilities:{tools:{},logging:{}},instructions:C});U(o,n);let r=B(o,e.logger);return{server:o,cleanup:async()=>{r&&await r()}}}var j="1.9.1",Oe=`@rendobar/mcp v${j}
|
|
36
38
|
Local stdio Model Context Protocol server for Rendobar.
|
|
37
39
|
|
|
38
40
|
Usage:
|
|
@@ -55,6 +57,6 @@ Docs: https://rendobar.com/docs/mcp/
|
|
|
55
57
|
Issues: https://github.com/rendobar/mcp/issues
|
|
56
58
|
`;function Pe(){if(ke()==="win32"){let e=process.env.APPDATA??_.join(z(),"AppData","Roaming");return _.join(e,"rendobar","credentials.json")}return _.join(z(),".config","rendobar","credentials.json")}async function Le(){let e=process.argv.slice(2);(e.includes("--help")||e.includes("-h"))&&(process.stdout.write(Oe),process.exit(0)),(e.includes("--version")||e.includes("-V"))&&(process.stdout.write(j+`
|
|
57
59
|
`),process.exit(0));let n=process.versions.node.split(".")[0];(n!==void 0?parseInt(n,10):0)<20&&(process.stderr.write(`@rendobar/mcp requires Node.js 20 or later. Found: ${process.versions.node}
|
|
58
|
-
`),process.exit(1));let r;try{r=await x({argv:e,env:process.env,credsPath:Pe()})}catch(
|
|
59
|
-
`),process.exit(1)),
|
|
60
|
+
`),process.exit(1));let r;try{r=await x({argv:e,env:process.env,credsPath:Pe()})}catch(u){throw u instanceof g&&(process.stderr.write(u.message+`
|
|
61
|
+
`),process.exit(1)),u}let s=S({level:r.logLevel,name:"rendobar-mcp",patchConsole:!0}),{server:a,cleanup:i}=await H({config:r,logger:s}),l=!1,c=async u=>{if(!l){l=!0,s.info({msg:"shutdown",signal:u});try{await i()}catch{}process.exit(0)}};process.on("SIGINT",()=>{c("SIGINT")}),process.on("SIGTERM",()=>{c("SIGTERM")}),r.apiKey===null&&s.warn({msg:"no_api_key",detail:"Started without an API key. Tools are listed but will fail when called. Set RENDOBAR_API_KEY to enable them."});let p=new Ie;await a.connect(p),s.info({msg:"ready",version:j})}Le().catch(e=>{process.stderr.write(`Fatal: ${e instanceof Error?e.message:String(e)}
|
|
60
62
|
`),process.exit(1)});
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{McpServer as ge}from"@modelcontextprotocol/sdk/server/mcp.js";import{createClient as
|
|
2
|
+
import{McpServer as ge}from"@modelcontextprotocol/sdk/server/mcp.js";import{createClient as D}from"@rendobar/sdk";import{promises as Re}from"fs";var f=class extends Error{constructor(n){super(n),this.name="ConfigError"}};function R(e,n){let o=e.apiKey===null?null:D({apiKey:e.apiKey,baseUrl:e.apiBase});return{logger:n,sdk:o,config:e,cachedMaxFileSize:null}}function c(e){if(e.sdk===null)throw new f(`No Rendobar API key configured. Provide one via:
|
|
3
3
|
1. --api-key=<key> command-line flag
|
|
4
4
|
2. RENDOBAR_API_KEY environment variable
|
|
5
5
|
3. credentials file (written by 'rb login' from the Rendobar CLI)
|
|
@@ -23,12 +23,14 @@ What Rendobar cannot do:
|
|
|
23
23
|
- Stream live media
|
|
24
24
|
- Run arbitrary local binaries (sharp, imagemagick, yt-dlp) \u2014 submit a job instead
|
|
25
25
|
|
|
26
|
-
For anything list_job_types does not cover, tell the user instead of improvising locally.`;import{isApiError as
|
|
26
|
+
For anything list_job_types does not cover, tell the user instead of improvising locally.`;import{isApiError as L}from"@rendobar/sdk";function _(e,n,o){return async()=>{let s=Date.now();try{let r=await o();return e.logger.info({tool:n,durationMs:Date.now()-s,ok:!0}),{content:[{type:"text",text:JSON.stringify(r,null,2)}],structuredContent:r}}catch(r){let a=Date.now()-s;if(L(r))return e.logger.error({tool:n,durationMs:a,ok:!1,errCode:r.code,errMsg:r.message}),{isError:!0,content:[{type:"text",text:JSON.stringify({error:{code:r.code,message:r.message,retryable:r.statusCode===429}})}]};throw e.logger.error({tool:n,durationMs:a,ok:!1,err:String(r)}),r}}}function b(e,n,o){let s={title:o.title,description:o.description,inputSchema:o.inputSchema,annotations:o.annotations};o.outputSchema!==void 0&&(s.outputSchema=o.outputSchema);let r=async(a,i)=>_(n,o.name,()=>o.execute(a,n,i))();e.registerTool(o.name,s,r)}import{z as d}from"zod";function N(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GB`:e>=1048576?`${(e/1048576).toFixed(0)} MB`:e>=1024?`${(e/1024).toFixed(0)} KB`:`${e} B`}var U={name:"get_account",title:"Get Rendobar Account",description:"Get the authenticated account's credit balance, plan, and limits. Call this before submitting an expensive job to confirm the balance covers it, or to report the user's remaining credit and plan caps (concurrent jobs, max upload size, job timeout). Takes no arguments. Read-only and idempotent \u2014 it never spends credit or changes anything. Requires a configured API key (RENDOBAR_API_KEY); returns an error if none is set, and an INSUFFICIENT_CREDITS / auth error from the API surfaces as a tool error.",inputSchema:{},outputSchema:{balance:d.string(),balanceUsd:d.number(),plan:d.string(),isPro:d.boolean(),limits:d.object({concurrentJobs:d.number(),maxFileSize:d.string(),maxFileSizeBytes:d.number(),jobTimeoutMin:d.number()})},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},execute:async(e,n)=>{let o=await c(n).billing.state();return n.cachedMaxFileSize=o.plan.limits.maxInputFileSize,{balance:`$${o.balance.amount.toFixed(2)}`,balanceUsd:o.balance.amount,plan:o.plan.slug,isPro:o.isPro,limits:{concurrentJobs:o.plan.limits.concurrentJobs,maxFileSize:N(o.plan.limits.maxInputFileSize),maxFileSizeBytes:o.plan.limits.maxInputFileSize,jobTimeoutMin:Math.floor(o.plan.limits.maxJobTimeout/60)}}}};function T(){return[U]}import{z as t}from"zod";import{ApiError as M,WaitTimeoutError as z,isApiError as H}from"@rendobar/sdk";var g=t.object({url:t.string(),path:t.string(),type:t.string(),size:t.number(),meta:t.record(t.string(),t.unknown()).optional()}),B=t.object({data:t.unknown(),file:g.nullable(),files:g.array(),expiresAt:t.number().nullable()}),J=t.object({output:B.nullish(),error:t.object({code:t.string(),message:t.string(),detail:t.string().nullable(),retryable:t.boolean()}).nullish(),cost:t.object({amount:t.number(),currency:t.string(),formatted:t.string()}).nullable().optional()});function v(e){let n=J.safeParse(e);return n.success?n.data:{}}function K(e){let n={};return e.data!==null&&e.data!==void 0&&(n.data=e.data),e.file!==null&&(n.file=e.file),e.files.length>0&&(n.fileCount=e.files.length,n.files=e.files),e.expiresAt!==null&&(n.expiresAt=e.expiresAt),n}var Z=t.object({data:t.unknown().optional().describe("Computed JSON answer (probe info, detections, transcript)"),file:g.optional().describe("Headline produced file"),fileCount:t.number().optional(),files:g.array().optional().describe("Every produced file"),expiresAt:t.number().optional().describe("Epoch ms when the file URLs expire")}),G=t.object({code:t.string(),message:t.string(),detail:t.string().nullable(),retryable:t.boolean()}),Y={name:"list_jobs",title:"List Recent Rendobar Jobs",description:"List recent jobs for the authenticated account, newest first. Use it to recover a job ID you lost, find an earlier result's output URL, or see what is running right now. Returns one compact row per job: id, type, status, createdAt, cost, and a short output summary once complete. Call get_job for a single job's full output and logs. Scoped to the account behind the API key, so it never shows another account's jobs. Filter with status or type, and cap the result with limit (1-50, default 10). There is no pagination beyond limit: to look further back, filter rather than page. Read-only. It never submits, cancels or changes a job. Requires a configured API key (RENDOBAR_API_KEY) and errors if none is set.",inputSchema:{status:t.enum(["waiting","dispatched","running","complete","failed","cancelled"]).optional().describe("Only return jobs in this status. Omit to return all statuses."),type:t.string().optional().describe("Only return jobs of this type, e.g. 'ffmpeg'. Omit to return all types."),limit:t.number().int().min(1).max(50).default(10).describe("How many jobs to return, newest first (1\u201350, default 10).")},outputSchema:{jobs:t.array(t.object({id:t.string(),type:t.string(),status:t.string(),createdAt:t.string().describe("ISO 8601"),cost:t.string().nullable(),output:t.object({url:t.string().optional().describe("Headline file URL"),fileCount:t.number().optional(),hasData:t.boolean().optional().describe("True when a computed data answer exists \u2014 fetch it with get_job")}).optional().describe("Compact summary, present on complete jobs only")})),total:t.number()},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},execute:async(e,n)=>{let o=await c(n).jobs.list({status:e.status,type:e.type,limit:e.limit});return{jobs:o.data.map(s=>{let r=v(s),a={id:s.id,type:s.type,status:s.status,createdAt:new Date(s.createdAt).toISOString(),cost:r.cost?.formatted??null};if(s.status==="complete"&&r.output){let i=r.output,l={};i.file!==null&&(l.url=i.file.url),i.files.length>0&&(l.fileCount=i.files.length),i.data!==null&&i.data!==void 0&&(l.hasData=!0),a.output=l}return a}),total:o.meta.total}}},$=5e4,V={name:"get_job",title:"Get Rendobar Job",description:"Check status and get results of a submitted job. PREFER wait:true after submit_job \u2014 it long-polls server-side (up to ~50s) and returns as soon as the job finishes, instead of you polling in a loop; if the job is still running when the wait times out it returns the latest snapshot, so just call again with wait:true. Returns progress, current step, cost, and output when done. The output is one unified shape for every job type: `data` is the computed JSON answer (probe info, detections, transcript) when the job produces one; `file` is the headline produced file (`{ url, type, path, size, meta }`) \u2014 a single output or a stream manifest (.m3u8/.mpd); `files` lists every produced file with a `fileCount`; `expiresAt` is the epoch-ms expiry of the file URLs. Data-only jobs have `file` null and no files; file-only jobs have no `data`. Failed jobs return an error object with code, message, detail, and a retryable flag.",inputSchema:{jobId:t.string().describe("Job ID returned by submit_job (e.g. 'job_abc123')"),wait:t.boolean().optional().describe("When true, wait for the job to reach a terminal status (long-poll, up to ~50 seconds) instead of returning the current status immediately. Times out gracefully with the latest snapshot \u2014 call again with wait:true to keep waiting.")},outputSchema:{id:t.string(),type:t.string(),status:t.string().describe("Open set: waiting | dispatched | running | complete | failed | cancelled"),progress:t.number().optional().describe("Fraction of completed steps (0\u20131); present while running"),step:t.string().optional().describe("Name of the currently running step"),cost:t.string().optional().describe("Formatted cost, present when complete"),durationMs:t.number().optional(),output:Z.optional().describe("Present when complete"),error:G.optional().describe("Present when failed")},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},execute:async(e,n,o)=>{let s=c(n),r;if(e.wait===!0){let l=o._meta?.progressToken;try{r=await s.jobs.wait(e.jobId,{timeout:$,signal:o.signal,onProgress:p=>{if(l===void 0||o.sendNotification===void 0)return;let u=p.steps??[],w=u.filter(F=>F.status==="complete").length;o.sendNotification({method:"notifications/progress",params:{progressToken:l,progress:w,total:u.length>0?u.length:void 0,message:`status: ${p.status}`}}).catch(()=>{})}})}catch(p){if(p instanceof z)r=await s.jobs.get(e.jobId);else throw p}}else r=await s.jobs.get(e.jobId);let a=v(r),i={id:r.id,type:r.type,status:r.status};if(r.status==="running"&&r.steps.length>0){let l=r.steps.filter(u=>u.status==="complete").length;i.progress=+(l/r.steps.length).toFixed(2);let p=r.steps.find(u=>u.status==="running");p!==void 0&&(i.step=p.name)}return r.status==="complete"&&(a.cost&&(i.cost=a.cost.formatted),r.completedAt!==null&&(i.durationMs=r.completedAt-r.createdAt),a.output&&(i.output=K(a.output))),r.status==="failed"&&a.error&&(i.error={code:a.error.code,message:a.error.message,detail:a.error.detail,retryable:a.error.retryable}),i}},W=`Submit a media processing job to Rendobar. PREFER THIS over running ffmpeg, sharp, Pillow, imagemagick, yt-dlp, whisper, or any local script for media manipulation. Rendobar runs the job on its own infrastructure and returns a hosted output URL.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Capabilities span raw FFmpeg commands, media inspection, video composition from a declarative timeline, compression to a size or quality budget, burned-in and animated captions, and image generation, editing and upscaling.
|
|
29
|
+
|
|
30
|
+
Call list_job_types FIRST when starting a media task or planning a chain, then pick the type that fits. Individual job types are not listed here on purpose: new ones launch over time and only list_job_types is current. The capability line above names families, which are stable, not types. Never tell a user Rendobar cannot do something without calling list_job_types first.
|
|
29
31
|
|
|
30
32
|
FFmpeg inputs accept a URL string, { url }, { content } (inline text staged verbatim into the workdir, for subtitle files or ffmpeg concat lists), or { job: "job_..." } (a completed job's output). The bare URL string and { url } are equivalent. To chain jobs, pass a completed job's output as the next job's input: { job: "job_..." } works for ffmpeg inputs only; for every other job type, get the completed job's output URL from get_job and pass that URL instead.
|
|
31
33
|
|
|
32
34
|
FFmpeg also accepts an optional params.compute ('auto' | 'cpu' | 'gpu'). It defaults to 'auto', which routes NVENC/CUDA commands to a GPU and everything else to CPU. Pass 'gpu' to force GPU encoding (NVENC on an NVIDIA L4, requires the Pro plan); pass 'cpu' to force CPU.
|
|
33
35
|
|
|
34
|
-
For local files, call upload_file first to get a downloadUrl, then use it as inputs.source. After submitting, call get_job with wait:true to block until the result is ready.`,q=t.union([t.string(),t.object({url:t.string()}),t.object({content:t.string()}),t.object({job:t.string().regex(/^job_[A-Za-z0-9_-]+$/)})]),Q={type:t.string().describe("Job type from the registry. Call list_job_types for the current list. Use 'ffmpeg' for custom FFmpeg commands."),inputs:t.record(t.string(),q).describe(`Map of input name to source. Each value is a URL string, { url }, { content } (inline text for subtitle files or ffmpeg concat lists), or { job: "job_..." } (a completed job's output, resolves only for ffmpeg inputs; for other job types pass the prior job's output URL from get_job instead). For FFmpeg: keys match filenames in the command.`),params:t.record(t.string(),t.unknown()).optional().describe("Type-specific parameters. For ffmpeg: { command: '...', compute?: 'auto' | 'cpu' | 'gpu' } \u2014 compute defaults to 'auto' and routes NVENC/CUDA commands to a GPU; 'gpu' forces GPU encoding (NVIDIA L4, Pro plan), 'cpu' forces CPU."),idempotencyKey:t.string().optional().describe("Prevents duplicate jobs on retry. Unique value per logical operation.")};async function X(e,n){if(!
|
|
36
|
+
For local files, call upload_file first to get a downloadUrl, then use it as inputs.source. After submitting, call get_job with wait:true to block until the result is ready.`,q=t.union([t.string(),t.object({url:t.string()}),t.object({content:t.string()}),t.object({job:t.string().regex(/^job_[A-Za-z0-9_-]+$/)})]),Q={type:t.string().describe("Job type from the registry. Call list_job_types for the current list. Use 'ffmpeg' for custom FFmpeg commands."),inputs:t.record(t.string(),q).describe(`Map of input name to source. Each value is a URL string, { url }, { content } (inline text for subtitle files or ffmpeg concat lists), or { job: "job_..." } (a completed job's output, resolves only for ffmpeg inputs; for other job types pass the prior job's output URL from get_job instead). For FFmpeg: keys match filenames in the command.`),params:t.record(t.string(),t.unknown()).optional().describe("Type-specific parameters. For ffmpeg: { command: '...', compute?: 'auto' | 'cpu' | 'gpu' } \u2014 compute defaults to 'auto' and routes NVENC/CUDA commands to a GPU; 'gpu' forces GPU encoding (NVIDIA L4, Pro plan), 'cpu' forces CPU."),idempotencyKey:t.string().optional().describe("Prevents duplicate jobs on retry. Unique value per logical operation.")};async function X(e,n){if(!H(e)||e.code!=="INVALID_JOB_TYPE")return e;let o=[e.message];try{let s=await c(n).jobs.types();o.push(`Live types right now: ${s.map(r=>r.type).join(", ")}.`)}catch{}return e.message.includes("list_job_types")||o.push("Call list_job_types for the current list."),new M(e.code,e.statusCode,o.join(" "),e.details,e.retryAfter)}var ee={name:"submit_job",title:"Submit Rendobar Job",description:W,inputSchema:Q,outputSchema:{jobId:t.string(),status:t.string().describe("Initial status, normally 'waiting'")},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},execute:async(e,n)=>{try{let o=await c(n).jobs.create({type:e.type,inputs:e.inputs,params:e.params,idempotencyKey:e.idempotencyKey});return{jobId:o.id,status:o.status}}catch(o){throw await X(o,n)}}},te={name:"cancel_job",title:"Cancel Rendobar Job",description:"Cancel a job. Jobs in status 'waiting', 'dispatched' or 'running' can be cancelled (a running job's upstream execution is stopped too). Use when the user changes their mind, or when you submitted the wrong job. Completed, failed, or already-cancelled jobs cannot be cancelled.",inputSchema:{jobId:t.string().describe("Job ID to cancel (e.g. 'job_abc123')")},outputSchema:{id:t.string(),status:t.string().describe("'cancelled' on success")},annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!0},execute:async(e,n)=>{let o=await c(n).jobs.cancel(e.jobId);return{id:o.id,status:o.status}}},oe=t.object({type:t.string(),tag:t.string(),summary:t.string(),acceptsMedia:t.array(t.string())}),ne=`Pick a type by its summary and acceptsMedia (the media kinds it takes), then call submit_job with that type. To chain jobs, pass a completed job's output as the next job's input: use { job: "job_..." } for ffmpeg; for every other job type, get the completed job's output URL from get_job and pass that URL instead.`,re={name:"list_job_types",title:"List Rendobar Job Types",description:"List every active Rendobar job type with its summary and the media kinds it accepts. Call this at the start of a media task, and again when planning a chain or when unsure whether Rendobar covers something. Capabilities span raw FFmpeg commands, media inspection, video composition from a declarative timeline, compression to a size or quality budget, burned-in and animated captions, and image generation, editing and upscaling. The type list is read live from the job registry on every call, so it is always current and is never cached in this description. Takes no arguments. Read-only: it never submits or changes a job.",inputSchema:{},outputSchema:{jobTypes:t.array(t.object({type:t.string().describe("Job type identifier, e.g. 'ffmpeg'"),tag:t.string().describe("Category tag"),summary:t.string().describe("Short description"),acceptsMedia:t.array(t.string()).describe("Media kinds this type accepts, e.g. video, image, audio")})),guidance:t.string()},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},execute:async(e,n)=>({jobTypes:(await c(n).jobs.types()).map(s=>oe.parse(s)),guidance:ne})},m=e=>e;function x(){return[m(Y),m(V),m(ee),m(te),m(re)]}import{z as h}from"zod";import{promises as se}from"fs";import y from"path";import{promises as E}from"fs";import C from"path";async function I(e,n){let o=C.resolve(n.cwd,e),s=await E.realpath(o);if(n.roots!==void 0&&n.roots.length>0&&!(await Promise.all(n.roots.map(i=>E.realpath(i).catch(()=>null)))).some(i=>i!==null&&(s===i||s.startsWith(i+C.sep))))throw new Error(`Path is outside the allowed MCP roots: ${s}`);return s}async function ie(e){if(e.cachedMaxFileSize!==null)return e.cachedMaxFileSize;let n=await c(e).billing.state();return e.cachedMaxFileSize=n.plan.limits.maxInputFileSize,e.cachedMaxFileSize}var ae={name:"upload_file",title:"Upload Local File to Rendobar",description:"Read a local file and upload it to Rendobar. Returns a downloadUrl to use as input in submit_job. If the file is already at a public HTTPS URL, skip this and pass the URL directly to submit_job.",inputSchema:{path:h.string().describe("Absolute or working-dir-relative path to the file"),filename:h.string().optional().describe("Filename hint sent to Rendobar (defaults to basename of path)")},outputSchema:{downloadUrl:h.string().url(),sizeBytes:h.number()},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},execute:async(e,n,o)=>{let s=await I(e.path,{cwd:process.cwd()}),r=await se.open(s,"r");try{let a=await r.stat();if(!a.isFile())throw new Error(`Path is not a regular file: ${y.basename(s)}`);let i=a.size,l=await ie(n);if(i>l)throw new Error(`File size (${i} bytes) exceeds plan limit (${l} bytes). Upgrade your plan for larger uploads.`);n.logger.debug({msg:"upload_start",basename:y.basename(s),sizeBytes:i});let p=await r.readFile(),u=new Blob([p]),w=await c(n).uploads.create(u,{filename:e.filename??y.basename(s),signal:o.signal});return n.logger.info({msg:"upload_complete",basename:y.basename(s),sizeBytes:i}),{downloadUrl:w.url,sizeBytes:i}}finally{await r.close()}}},le=e=>e;function A(){return[le(ae)]}function O(e,n){for(let o of T())b(e,n,o);for(let o of x())b(e,n,o);for(let o of A())b(e,n,o)}import{PostHog as ce}from"posthog-node";import{instrument as pe}from"@posthog/mcp";var k=process.env.RENDOBAR_TELEMETRY_KEY??"phc_pf4JwZ5WGtDcWDG6kYEkDZtEAy7dbunkNHthLj8JRa9v",ue=process.env.RENDOBAR_TELEMETRY_HOST??"https://e.rendobar.com",de=["$mcp_parameters","$mcp_response"];function me(){if(process.env.DO_NOT_TRACK&&process.env.DO_NOT_TRACK!=="0")return!0;let e=(process.env.RENDOBAR_TELEMETRY??"").toLowerCase();return!!(e==="0"||e==="false"||e==="off"||e==="no"||process.env.RENDOBAR_NO_TELEMETRY||process.env.RENDOBAR_DISABLE_TELEMETRY||process.env.CI==="true")}function fe(){return k.length>0&&!me()}function be(e){for(let n of de)delete e[n];return e}function P(e,n){if(!fe())return null;let o=new ce(k,{host:ue,flushAt:1,flushInterval:0});return pe(e,o,{beforeSend:s=>(s.properties=be(s.properties),s)}),n.info({msg:"Anonymous MCP usage analytics on (tool name, success, duration, intent \u2014 never your parameters, responses, or credentials). Disable with DO_NOT_TRACK=1 or RENDOBAR_TELEMETRY=0."}),async()=>{try{await o.shutdown()}catch{}}}var he="1.9.1";async function ye(e){let n=R(e.config,e.logger),o=new ge({name:"rendobar",version:he},{capabilities:{tools:{},logging:{}},instructions:j});O(o,n);let s=P(o,e.logger);return{server:o,cleanup:async()=>{s&&await s()}}}export{ye as createRendobarMcpServer};
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rendobar/mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"description": "Rendobar
|
|
6
|
+
"description": "Rendobar: serverless media processing and generation for AI agents. Transform video, audio and images with FFmpeg, compose from a timeline, burn captions and compress to a budget. Generate and edit images from a text prompt, and upscale on a diffusion model.",
|
|
7
7
|
"homepage": "https://rendobar.com/docs/mcp-server",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -15,10 +15,18 @@
|
|
|
15
15
|
"keywords": [
|
|
16
16
|
"mcp",
|
|
17
17
|
"model-context-protocol",
|
|
18
|
+
"mcp-server",
|
|
18
19
|
"rendobar",
|
|
19
20
|
"ai",
|
|
21
|
+
"agent",
|
|
22
|
+
"claude",
|
|
23
|
+
"cursor",
|
|
20
24
|
"video",
|
|
21
|
-
"ffmpeg"
|
|
25
|
+
"ffmpeg",
|
|
26
|
+
"image-generation",
|
|
27
|
+
"captions",
|
|
28
|
+
"transcode",
|
|
29
|
+
"video-editing"
|
|
22
30
|
],
|
|
23
31
|
"author": "Rendobar",
|
|
24
32
|
"bin": {
|
|
@@ -52,7 +60,8 @@
|
|
|
52
60
|
"test:unit": "vitest run test/unit",
|
|
53
61
|
"test:integration": "vitest run test/integration",
|
|
54
62
|
"smoke": "node dist/bin.js --version",
|
|
55
|
-
"inspector": "npx -y @modelcontextprotocol/inspector node dist/bin.js"
|
|
63
|
+
"inspector": "npx -y @modelcontextprotocol/inspector node dist/bin.js",
|
|
64
|
+
"build:mcpb": "node scripts/build-mcpb.mjs"
|
|
56
65
|
},
|
|
57
66
|
"dependencies": {
|
|
58
67
|
"@modelcontextprotocol/sdk": "^1.29.0",
|