MCP
Connect your AI assistant to your account: upload a video, encode it, encrypt it and publish a player without leaving the conversation. One command to install, nothing to maintain.
What it is #
MCP is the protocol an AI assistant uses to reach external tools. @airi.live/mcp is ours: it exposes your account as 32 tools that Claude, Cursor or any compatible client can call — upload a file, quote an encode, start it, wait for it, create a player and hand you the embed.
It runs on your machine, not ours. Your credential never leaves it, and an upload's bytes go from disk straight to the bucket — through neither our server nor the assistant.
Not a separate product
curl. What it adds is shape: descriptions a model can act on, and three tools that make several calls in a row because chaining those by hand is where things break.Installing it #
First mint a credential in Developers, ticking the permissions you want the assistant to have. Then one command:
claude mcp add airi --env AIRI_KMS_TOKEN=kms_live_... -- npx -y @airi.live/mcp
For Claude Desktop, Cursor, Windsurf and anything else configured with JSON:
{ "mcpServers": { "airi": { "command": "npx", "args": ["-y", "@airi.live/mcp"], "env": { "AIRI_KMS_TOKEN": "kms_live_..." } } } }
Node 20 or newer. Nothing to install — npx fetches it on first run and keeps it current.
| Option | Variable | Default |
|---|---|---|
--token | AIRI_KMS_TOKEN | — (required) |
--namespace | AIRI_KMS_NAMESPACE | your credential's |
--url | AIRI_KMS_URL | https://kms.airi.live |
--allow-admin | AIRI_MCP_ALLOW_ADMIN=true | off |
--timeout | AIRI_KMS_TIMEOUT_MS | 60000 |
Both forms work and the flag wins over the variable, but the token belongs in the env block: an argument shows up in your machine's process list and an environment variable does not. npx @airi.live/mcp --help lists everything.
Using it #
From there you just ask. For example: *"upload ~/Videos/keynote.mp4, encode it at 1080p and 720p with DRM, and give me an embed to paste into our site"*.
airi_storage_upload path=~/Videos/keynote.mp4 → file id airi_encoding_quote heights=[1080,720] duration=600 → $0.16 airi_encoding_start package=hls+dash drm=true → job id airi_encoding_job wait=true → completed airi_player_create name="Site" → player id airi_player_embed file=<id> → signed URL + <iframe>
| Group | Tools |
|---|---|
| Storage | upload, list, get, sign URL, delete, usage |
| Encoding | quote, renditions, start, check, list, cancel, package |
| Players | create, list, update, delete, embed |
| DRM keys | create, get, list, rotate, periods |
| Policies | set, list, resolve, delete |
| Usage | balance, licences, stats |
| Everything else | discover endpoints, call the API |
Three of them make more than one call, because the API is built for browsers and an assistant is not one. airi_storage_upload takes a path and returns a sealed file — declare, multipart upload, ETag collection and complete, all inside the tool. airi_encoding_job with wait blocks until the job finishes, so an encode is one step rather than a poll loop. And airi_player_embed returns the ready <iframe> alongside the resolved player.
The last two are an escape hatch: they read the API reference live and run whatever they find. A new endpoint is available the day it ships, without waiting for us to update the package.
What it will not do #
You are giving a language model access to your account. Two things the server refuses to do even if asked, and they are worth knowing before you install it.
It will not hand your content keys to the model
key and iv are the AES secret that decrypts your video, and a tool result lands verbatim in the assistant's transcript — which is stored, replayed, and often sent to a third party. The key tools return the id, the PSSH boxes and the licence URLs, and redact the rest. You can ask for it explicitly with includeKeyMaterial to encrypt locally with shaka-packager; encoding with drm: true never needs it.It will not touch your balance or your account
/v1/admin (credits balances, mints credentials), /v1/auth (issues session tokens) and /cas (the DRM provider's callback) are refused regardless of what your token allows. What an agent may do and what a credential may do are different questions, and the answer to the first should not depend on how generously the second was minted.Everything else is reachable, because it is the job. Deletes and encodes carry the protocol's destructiveHint, so your client can ask before running them, and the descriptions say plainly what cannot be undone: a contentId is permanent at the DRM provider, a deleted file has no undo, and cancelling an encode stops the billing rather than the encoder.
Give it only what it needs #
The credential is the real boundary: the server cannot grant what your token does not have. Mint one for the assistant rather than reusing your own, ticking only the permissions the work needs.
| Permission | What it enables |
|---|---|
| Storage | upload, list, sign and delete files |
| Encoding | quote, start and cancel jobs |
| Players | create and edit players and their embeds |
| Keys and policies | DRM, licence policies, balance and usage |
A read-only assistant is a credential minted without write access: it can look at everything and change nothing. Revoking it from Developers cuts it off on the next call, not a minute later.
The spending is still yours
If something goes wrong #
| What you see | What it means |
|---|---|
UNAUTHORIZED | The token is wrong or was revoked. Mint another in Developers |
FORBIDDEN | The credential lacks that permission. Mint it again with the right box ticked |
INSUFFICIENT_FUNDS | No balance left. Reads still work; uploads, encodes and new keys do not |
| "needs a concrete namespace" | Your token is not pinned to one — add --namespace |
| The server will not start | npx @airi.live/mcp --help from a terminal tells you what is missing |
Errors reach the assistant with their code and a hint about what to do, so it usually corrects itself and tells you. If not, your MCP client's logs carry whatever the server wrote.