---
url: https://docs.ffmate.io/docs/mcp.md
description: >-
  The FFmate MCP server lets AI assistants and agents create and follow FFmpeg
  tasks and manage presets, watchfolders and webhooks, over stdio or HTTP.
---

# MCP Server

The **MCP server** gives AI agents direct access to everything FFmate does. With 35 tools covering the full FFmate API, an agent can create, follow, cancel and restart tasks, submit batches, manage presets, watchfolders and webhooks, and see which FFmate instances are in a cluster.

AI agents and assistants connect in one of three ways:

* **MCP bundle** – The easiest way to set up the FFmate MCP server in Claude Desktop. Download the [MCP bundle](#installing-the-mcp-bundle), enter the address of the FFmate instance, and setup is done.
* **stdio** – All the major AI agents, such as Claude Code, ChatGPT Desktop and Grok Build, work with stdio. They start the MCP server themselves and only need [a few lines of configuration](#connecting-with-stdio).
* **HTTP** – If an AI agent or assistant doesn't support stdio, it can connect to the MCP server [over HTTP](#connecting-over-http).

The MCP server is built into FFmate and starts with the `ffmate mcp` command. It doesn't run tasks itself. It passes every request on to the REST API of a running FFmate instance.

The MCP server runs with one of two [commands](/docs/flags.md#mcp-command):

| Command | How the AI application connects | For example |
| --- | --- | --- |
| `ffmate mcp stdio` | The AI application starts the MCP server itself, on the same computer. | A desktop application such as Claude Desktop |
| `ffmate mcp http` | The MCP server keeps running, and AI applications connect to `http://127.0.0.1:3001/mcp`. | An agent that connects over HTTP |

The MCP server uses the same credentials as the FFmate instance: the username and password set with [`--basic-auth`](/docs/flags.md#basic-auth), or an [API key](/docs/api-keys.md). For example, an assistant that only reports on the queue gets an API key with `read` access. It can list tasks but not create or delete them.

In a [cluster](/docs/clustering.md), the MCP server only needs to connect to one FFmate instance. As all FFmate instances in the cluster share one queue, an AI agent sees every task, and a task it creates can run on any of them.

::: info Note
An AI agent with `write` access can create tasks, presets and watchfolders, and these can run commands on the computer FFmate runs on. Only give `write` access to AI agents that are allowed to do that.
:::

## Installing the MCP Bundle

Every FFmate release has an MCP bundle for each operating system. An MCP bundle is a `.mcpb` file that contains FFmate and the stdio configuration. AI agents that support MCP bundles, like Claude Desktop, are set up in one step, without a configuration file. Below are the links to the `.mcpb` files of the latest release:

* [macOS – Apple Silicon (arm64)](https://github.com/welovemedia/ffmate/releases/latest/download/ffmate_Darwin_arm64.mcpb)
* [macOS – Intel (x86_64)](https://github.com/welovemedia/ffmate/releases/latest/download/ffmate_Darwin_x86_64.mcpb)
* [Windows – AMD64](https://github.com/welovemedia/ffmate/releases/latest/download/ffmate_Windows_x86_64.mcpb)
* [Windows – ARM64](https://github.com/welovemedia/ffmate/releases/latest/download/ffmate_Windows_arm64.mcpb)
* [Linux – ARM64](https://github.com/welovemedia/ffmate/releases/latest/download/ffmate_Linux_arm64.mcpb)
* [Linux – x86_64](https://github.com/welovemedia/ffmate/releases/latest/download/ffmate_Linux_x86_64.mcpb)

The MCP bundle has two settings:

* **ffmate server** – The URL of the FFmate instance. Default: `http://localhost:3000`.
* **Credentials** – Only for an FFmate instance that runs with `--basic-auth`: either `username:password` or an API key.

::: info Note
The MCP bundle doesn't start FFmate. Start an FFmate instance first, and enter its address in **ffmate server**.
:::

## Connecting with stdio

AI agents like ChatGPT Desktop, Grok Build, Claude Code and Antigravity connect with a configuration like the one below. Where the configuration goes, and in which format, depends on the AI agent:

```json
{
  "mcpServers": {
    "ffmate": {
      "command": "ffmate",
      "args": [
        "mcp",
        "stdio",
        "--server=http://localhost:3000",
        "--basic-auth=ffm_f2paiZBrDmnXE3TOTSNMatx1nvdxglc5DiNGGuWXf7A"
      ]
    }
  }
}
```

`command` is the path to the `ffmate` binary. `args` starts the MCP server with `mcp stdio` and two flags:

* **`--server`** *\[mandatory]* – The URL of the FFmate instance, for example `--server=http://localhost:3000`.
* **`--basic-auth`** *\[optional]* – Only for an FFmate instance that runs with `--basic-auth`. Either `username:password` or an API key.

## Connecting over HTTP

To run the FFmate MCP server for an AI application or agent that connects over HTTP, start it with `ffmate mcp http`:

```sh
ffmate mcp http --server=http://localhost:3000
```

The MCP server listens on `http://127.0.0.1:3001/mcp`.

The `ffmate mcp http` command has three flags:

* **`--server`** *\[mandatory]* – The URL of the FFmate instance, starting with `http://` or `https://`.
* **`--host`** *\[optional]* – The network interface the MCP server listens on. Default: `127.0.0.1`. Only AI applications on the same computer can connect.
* **`--port`** *\[optional]* – The port the MCP server listens on. Default: `3001`.

### Sending Requests over HTTP

The MCP server doesn't store any credentials. If the FFmate instance runs with `--basic-auth`, every request an AI agent sends to the MCP server must include credentials, and the FFmate instance checks them. The AI agent can either send basic auth in the `Authorization` header or an API key in the `X-API-Key` header. If the AI agent only supports bearer tokens, it can send the API key as `Authorization: Bearer ffm_f2paiZBrDmnXE3TOTSNMatx1nvdxglc5DiNGGuWXf7A`, and the MCP server passes it on to the FFmate instance as an API key.

To call a tool, send a `POST` request to `/mcp`:

```sh
curl -X POST 'http://127.0.0.1:3001/mcp' \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json, text/event-stream' \
     -H 'X-API-Key: ffm_f2paiZBrDmnXE3TOTSNMatx1nvdxglc5DiNGGuWXf7A' \
     -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "getVersion", "arguments": {}}}'
```

The MCP server returns the result of the tool as an event:

```plain
event: message
data: {"jsonrpc":"2.0","id":1,"result":{"content":[{"type":"text","text":"{\"version\":\"2.2.0\"}"}]}}
```

::: danger Anyone who can reach the MCP server can use the FFmate instance
The MCP server doesn't check credentials itself. If the FFmate instance runs without `--basic-auth`, everyone who can reach the MCP server can create tasks. Anyone who can create a task, preset or watchfolder can run commands on the computer FFmate runs on. Only set `--host` to another address than `127.0.0.1` when the FFmate instance runs with `--basic-auth`.
:::

## Tools

The MCP server has one tool for each endpoint in the [Swagger UI](/docs/swagger.md):

| Area | Tools |
| --- | --- |
| [Tasks](/docs/tasks.md) | `createTask`, `getTask`, `listTasks`, `cancelTask`, `restartTask`, `deleteTask` |
| [Batches](/docs/tasks.md#submitting-multiple-tasks-as-a-batch) | `createBatch`, `getBatch` |
| [Presets](/docs/presets.md) | `createPreset`, `getPreset`, `listPresets`, `updatePreset`, `deletePreset` |
| [Watchfolders](/docs/watchfolder.md) | `createWatchfolder`, `getWatchfolder`, `listWatchfolders`, `updateWatchfolder`, `deleteWatchfolder` |
| [Webhooks](/docs/webhooks.md) | `createWebhook`, `getWebhook`, `listWebhooks`, `updateWebhook`, `deleteWebhook`, `listWebhookExecutions` |
| [API keys](/docs/api-keys.md) | `createAPIKey`, `getAPIKey`, `listAPIKeys`, `rotateAPIKey`, `deleteAPIKey` |
| [FFmate instances](/docs/clustering.md) | `listClients` |
| Settings | `getSettings`, `saveSettings` |
| [Debug](/docs/debugging.md#setting-debug-from-the-api) | `setDebugNamespace`, `disableDebug` |
| Version | `getVersion` |

Tools take the same input as their endpoints. Values from the path and the query string of an endpoint are arguments with the same name, for example `uuid`, `page`, `perPage` and `status`. The request body goes into the `body` argument. A `createTask` call with a `body`:

```json
{
  "name": "createTask",
  "arguments": {
    "body": {
      "name": "Convert interview_cam_a to ProRes",
      "command": "-y -i ${INPUT_FILE} -c:v prores_ks -profile:v 3 ${OUTPUT_FILE}",
      "inputFile": "/volumes/ingest/interview_cam_a.mov",
      "outputFile": "/volumes/export/interview_cam_a_prores.mov"
    }
  }
}
```

Tools return the same JSON as their endpoints. A tool whose endpoint returns no body, for example `deleteTask`, returns `success (status 204)`.

::: info Note

* If FFmate rejects a request, the tool returns an error that starts with `ffmate responded with status`, for example `ffmate responded with status 401` when the credentials are missing.
* An API key with `read` access gets `ffmate responded with status 403` from every tool that creates, changes or deletes something.
* The API key tools only work with basic auth.
* If the MCP server can't reach the FFmate instance, the error starts with `failed to reach ffmate`.
  :::

## Following Tasks

AI agents and assistants have two ways to follow a task after creating it:

* **Calling `getTask`** – The AI agent calls `getTask` with the task's `uuid`, or `getBatch` for a batch, to see how far it is. FFmate doesn't set how often. The AI agent decides when to call the tool again, for example when it is asked for an update.
* **MCP tasks** – AI agents that support the [MCP tasks extension](https://tasks.extensions.modelcontextprotocol.io/specification/2026-07-28/tasks) get progress updates automatically for `createTask`, `restartTask` and `createBatch`. The AI application asks the MCP server for the status with the MCP method `tasks/get`, and the MCP server looks it up in FFmate.

The status of the MCP task follows the status of the task:

| Task status | MCP task status | Status message |
| --- | --- | --- |
| `QUEUED`, `PRE_PROCESSING`, `POST_PROCESSING` | `working` | The task status, e.g. `QUEUED` |
| `RUNNING` | `working` | The progress, e.g. `RUNNING 42%` |
| `DONE_SUCCESSFUL` | `completed` | `DONE_SUCCESSFUL` |
| `DONE_ERROR` | `completed` | `DONE_ERROR:` and the task's `error` |
| `DONE_CANCELED` | `cancelled` | `DONE_CANCELED` |

A `completed` MCP task holds the finished task as its result. For a task that ended as `DONE_ERROR`, the result is marked as an error.

For a [batch](/docs/tasks.md#submitting-multiple-tasks-as-a-batch), the ID of the MCP task is `batch:` followed by the batch's `uuid`. The MCP task status stays `working` until every task in the batch is done, with a status message such as `50%: 1/2 tasks done, 1 running, 0 queued`. Once every task is done, the MCP task returns the batch and all its tasks.

### Canceling an MCP Task

Canceling the MCP task cancels the task. For a batch, it cancels every task that isn't done yet.

## Debugging the MCP Server

To log every tool call the MCP server passes on to the FFmate instance, start it with `--debug="*:mcp"`:

```sh
ffmate mcp http --server=http://localhost:3000 --debug="*:mcp"
```

For details, see [Debugging](/docs/debugging.md).
