Blog
AI agents 6 min read

How to give an AI agent the ability to upload and host video

Wire the rehelios MCP server into an agent and one tool call turns a file or URL into a transcoded, CDN-hosted playbackUrl — no bolted-on storage.

rehelios

Engineering

1 tool call

from a raw file or URL to an embeddable playbackUrl

Full autonomy

no human-in-the-loop gate on the write path

npx @rehelios/cli

same primitives for agents that don't speak MCP

$0

encoding cost, no matter how many clips the agent generates

Ask an AI coding assistant how to give an agent file-handling abilities and every result is a document pipeline — chunk a PDF, embed it, drop it in a vector store, wire up retrieval. That’s the right answer if the file is a contract or a wiki page. It’s the wrong answer if the file is a video.

Search “let my agent upload video” and there’s no purpose-built equivalent of AnythingLLM or LlamaIndex for it. So teams building agents that touch video — generating clips, recording demos, hosting lecture footage — end up doing what document-RAG tooling made unnecessary for text: hand-wiring an object storage bucket into the agent’s toolset themselves.

To give an AI agent real video upload and hosting, add a purpose-built MCP server (or CLI) as one of its tools instead of bolting raw storage onto it yourself. With the rehelios MCP server registered in Claude Desktop, Claude Code, or Cursor, the agent calls one tool — rehelios_import or rehelios_upload — and gets back a ready-to-embed playbackUrl. Transcoding to HLS, storage, CDN delivery, and captions all happen behind that single call.

The blind spot: file-handling frameworks stop at documents

The RAG ecosystem solved “give an LLM the ability to read a file” years ago. AnythingLLM, LlamaIndex-style frameworks, and a dozen vector-store wrappers all assume the file is text-shaped: something you chunk, embed, and retrieve. None of them transcode, store, or serve video, because that was never the problem they were built for.

So when an agent needs to host a video rather than read one, teams improvise. A real example: gitroomhq/agent-media wires ad-hoc media handling directly into an agent’s tool layer — because there wasn’t an off-the-shelf hosting tool to reach for instead. That pattern repeats across teams building content and course agents: write an upload function, point it at a bucket, hope the URL keeps working after the agent moves on to the next task.

What “video ability” actually has to include

Giving an agent video isn’t just “let it write bytes to a bucket.” A URL that plays reliably, at scale, needs:

  • Ingest — accept a local file or import from a URL the agent already has (a Sora/Veo/Runway output, a customer upload, an S3 object).
  • Transcoding — adaptive HLS (optionally DASH or MP4) so playback doesn’t depend on the viewer’s bandwidth or device.
  • Storage and CDN delivery — durable storage behind an edge network, not a single-region bucket the agent’s own infra has to front.
  • Captions and metadata — auto-generated VTT/SRT so the video is accessible and searchable without a separate job.
  • A stable playback URL — one identifier the agent can hand back to whatever called it, that keeps resolving after the agent’s session ends.

An agent tool that only does the first bullet isn’t “video ability” — it’s a file drop with a transcoding problem still unsolved.

Wire the MCP server into the agent

The rehelios MCP server exposes that whole pipeline as tools an agent can call directly. Register it once in the client’s MCP config:

{
  "mcpServers": {
    "rehelios": {
      "command": "npx",
      "args": ["-y", "@rehelios/cli", "mcp"],
      "env": { "REHELIOS_API_KEY": "rh_live_…" }
    }
  }
}

That’s it — no server to run, no SDK to install. npx fetches the latest build on each launch. Claude Desktop, Claude Code, and Cursor all read the same shape of config; see /mcp for the exact path per client. The server exposes rehelios_upload, rehelios_import, rehelios_list, rehelios_get, and rehelios_get_embed — enough surface for an agent to put video live and reference it later without a human relaying URLs by hand.

One call: from a file or URL to a live playbackUrl

Once the tools are registered, the agent doesn’t need to know anything about transcoding or CDNs. A prompt like:

“Import https://cdn.example.com/renders/onboarding-demo.mp4 into the onboarding collection and give me an embeddable link.”

resolves to a single tool call:

{
  "tool": "rehelios_import",
  "args": {
    "url": "https://cdn.example.com/renders/onboarding-demo.mp4",
    "collectionId": "col_onboarding",
    "wait": true
  }
}

and a response the agent can hand straight back to whatever asked for it:

{
  "id": "vid_9f2a",
  "status": "ready",
  "playbackUrl": "https://videos.rehelios.com/vid_9f2a/playlist.m3u8"
}

Under the hood that’s the same mechanics as POST /v1/videos/import and GET /v1/videos/{id} on the REST API — the MCP tool is just the agent-native front door to it. See /agents for the fuller autonomous-workflow picture: generate, import, embed, all without a human copying a URL between systems.

The alternative: rolling your own storage bolt-on

The other path — the one most teams are on today — is wiring a raw object storage SDK into the agent’s tools directly, the way gitroomhq/agent-media does. It works, but the agent’s tool now owns problems that have nothing to do with its actual job: picking a transcoding approach (or skipping it and serving raw MP4), choosing a CDN, generating and rotating signed URLs, deciding what happens when a file is 4K and the bucket wasn’t provisioned for that. Every one of those is a maintenance surface the team now has to keep working, instead of a single tool call that already handles it.

The CLI path for agents that don’t speak MCP

Not every agent runtime supports MCP yet. For those, the same primitives are one shell call away via @rehelios/cli:

npx @rehelios/cli upload ./video.mp4 --wait --json
npx @rehelios/cli import https://storage/lecture.mp4 --collection col_x --wait

Both return the same JSON shape as the MCP tools — an id and a playbackUrl — so an agent that only knows how to shell out gets the same one-call ergonomics as one wired up over MCP.

Full autonomy, not a human-gated write path

Not every video MCP server that exists makes the same bet here. Mux ships an official one (mcp.mux.com, @mux/cli --agent) but deliberately human-gates destructive operations — their own stated reasoning is that agents “reach for footguns.” That’s a defensible design choice. rehelios makes the opposite one: the agent gets full autonomy on the write path, no approval step between “here’s a video” and “it’s live.” If you’re deciding how much you want an agent trusted with your video infrastructure, that’s a real trade-off worth reading in full — see /blog/agent-autonomy-vs-human-gated-video-mcp.

Where the video actually lives afterward

Giving an agent upload ability matters most when the agent is also the one generating the video. Sora download links expire in about an hour; Veo output on Vertex AI gets auto-deleted after roughly two days. An agent that generates a clip and doesn’t immediately hand it to durable storage loses it. Routing that output straight through rehelios_import — or the CLI equivalent — closes that gap in the same call that puts the video live. More on what happens to AI-generated video that never gets a permanent home: /blog/where-does-your-sora-veo-output-live. For agents that generate video as a core part of their job rather than a one-off, /use-cases/ai-generated-video covers the fuller pattern.

Giving an agent video ability isn’t a bigger version of giving it document retrieval — it’s a different problem, and until recently nothing was built for it directly. Wiring in an MCP server that owns transcoding, storage, and delivery behind one tool call is the difference between an agent that can mention video and one that can actually ship it.

Put your first video live today

Create an account, upload a file, and have a fast, embeddable video live in minutes. Pay only for what you store and stream.