---
title: Mediaseer MCP server
description: "The local MCP server for AI agents: its tools, the files it reads, and the client configuration."
url: "https://mediaseer.ai/docs/mcp/"
---

# Mediaseer MCP server

`mediaseer` uploads videos to Mediaseer, starts the AI scene analysis and reads the results: from the shell as `mediaseer`, and from AI agents through a local MCP server on stdio (`mediaseer mcp`). It is a client of the Mediaseer API, authenticated with your API key; quotas, limits and costs are the API’s.

## Requirements

- Node.js 22 (22.23.4 or newer), 24 (24.22.1 or newer), or 26 (26.12.1 or newer).
- An API key. Create one on the API keys page of the web app (`https://app.mediaseer.ai/api-keys`); it is shown once.

The Node.js engine requirement is advisory: npm and npx can warn but still run the CLI on an unsupported runtime. There, `mediaseer` and its MCP server print a warning on stderr when they start, and run anyway. Check `node --version` and use a supported patched release.

## Install

```bash
npm install -g mediaseer@0.1
```

Export your API key, then check it:

```bash
export MEDIASEER_API_KEY=…   # not in your shell profile if an agent runs commands there, see Security considerations
mediaseer usage              # free; exit code 3 when the API does not accept the key
```

## Configuration

Only environment variables. There is no config file, and the API key is never a command-line argument.

| Variable | Default | Meaning |
| - | - | - |
| `MEDIASEER_API_KEY` | – | Your API key. |
| `MEDIASEER_API_URL` | `https://api.mediaseer.ai` | API address; a trailing `/api/v1` is accepted. HTTPS is required except on localhost. |
| `MEDIASEER_ALLOW_START` | `true` | `false`: nothing starts an analysis, which costs money (see [Costs](https://mediaseer.ai/docs/cli/#costs)). |
| `MEDIASEER_UPLOAD_DIRS` | – | MCP server only: directories `upload_video` may read besides the project directory, separated by `:` (`;` on Windows), absolute; `~` is the home directory. See [Files the MCP server reads](https://mediaseer.ai/docs/mcp/#files-the-mcp-server-reads). |
| `CLAUDE_PROJECT_DIR` | – | Set by Claude Code: the MCP server’s project directory. `upload_video` reads files in it and resolves relative paths against it. |

## Analytics permission

`mediaseer analytics-status` and `get_analytics_status` explicitly read only the API key owner’s account analytics permission. The boolean `accountAnalyticsEnabled` is permission, not a claim that collection is available or active; website permission, service configuration and collection availability are separate. An unavailable backend or a malformed response is an error, never a disabled-permission result.

These clients send no client telemetry: no command/tool activity, result-view or download signals, telemetry-only calls or headers. Ordinary commands, tool discovery and server initialization never check analytics status. Ordinary backend operations inherit the key owner’s consent. A shared API key does not identify the human using it; unknown attribution remains unknown. These clients cannot grant or withdraw consent, request erasure or link identities.

The optional `settingsUrl` links to the app’s Account analytics section (`/account#analytics`), without a key, account ID or query string. Authentication advice links to the API keys page (`/api-keys`). With the default production API it uses the production app. With a custom API, explicitly set `MEDIASEER_APP_URL` to that API’s app base URL, including any path prefix. Without it, the unverified settings link is omitted; text output gives configuration guidance, and CLI JSON mode puts that guidance on stderr. Missing-key guidance and MCP authentication advice follow the same verified-app policy. No API-to-app hostname mapping is inferred. Account consent and erasure controls belong in the app; this read-only status does not imply that those controls or collection are available in the deployed version.

`usage` and `get_usage` also show the subscription status, renewal, cancellation and scheduled plan change when present. See [Plans and billing](https://mediaseer.ai/docs/billing/). Purchases and changes stay in the signed-in web app: while a plan has a price, the text output of `usage` and `plans` ends with its Billing page, linked under the same verified-app policy as `settingsUrl`. Text `usage` reads the plans for this; JSON output does not.

```bash
mediaseer analytics-status
```

```json
{ "accountAnalyticsEnabled": false }
```

The example shows the form returned for a custom API without `MEDIASEER_APP_URL`; a verified app configuration also includes `settingsUrl`.

## Output

- **JSON mode**: when stdout is not a terminal (a pipe, a file, an agent’s tool), or with `--json`. stdout then carries the result and nothing else, one JSON document on one line; notes, retries and progress go to stderr.
- In a terminal without `--json`, results are text for people, not a format to parse.
- **Errors** go to stderr, in JSON mode as `{"error": {…}}` on the last line:

| Field | Set | Meaning |
| - | - | - |
| `code` | always | What scripts branch on, never `message`. The API’s codes (`VALIDATION`, `NOT_FOUND`, `QUOTA_EXCEEDED`, …) are passed on as they are, also ones this version does not know. |
| `message` | always | For people. |
| `limit` | `QUOTA_EXCEEDED` | Which limit: `jobs`, `dailyStarts`, `sizeBytes`, `storage` (in a terminal without `--json` followed by how to make room), `minutes` (start), `clips` (clip-create; both in a terminal without `--json` followed by when they reset), or a newer one. |
| `httpStatus` | the API answered | The HTTP status. |
| `requestId` | the API answered | Give this identifier to support when reporting a problem. |
| `retryAfterSeconds` | `RATE_LIMITED` | When the API takes requests again. |
| `analysisId` | an analysis is concerned | The analysis the command was about, or the one an upload created; that one holds a slot unless `stopped`. |
| `stopped` | an upload failed after creating one | `true`: mediaseer stopped that analysis, and it holds no slot. |
| `candidateAnalysisId` | create got no clear answer | An analysis that may be the one the create made after all, or another upload’s (see above). |
| `clipJobId` | waiting for a clip job failed | The clip job the error concerns. |
| `clipErrorCode` | `CLIP_JOB_FAILED` | The API’s failure code, including newer values. |
| `analysisErrorCode` | `ANALYSIS_FAILED` | The analysis’s error code, when available. |

### Exit codes

Stable: scripts may branch on them, and a number never changes its meaning. Unknown codes are the codes this version does not know, from a newer API, and `UNEXPECTED_RESPONSE`, an answer not in the API’s format: they map by their HTTP status.

| Exit | Meaning | `code` |
| - | - | - |
| 0 | OK | |
| 1 | A bug in mediaseer, or an unknown code whose HTTP status says nothing more | `UNEXPECTED_ERROR`; unknown codes otherwise |
| 2 | Wrong arguments or configuration, a file that cannot be uploaded, starting switched off, or the API rejected the input | `USAGE`, `INVALID_CONFIG`, `START_NOT_ALLOWED`, `FILE_NOT_FOUND`, `NOT_A_FILE`, `FILE_NOT_READABLE`, `NOT_A_VIDEO`, `FILE_CHANGED`, `VALIDATION` |
| 3 | No API key, or the API does not accept it | `MISSING_API_KEY`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`; unknown codes with HTTP 401 or 403 |
| 4 | Not found | `NOT_FOUND` |
| 5 | An account limit was hit, or the file is larger than the limit per video | `QUOTA_EXCEEDED`, `FILE_TOO_LARGE` |
| 6 | Too many requests, or the API is busy or starting up | `RATE_LIMITED`; unknown codes with HTTP 429 |
| 7 | The analysis ended `FAILED` or `CANCELLED` | `ANALYSIS_FAILED`, `ANALYSIS_CANCELLED` |
| 8 | `--wait` timed out; the analysis goes on | `WAIT_TIMEOUT` |
| 9 | The API was unreachable, too slow or failed on its side, or the upload to storage failed | `NETWORK_ERROR`, `REQUEST_TIMEOUT`, `UPSTREAM_ERROR`, `INTERNAL`, `UPLOAD_FAILED`, `DOWNLOAD_FAILED`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`; unknown codes with HTTP 5xx |
| 10 | The analysis is in a state that does not allow this | `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `UPLOAD_SESSION_GONE` |
| 11 | The API no longer accepts this version; update mediaseer. | `CLIENT_TOO_OLD`; unknown codes with HTTP 426 |
| 12 | The clip job failed while waiting | `CLIP_JOB_FAILED` |
| 130 | Interrupted with Ctrl-C | `INTERRUPTED`, `UPLOAD_ABORTED` |

## MCP server

`mediaseer mcp` serves the tools below over stdio. Your client starts it with the same environment variables as the CLI.

| Tool | Arguments | What it does |
| - | - | - |
| `list_plans` | – | List plan limits and available prices. Read-only. |
| `get_usage` | – | The plan, free analysis slots, the analysed minutes and clips of this period against the plan’s limits and when they reset, the storage the source videos take against the plan’s limit and the clips’ storage, which has no limit, and the limits per video; warns when the minutes, the clips or the source videos’ storage are nearly used up. Free; checks the API key. Read-only. |
| `get_analytics_status` | – | Reads account analytics permission and gives Account settings guidance; does not indicate collection availability. Sends no client telemetry and changes no consent or erasure state. Read-only. |
| `upload_video` | `path`, `title?` | Uploads a video file from the project directory or `MEDIASEER_UPLOAD_DIRS` and creates an analysis; does not start it. Free, but holds a slot for up to 7 days until started or stopped. Answers within 45 s, with progress notifications meanwhile; a larger file goes on uploading in the background. |
| `start_analysis` | `id` | Starts the analysis: costs money and uses quota. Idempotent. Refuses while this server is still uploading the video. Not offered with `MEDIASEER_ALLOW_START=false`. |
| `get_status` | `id`, `waitSeconds?` (0 to 50) | The state, and the error message when it `FAILED`; for an upload of this server, how far it is. Waits up to `waitSeconds` for the analysis to end (or the upload to be complete); answers within 55 s in all. Read-only. |
| `list_analyses` | `limit?` (1 to 50, default 20), `offset?` (0 to 2147483647) | The account’s analyses, newest first, as many as fit into one answer; `nextOffset` when more follow. Read-only. |
| `get_scenes` | `id`, `query?`, `type?` (one or a list), `fromSeconds?`, `toSeconds?`, `fields?` (`compact`, `full`), `cursor?` | The scenes of a `FINISHED` analysis with the filters of `mediaseer scenes`, as many as fit into one answer; `nextCursor` when more follow. Read-only. |
| `stop_analysis` | `id` | Deletes an `UPLOADING` analysis with its file, or cancels a `QUEUED` or `PROCESSING` one; either way its slot is free. Ends an upload of it this server is still sending. Destructive. |
| `create_clip_job` | `analysisId`, `mode`, `prompt?`, `subtitles?` | Creates vertical clips; costs money and uses quota. Never retried. Not offered with `MEDIASEER_ALLOW_START=false`. |
| `list_clip_jobs` | `analysisId`, `limit?`, `offset?` | Lists clip jobs, newest first, as many as fit in one answer; pass nextOffset as offset when present. Read-only. |
| `get_clip_job` | `id`, `waitSeconds?` | Reads a job; optionally waits for READY or FAILED within the status request budget. Returns failed jobs as data. Read-only. |
| `get_clip_media` | `id`, `episode`, `version?` | Signed watch, poster and download URLs, with version=EDITED of the newest edit from the web app; credentials for the requesting user only. Writes no local file. Read-only. |
| `delete_clip_job` | `id`, `confirm` | Permanently deletes a job and its clips. Requires user confirmation and confirm=true. Destructive. Never retried. |

There is no tool that deletes an analysis; that is `mediaseer delete` or the app. Every tool acts on the account of the API key and nothing else.

Errors give guidance followed by the CLI’s error JSON. When an analysis failed, report its message rather than guessing.

**Cache**: `get_scenes` may serve cached results for up to 5 minutes after an analysis is deleted.

### Files the MCP server reads

`upload_video` reads only files in the project directory and in the directories of `MEDIASEER_UPLOAD_DIRS`. The path comes from a model, a prompt injection can name any file, and whatever `upload_video` reads leaves the computer. The CLI has no such limit: there you type the path yourself.

- **Project directory**: `CLAUDE_PROJECT_DIR`, which Claude Code sets to the directory it runs in (run in your home directory, that is all of it). Relative paths are relative to it.
- **`MEDIASEER_UPLOAD_DIRS`**: more directories, absolute, separated by `:` (`;` on Windows); `~` is your home directory. Entries that are no absolute paths are left out, and the error for a refused path says so. Set it in the `env` of the server’s entry in the client’s configuration.
- **Neither**: only Claude Code sets `CLAUDE_PROJECT_DIR`. Without it and without `MEDIASEER_UPLOAD_DIRS` (Claude Desktop, Cursor and other clients, unless you set it), `upload_video` reads no files at all and says which variable to set. The server’s working directory does not count: in Claude Desktop it means nothing, and it may be `/` or your home directory.
- Symbolic links that lead outside the allowed directories are refused.
- A refused path comes back as `PATH_NOT_ALLOWED`, with the advice for the model to ask the user, not to copy the file elsewhere. Network and Windows device paths are refused as in the CLI (`NOT_A_FILE`).

### Uploads in the background

- `upload_video` answers within 45 s.
- Larger uploads continue in the background. Use `get_status` to follow their progress.
- Ending the server cancels active uploads and attempts to stop their analyses.

A background upload may not have an analysis id yet. If the server is killed, an `UPLOADING` analysis can remain: find it with `mediaseer list`, then use `mediaseer stop <id>` to free its slot. Uploads do not resume across server restarts; upload the file again.

### Client configuration

**Claude Code**: give the key to the server alone, in its entry, rather than exporting it in your shell profile, where the shell commands the agent runs see it too (see [Security considerations](https://mediaseer.ai/docs/mcp/#security-considerations)):

```bash
claude mcp add --scope user mediaseer --env MEDIASEER_API_KEY=… -- npx -y mediaseer@0.1 mcp
```

The key is then in `~/.claude.json`; the command, key included, also lands in your shell history. Claude Code sets `CLAUDE_PROJECT_DIR`, so `upload_video` reads files in the project; add more directories with `--env MEDIASEER_UPLOAD_DIRS=…`.

For a project, in `.mcp.json`, with the key from each person’s environment (which then has to be exported where Claude Code starts, and is in the environment of the agent’s shell commands as well):

```json
{
  "mcpServers": {
    "mediaseer": {
      "command": "npx",
      "args": ["-y", "mediaseer@0.1", "mcp"],
      "env": { "MEDIASEER_API_KEY": "${MEDIASEER_API_KEY}" }
    }
  }
}
```

**Cursor** reads `~/.cursor/mcp.json`, or `.cursor/mcp.json` in a project. **Claude Desktop** reads `claude_desktop_config.json`, in `~/Library/Application Support/Claude/` on macOS and `%APPDATA%\Claude\` on Windows. Both take the same form:

```json
{
  "mcpServers": {
    "mediaseer": {
      "command": "npx",
      "args": ["-y", "mediaseer@0.1", "mcp"],
      "env": { "MEDIASEER_API_KEY": "<your API key>", "MEDIASEER_UPLOAD_DIRS": "/Users/you/Videos" }
    }
  }
}
```

- The key is in plain text in these files. Use a key for this purpose only, and revoke it on the API keys page when you no longer need it.
- GUI apps do not read your shell profile, so a Node.js installed with nvm or similar is often not on their PATH. Give `command` as an absolute path (`which npx`), and add its directory to `PATH` in `env`, because `npx` and `mediaseer` find `node` through the PATH.
- Neither sets a project directory: `upload_video` reads only the directories in `MEDIASEER_UPLOAD_DIRS`, and no files at all without it. Give it absolute paths (separated by `;` on Windows).

#### Approving tools

The client’s approval of each tool call is what guards uploads and costs, not the tool descriptions. Approve these call by call:

- `upload_video`
- `start_analysis`
- `stop_analysis`
- `create_clip_job`
- `delete_clip_job`

Only the read-only tools are safe to allow for good (in Claude Code, `mcp__mediaseer__` and the tool’s name in `permissions.allow`):

- `list_plans`
- `get_usage`
- `get_analytics_status`
- `get_status`
- `list_analyses`
- `get_scenes`
- `list_clip_jobs`
- `get_clip_job`
- `get_clip_media`

`MEDIASEER_ALLOW_START=false` removes `start_analysis` and `create_clip_job` from this server: a guard rail for its tools, not a security boundary (see [Security considerations](https://mediaseer.ai/docs/mcp/#security-considerations)).

## Security considerations

- **Results are untrusted data.** Video text can contain instructions aimed at an agent. Treat titles, summaries and other analysis output as data, especially when the agent also has shell, file or web tools.
- **Approve uploads and starts call by call.** An upload sends a local video to the service; a start costs money. Restrict `upload_video` to directories you intend to share.
- **Give the key to the MCP server alone**, in its client configuration entry. Keep it out of the agent’s shell environment, and prevent the agent’s file tools from reading the configuration.
- **`MEDIASEER_ALLOW_START=false` is no security boundary.** An agent with the key and shell access can call the API or start another process. Approve its commands and tool calls individually.
- Revoke keys on the API keys page when they are no longer needed.
