DEV Community

Cover image for Give Claude a video studio over MCP, and make it say the price before it renders
Lorenzo Corpita
Lorenzo Corpita

Posted on AI-assisted

Give Claude a video studio over MCP, and make it say the price before it renders

I run Cirrela, a small AI video generator built in France. This post is about the MCP server we built for it, and the one rule that shaped it: an assistant working alone must never spend more than you expected. Disclosure: it's our product, and this post was written with AI help, then checked by me.

The problem with "make me a video" from an agent

Video models are expensive per second, and the same 5-second clip costs very different amounts from one model to the next. When a person clicks "Generate", they see the price. When an agent calls a tool in a loop, nobody does. The complaint we read most about AI video tools is credits that vanish without warning, so we designed the tools around that.

What the server exposes

One URL, Streamable HTTP, JSON answers, no session:

https://cirrela.com/api/mcp
Enter fullscreen mode Exit fullscreen mode

Tools:

  • list_models: the models you can use (Kling, Wan, Grok Imagine, Gemini and others), with formats, durations, sound, and what your plan allows.
  • estimate_cost: the exact credit price of a request, your balance, and whether you can afford it. Nothing is written.
  • create_video / create_image: start a render. Accepts max_credits: if the render would cost more, it is refused instead of run.
  • get_generation: status, progress, the file when it's done, and refunded: true if the model failed (failed renders are refunded automatically).
  • get_balance.

Every tool declares readOnlyHint, destructiveHint and openWorldHint, so clients can ask before the ones that spend credits.

Add it to Claude Code

With an API key (Studio plan):

claude mcp add --transport http cirrela https://cirrela.com/api/mcp \
  --header "Authorization: Bearer cir_live_your_key"
Enter fullscreen mode Exit fullscreen mode

In claude.ai or the desktop app, no key: Settings, Connectors, Add custom connector, paste the URL, then Connect. A Cirrela page asks you to sign in and allow Claude (OAuth). That works on every paid plan.

The pattern that keeps an agent from burning credits

  1. Call estimate_cost with the same body you will send to create_video.
  2. Show the price to the user, or compare it with a budget.
  3. Call create_video with max_credits set to that estimate.
  4. Poll get_generation until completed, or read refunded.

Step 3 matters: if the agent changes a parameter between the estimate and the render (a longer duration, a higher resolution), the server refuses rather than charging more.

Things the API refuses on purpose

The studio quietly fixes impossible settings for people. The API doesn't: an unknown field (colour) or a duration the model can't do returns 422 with the field and what the model accepts ("renders 4, 5, 6, 8, 10, 15 seconds"). For an agent, a loud error beats a silent change.

Every file carries "AI-generated" metadata, and nothing made through the MCP tools is ever public.

Try it

Questions about the design (why no sessions, why refuse instead of clamp) are welcome in the comments; I'll answer them myself.

Top comments (0)