# MCP server

mint runs a remote [MCP](https://modelcontextprotocol.io) server (Model Context Protocol). With it, AI assistants and
agents such as Claude Code, Claude Desktop, Cursor or VS Code use mint as a set of tools: they read your catalogs, order
films, follow their progress and send feedback, from a conversation and without code written against the API.

The MCP server is a thin layer over the API. Every tool calls the API with your mint login or your API key, so
[scopes](/api/scopes), [limits](/api/rate-limits), credits and the request log apply unchanged.

| Setting | Value |
|---|---|
| Server URL | `https://mcp.cream-ai.de/mcp` |
| Transport | Streamable HTTP |
| Authentication | sign in with your mint account (OAuth), or `Authorization: Bearer <API key>` |
| Rights | your role in the chosen company and the confirmed scopes, or the scopes of the API key |
| Costs | the same as for the API |

> **Kurz auf Deutsch.** Mit dem MCP-Server nutzen KI-Assistenten wie Claude oder Cursor mint direkt im Gespräch: Vorlagen
> ansehen, Filme bestellen, Fortschritt verfolgen, Feedback geben. Angemeldet wird mit Ihrem mint-Konto („Verbinden“) oder
> mit einem API-Schlüssel Ihrer Firma; es gelten dieselben Rechte und Kosten wie in der API. Einen Film freigeben kann nur eine Person in mint.

### Sign in with your mint account

Clients with a *Connect* button, such as claude.ai, Claude Desktop and ChatGPT, connect without an API key:

1. Add a custom connector (in claude.ai: *Settings → Connectors → Add custom connector*) with the server URL
   `https://mcp.cream-ai.de/mcp`.
2. Click *Connect*. mint opens in your browser: sign in, choose the company and confirm the requested rights.
3. The assistant can now use the tools in your name, with your role in that company.

The connection lasts at most 365 days and ends earlier if it is not used for 30 days. Company admins see and disconnect
connected applications in mint under *Settings → mint API*. Technical details: [Authentication](/api/authentication).

### Sign in with an API key

The MCP server uses the same API keys as the API (see [Authentication](/api/authentication)). A company admin creates an
API access in mint under *Settings → API access*, chooses the scopes and copies the key. The MCP server passes the key on
to the API unchanged with every call. It does not store or log the key; to avoid checking the same key again and again,
it keeps only a hash of the key together with the result of the check for 60 seconds.

- Before it handles a request, the MCP server checks the key with the API (`GET /me`). A missing, wrong, revoked or
  expired key is answered with HTTP `401`, so the client cannot connect.
- A tool whose scope the key lacks returns a tool error with the API code `forbidden_scope` (HTTP `403`);
  `details.required_scopes` names the missing scope. The other tools keep working.
- An API access limited to IP addresses blocks the MCP server: the calls reach the API from the MCP server, not from
  your computer. Use a separate access without an IP limit for MCP.
- Create a separate API access for each assistant or person, with only the scopes it needs. To start safely, use a key
  with reading scopes only, for example `catalog:read`, `films:read` and `events:read`.


### Set up your client

Keep the key in an environment variable, not in a file you share:

```sh
export MINT_API_KEY="mint_sk_live_…"
```

#### Claude Code

```sh
claude mcp add --transport http mint \
  https://mcp.cream-ai.de/mcp \
  --header "Authorization: Bearer $MINT_API_KEY"
```

Your shell inserts the key when you run the command; Claude Code keeps it in your own configuration (`~/.claude.json`,
scope `local`), not in the project. Check the connection with `claude mcp list` or `/mcp` in a session. To share the
server with your team through the project file `.mcp.json`, reference the variable instead of the key. Everyone then sets
`MINT_API_KEY` with their own key:

```json
{
  "mcpServers": {
    "mint": {
      "type": "http",
      "url": "https://mcp.cream-ai.de/mcp",
      "headers": {
        "Authorization": "Bearer ${MINT_API_KEY}"
      }
    }
  }
}
```

#### Claude Desktop

Claude Desktop connects to a remote server with an API key through the bridge `mcp-remote`, which needs Node.js 18 or
later. Open *Settings → Developer → Edit Config*, add the server to `claude_desktop_config.json` and restart Claude
Desktop:

```json
{
  "mcpServers": {
    "mint": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.cream-ai.de/mcp",
        "--header",
        "Authorization:${MINT_AUTH_HEADER}"
      ],
      "env": {
        "MINT_AUTH_HEADER": "Bearer mint_sk_live_…"
      }
    }
  }
}
```

Write `Authorization:${MINT_AUTH_HEADER}` without a space after the colon and keep the value with the space in `env`:
some clients split arguments at spaces. The key is stored in this file in plain text, so keep the file private.

#### Cursor

Add the server to `.cursor/mcp.json` in your project, or to `~/.cursor/mcp.json` for all projects. Cursor reads the key
from the environment variable:

```json
{
  "mcpServers": {
    "mint": {
      "url": "https://mcp.cream-ai.de/mcp",
      "headers": {
        "Authorization":
          "Bearer ${env:MINT_API_KEY}"
      }
    }
  }
}
```

#### VS Code

Add the server to `.vscode/mcp.json`. VS Code asks for the key once and stores it in its secret storage, so the file
itself contains no key. The tools are available in Copilot Chat in agent mode.

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "mint-api-key",
      "description": "mint API key",
      "password": true
    }
  ],
  "servers": {
    "mint": {
      "type": "http",
      "url": "https://mcp.cream-ai.de/mcp",
      "headers": {
        "Authorization":
          "Bearer ${input:mint-api-key}"
      }
    }
  }
}
```

#### Other clients and your own agents

Any MCP client that supports Streamable HTTP and custom headers works with the server URL and the `Authorization`
header. Clients that only start local servers can use `mcp-remote` as shown for Claude Desktop. In your own agents and
workflow tools, set the header in the MCP client of your framework.

### Tools

The tools follow the API, with names in snake_case. A tool returns the JSON answer of the API. Errors come back as a
tool error with the `code`, `message` and, where it applies, `field` and `details` of the API (see
[Errors](/api/errors)).

Every tool carries the standard MCP hints: reading tools are marked `readOnlyHint`, the cancel tools `destructiveHint`.
The description of every changing tool asks the assistant to confirm with you first, and the description of every tool
that costs credits says so. Clients use these hints to decide when to ask you.

#### Reading

Reading tools change nothing and cost no credits.

| Tool and scopes | What it does |
|---|---|
| `whoami`<br>no scope | The company, the API access and the scopes of the key.<br>API: [Retrieve the API access](/api/account/retrieve) |
| `list_templates`<br>`catalog:read` | Briefing templates of your company.<br>API: [List templates](/api/templates/list) |
| `list_styles`<br>`catalog:read` | Approved styles.<br>API: [List styles](/api/styles/list) |
| `list_brands`<br>`catalog:read` | Brands.<br>API: [List brands](/api/brands/list) |
| `list_voices`<br>`catalog:read` | Voices, for example by language.<br>API: [List voices](/api/voices/list) |
| `list_avatars`<br>`catalog:read` | Avatars.<br>API: [List avatars](/api/avatars/list) |
| `list_categories`<br>`categories:read` | The category tree.<br>API: [List categories](/api/categories/list) |
| `list_films`<br>`films:read` | Films ordered through the API.<br>API: [List films](/api/films/list) |
| `get_film`<br>`films:read` | One film with status, approval, revisions and its link in mint.<br>API: [Retrieve a film](/api/films/retrieve) |
| `get_film_progress`<br>`films:read` | The production progress of a film.<br>API: [Retrieve the progress](/api/film-progress/retrieve) |
| `list_events`<br>`events:read` | The event feed, for example since the last check.<br>API: [List events](/api/events/list) |
| `get_operation`<br>`films:read` | A long-running operation and its result.<br>API: [Retrieve an operation](/api/operations/retrieve) |
| `get_storyboard_preview`<br>`films:read`<br>`previews:read` | State of the storyboard preview and the path of its MP4.<br>API: [Retrieve a preview](/api/storyboard-previews/retrieve) |
| `list_film_feedback`<br>`feedback:read` | Feedback entries of a film.<br>API: [List feedback](/api/feedback/list) |
| `get_film_feedback`<br>`feedback:read` | One feedback entry and its state.<br>API: [Retrieve feedback](/api/feedback/retrieve) |
| `list_film_comments`<br>`comments:read` | Comments on the finished film.<br>API: [List comments](/api/comments/list) |
| `get_upload`<br>`uploads:write` | An upload: type, size and expiry.<br>API: [Retrieve an upload](/api/uploads/retrieve) |
| `get_film_download_info`<br>`films:read` | Where to download the approved film and its subtitles: revision, size, SHA-256, URLs and the link in mint. No file: download it outside the chat with [Download the film file](/api/films/download) and [Download the subtitles](/api/films/subtitles), which need `files:read`.<br>API: [Retrieve a film](/api/films/retrieve) |

#### Changing, free of credits

| Tool and scopes | What it does |
|---|---|
| `create_category`<br>`categories:write` | Creates a category or subcategory.<br>API: [Create a category](/api/categories/create) |
| `update_category`<br>`categories:write` | Renames a category or changes its external key.<br>API: [Update a category](/api/categories/update) |
| `cancel_film`<br>`films:write` | Cancels a film until the storyboard is ready. Cannot be undone; credits already used stay used.<br>API: [Cancel a film](/api/films/cancel) |
| `cancel_film_feedback`<br>`feedback:write` | Cancels a feedback entry that has not been applied yet.<br>API: [Cancel feedback](/api/feedback/cancel) |
| `create_film_comment`<br>`feedback:write` | Comments on the finished film. Changes nothing until the comments are applied.<br>API: [Create a comment](/api/comments/create) |
| `create_upload`<br>`uploads:write` | Uploads a small file (image, video, PDF, Word or PowerPoint) as base64, up to 10 MB, for briefing documents, media or comment attachments.<br>API: [Create an upload](/api/uploads/create) |

#### Costing credits

| Tool and scopes | What it does |
|---|---|
| `create_film`<br>`films:write` | Orders a film from a briefing. **Costs:** credits according to the mint price list, charged when production starts.<br>API: [Create a film](/api/films/create) |
| `request_storyboard_preview`<br>`films:read`<br>`previews:write` | Renders a preview MP4 of the storyboard. **Costs:** 100 credits per new preview; an unchanged storyboard is not charged again.<br>API: [Request a preview](/api/storyboard-previews/create) |
| `create_film_feedback`<br>`feedback:write` | Sends feedback on scenes of the storyboard; mint changes the scenes. **Costs:** credits according to the mint price list.<br>API: [Send feedback](/api/feedback/create) |
| `retry_film_feedback`<br>`feedback:write` | Sends a failed feedback entry again. **Costs:** credits according to the mint price list.<br>API: [Retry feedback](/api/feedback/retry) |
| `apply_film_comments`<br>`feedback:write`<br>`films:revise` | Applies the open comments; mint makes a new revision of the film. **Costs:** credits according to the mint price list.<br>API: [Apply comments](/api/comments/apply) |

There is no tool to approve a film. A person always approves a film in mint; after that, `get_film_download_info` shows
the link to the file.

#### Resources and prompt

| Name | Kind | Content |
|---|---|---|
| `mint://docs/llms.txt` | Resource | This documentation as `llms.txt`, so the assistant can look up details. |
| `mint://api/openapi.json` | Resource | The API contract (OpenAPI 3.1). |
| `create_film_from_script` | Prompt | Guides the assistant from a script to an order: template, style, voice or avatar, then the complete order for your confirmation, with a reminder of the costs. |

### Costs and confirmation

- Credits are taken from your company, exactly as for the same API call. Check the price in mint before you order many
  films.
- Keep the confirmation of your client switched on for changing tools, at least for `create_film`,
  `request_storyboard_preview`, `create_film_feedback`, `retry_film_feedback` and `apply_film_comments`. Do not allow
  them permanently.
- `create_film` is safe to repeat: the same order with the same `video_key` and `version` returns the same film and is
  not charged again (see [Film versions](/api/film-versions)). Without an `idempotency_key` from the assistant, the MCP
  server derives one from the order. For the other changing tools it derives one from the input and a 10-minute window,
  so an accidental double call does not run twice (see [Idempotent requests](/api/idempotent-requests)).
- With `automation: "storyboard"` (the default) mint stops after the storyboard, so you can review it before the film
  is produced.

### Security

- Never put an API key into a file you share or commit, such as `.mcp.json`, `.cursor/mcp.json` or `.vscode/mcp.json`.
  Use environment variables or the input prompt of your client. Do not paste keys into a chat with the assistant.
- Limit the key: only the scopes the assistant needs and an expiry date. Use reading scopes only if the assistant should
  not order or change anything.
- The assistant acts with the rights of the key. Text it reads, for example in documents or web pages, can try to steer
  it. Narrow scopes and the confirmation of changing tools protect you.
- If a key may have leaked, revoke it in mint under *Settings → API access* and create a new one. Every access can have
  two valid keys at the same time, so you can switch without downtime.

### Limits

- **No files through MCP.** Films, storyboard previews and subtitles are not transferred as tool content. The tools
  return their state and links. Open the film in mint, or download it with the API, for example `GET /films/{id}/file`
  (see [Downloads](/api/downloads)).
- **Small uploads only.** `create_upload` takes files up to 10 MB as base64. Upload larger files directly with the API
  (`POST /uploads`) and give the assistant the upload id.
- **No approval.** Approving a film stays with a person in mint.
- **Only API films.** The tools see the films ordered through the API, like the API itself.
- **Limits of the MCP server:** 120 calls per minute per API key, answers of the API up to 2 MB, 60 seconds per call.
  Above the call limit the server answers `429` with `Retry-After`.
- **API limits apply as well** (see [Limits](/api/rate-limits)). Producing a film takes time: let the assistant check
  the progress or the event feed every few minutes, not continuously.

```text Server URL
https://mcp.cream-ai.de/mcp
```

```http Header
Authorization: Bearer mint_sk_live_…
```

```sh Claude Code
claude mcp add --transport http mint \
  https://mcp.cream-ai.de/mcp \
  --header "Authorization: Bearer $MINT_API_KEY"
```

```text Try it
Which mint templates and voices can I use?
```

```text Order a film
Create a mint film from the script in lesson-03.md
with the template "lesson-standard", video_key
"MKT101-lesson-03" and version "1.0". Show me the
order before you send it.
```

```text Follow up
What is the state of my mint film "Lesson 3"?
Tell me when the storyboard is ready for review.
```
