# FilmLab for agents

FilmLab is the pre-production and generation studio of FilmRadar: projects,
characters, locations, shots, and image, video and sound generation. Its MCP
server lets an agent do the same work a person does in the web app, in the
same account.

- **Server URL:** https://mcp-lab.thefilmradar.com/mcp
- **Transport:** Streamable HTTP, POST only
- **Auth:** none to connect. OAuth 2.1 sign-in on the first tool that needs an account.

## What works without an account

Connecting, listing tools, prompts and resources, and these read-only tools:

- `lab_playbook`: what each FilmLab surface can do
- `lab_wissen`: search the FilmRadar knowledge layer
- `lab_list_models`: the image and video model catalog with prices
- `lab_search_catalog`: companies, tools, tutorials and news around AI filmmaking
- `lab_regie_techniken`: directing techniques (angle, framing, composition, movement) with the effect each creates and a prompt fragment
- `lab_whoami`: which account this connection uses and how it signed in
- `lab_flow_vorlagen`: the built-in flow templates, and the workflow one of them builds for the shots of a scene (pricing it with `lab_flow_angebot` and running it need an account)

Every other tool answers with HTTP 401 and a short text saying how to sign in.
Your client turns that into a sign-in step. Generation tools are charged to the
credits of the account that signed in.

## EU mode

A project has a data mode: `eu` or `frei`. In an `eu` project only models
whose data path is documented inside the EU run; any other model is refused
before anything is spent, and the refusal names the reason and the allowed
alternatives. `lab_list_models` with `eu: true` lists exactly those models
(each model also carries `eu_modus` and, where false, `eu_grund`).
`lab_create_project` takes `datenmodus`; `lab_get_project` shows it.

## Claude Code

The recommended setup is the FilmLab plugin; see [Make a film](#make-a-film)
below. To connect only the server, without skills:

```bash
claude mcp add --transport http --scope user filmlab https://mcp-lab.thefilmradar.com/mcp
```

Claude Code loads a new server only at start, and only `/mcp` can sign in.
After adding it: restart Claude Code (`claude --continue` keeps the
conversation), then `/mcp` → filmlab → Authenticate. A browser opens for the
FilmRadar login (magic link or Google).

## Make a film

For Claude Code, the FilmLab plugin bundles the remote MCP server and the
`filmlab-film` and `filmlab-schnittplatz` skills. Install it with:

```bash
claude plugin marketplace add thefilmradar/claude-plugins
claude plugin install filmlab@thefilmradar
```

Restart Claude Code, then open `/mcp` → `plugin:filmlab:filmlab` →
Authenticate to sign in to FilmRadar.

Every agent can follow this `filmlab-film` workflow, with or without the plugin:

### 1. Sign in and choose the project

Check lab_whoami, then use lab_list_projects and lab_get_project to select the project, or lab_create_project to create it. Complete sign-in when requested. Respect its datenmodus: eu or frei. For eu, use lab_list_models with eu: true and only the permitted models; never switch the project out of EU mode to bypass a refusal.

### 2. Plan the shots, quote the price, get approval

Derive the shots from the brief and choose models from lab_list_models. Quote the total price before spending. For more than a handful of paid items, propose ONE lab_auto_lauf with a credit cap and obtain one explicit approval for that run; use freigeben only after that approval. Include the intended generation and export work in the plan. Outside an approved run, quote and obtain approval before each paid call.

### 3. Generate with continuity

Use lab_generate for images and lab_animate for individual clips. For connected scenes use lab_verkettung: plan, preis, then starten after approval. Keep a continuous scene in one chain with schnitt; provide character_refs and location_id for continuity. Separate scenes can run in parallel. Wait with wait_s on lab_get_job or lab_job_status instead of repeatedly polling.

### 4. Check and show every result

Read abgleich in lab_job_status and report pass, mismatch, unverified or laeuft with the issues in one line. On mismatch offer at most one new attempt per original, lead the new prompt with the failed claim, and never retry a retry or automatically retry a video. Put every karte_ansehen link in your reply, for images and clips; obtain a clip card through lab_job_status with type video or lab_contact_sheet.

### 5. Write the whole cut, then read it back

Read the existing cut with lab_get_sequence. Use lab_timeline_apply for the WHOLE cut, pass the revision you read as erwartete_revision, and retain each existing clip_id so its identity and inherited metadata survive. On revision_veraltet, read again and merge before writing. Read lab_get_sequence again after applying and check the result. Use the two groups below: perform the manifest operations yourself; for editor-only work direct the person to Murnau and IRO and say that the editor can do it. lab_fassungen reads or restores the automatically saved checkpoints; lab_wortzeiten supplies word timings when computing pause cuts.

WARNING: the manifest represents only one sequential row. Do not rebuild a cut containing V2+ clips through it: inherited tracks do not preserve overlapping start times. Refer that cut to Murnau. When splitting through the manifest, the second piece gets a new clip_id and inherits neither grade nor effects. Existing effects, keyframes and constant speed survive through retained clip_id, but the manifest cannot set them.

### 6. Mix the sound for delivery

Use lab_mix_render with the delivery loudness target: broadcast, web or youtube, and an auto_preset when appropriate. Wait for lab_get_job with wait_s, then report the measured result and any missed targets.

### 7. Finish the look

Use lab_grade_clip for the grade of a clip in the cut, or of the whole programme with programm: true; the export uses that grade. lab_grade only grades still images in the gallery. If grading will happen in Resolve, use lab_look_in_post to prepare that handover and follow the filmlab-schnittplatz skill.

### 8. Show the preview, then export

Before the final render, summarise the cut from lab_get_sequence (clips in order, lengths, transitions, bed, sound) next to the clip cards already shown, and tell the person they can watch and adjust it in the FilmLab editor (Murnau). After the person has reviewed it and the required spending approval is covered, use lab_start_export. Follow lab_get_export until completion, show the delivered file and its provenance, and close the lab_auto_lauf with beenden when done.

For handover to Resolve, Premiere or Final Cut, follow `filmlab-schnittplatz`:

- Choose the editing software and format
- Keep generated material private until release
- Hand over a local timeline with its media
- Choose local render or server export
- Explain provenance before handing over
- Prepare Resolve before import

## Claude (claude.ai, desktop)

Settings → Connectors → Add custom connector. Name `FilmLab`, URL
`https://mcp-lab.thefilmradar.com/mcp`. Leave authentication empty; Claude
shows a Connect card the first time a tool needs the account.

## Codex

```bash
codex mcp add filmlab --url https://mcp-lab.thefilmradar.com/mcp
```

Then start a new Codex session to load the tools.

## Cursor

`~/.cursor/mcp.json`:

```json
{ "mcpServers": { "filmlab": { "url": "https://mcp-lab.thefilmradar.com/mcp" } } }
```

## VS Code

```bash
code --add-mcp '{"name":"filmlab","type":"http","url":"https://mcp-lab.thefilmradar.com/mcp"}'
```

## Any other MCP client

Add a remote Streamable HTTP server at the URL above. The OAuth metadata is
at `/.well-known/oauth-protected-resource/mcp` and
`/.well-known/oauth-authorization-server`; clients register themselves
(dynamic client registration) and use PKCE. Scopes: `filmlab:read`,
`filmlab:write`.

## No browser

For an agent on a server, in CI or over SSH: device authorization (RFC 8628).
The person approves on their phone or laptop; the agent never sees a password.

- **client_id:** `PJ3vaXiWJ8z0KKqK`. Machine-readable in `/.well-known/oauth-protected-resource/mcp`
  (the document every 401 names as `resource_metadata`) under
  `filmlab_device_authorization`, and in `/.well-known/oauth-authorization-server`
  as `filmlab_device_client_id`. On `unauthorized_client` the error names the right one.
- **Device endpoint:** `POST https://mcp-lab.thefilmradar.com/oauth/device/code`
- **Token endpoint:** `POST https://mcp-lab.thefilmradar.com/token`

1. Ask for a code:

   ```bash
   curl -s https://mcp-lab.thefilmradar.com/oauth/device/code \
     -d client_id=PJ3vaXiWJ8z0KKqK -d scope="filmlab:read filmlab:write"
   ```

   The answer has `device_code`, `user_code` (like `BCDF-GHJK`),
   `verification_uri`, `verification_uri_complete`, `expires_in` (600)
   and `interval` (5). One sign-in at a time: while a code is pending,
   do not request another.

2. Tell the person in **one** message: open `verification_uri_complete`,
   check the code is `user_code`, it expires in 10 minutes. There they sign
   in to FilmRadar, pick the projects this device may use and whether it may
   spend credits, then approve. Never ask them for a password, an email code or
   the code back.

3. Poll every `interval` seconds:

   ```bash
   curl -s https://mcp-lab.thefilmradar.com/token \
     -d grant_type=urn:ietf:params:oauth:grant-type:device_code \
     -d device_code=<device_code> -d client_id=PJ3vaXiWJ8z0KKqK
   ```

   | `error` | do |
   |---|---|
   | `authorization_pending` | keep polling; the person may need a few minutes, do not start a new code |
   | `slow_down` | add 5 seconds to the interval |
   | `access_denied` | stop, the person declined |
   | `expired_token` | start one new sign-in with one new message; if that expires too, stop |
   | `invalid_grant` | stop, the code is unknown or used; restart only if the person asks |

4. Success returns `access_token`, `refresh_token` and `expires_in`
   (about an hour; read it, do not assume). Send
   `Authorization: Bearer <access_token>` on every request to `/mcp`.

5. Stay signed in. On a 401 or when `expires_in` has passed, refresh first:

   ```bash
   curl -s https://mcp-lab.thefilmradar.com/token \
     -d grant_type=refresh_token -d refresh_token=<refresh_token> -d client_id=PJ3vaXiWJ8z0KKqK
   ```

   Each refresh returns a new refresh token. Store the new one every time.
   Start a new device sign-in only when there is no refresh token or the
   refresh fails, or after the 30 days are over.

**What a device may do.** Only the projects the person ticked. No new projects,
no deleting projects, no IRO assistant, no shared libraries (characters,
locations). Generation only if the person allowed credits. Access ends after
30 days; then sign in again. `lab_whoami` shows the current limits.

**Keep the tokens in your secret store.** Never paste a token, `device_code`
or refresh token into a chat, a log, an issue or a commit. Only the
`user_code` and the link are meant for the person.

**Revoke.** The person gets an email after every device sign-in with a
one-click revoke link. All connected devices:
https://mcp-lab.thefilmradar.com/device/geraete
