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
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. Acceptsmax_credits: if the render would cost more, it is refused instead of run. -
get_generation: status, progress, the file when it's done, andrefunded: trueif 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"
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
- Call
estimate_costwith the same body you will send tocreate_video. - Show the price to the user, or compare it with a budget.
- Call
create_videowithmax_creditsset to that estimate. - Poll
get_generationuntilcompleted, or readrefunded.
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
- Docs with a
curlfor each route: https://cirrela.com/developers?utm_source=devto - Plans: https://cirrela.com/pricing?utm_source=devto
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)