# MCP activity endpoints

MCP activity is the record of the tool calls agents make over MCP, with the
server's connection details and its bundled agent skills. These endpoints feed
the app's **Agents** page. The MCP endpoint itself is `/mcp` on the same port;
its tools are on [MCP tools](https://mirli.app/docs/mcp/index.md).

Each endpoint lists the errors it returns itself. Any endpoint can also return
the [common errors](https://mirli.app/docs/api-errors/index.md#common-errors).

## Call object

The call endpoints return this object. Calls over HTTP are recorded by the
server; calls through the stdio bridge are reported by the bridge with
[Record a call](#record-a-call) and [Finish a call](#finish-a-call).

| Field | Type | Description |
|---|---|---|
| `id` | string | The call's id |
| `ts` | string | ISO 8601 time the call started |
| `tool` | string | The tool's name |
| `status` | string | `running`, `ok` or `error` |
| `client_name`, `client_version` | string or null | The MCP client that made the call |
| `session_id` | string or null | The MCP session |
| `transport` | string | `http` or `stdio` |
| `args` | object | The arguments the tool was called with |
| `duration_ms` | integer or null | How long the call took |
| `error` | string or null | Why the call failed |
| `job_id` | string or null | The job the call started |
| `sound_ids` | string[] | The sounds the call made |
| `trace_id` | string or null | The OpenTelemetry trace id, when export is on |

## Get MCP status

`GET /api/mcp/status`

Returns the connection details, the connected clients, call totals, the
OpenTelemetry state and the bundled skills in one response. This endpoint
takes no parameters.

This request reads the MCP status:

```bash
curl http://127.0.0.1:17494/api/mcp/status
```

A successful response is `200 OK` with the status. The example is abridged:

```jsonc
{
  "endpoint": "http://127.0.0.1:17494/mcp",
  "stdio_command": "node C:\\mirli\\server\\dist\\mcp\\stdio.js",
  "server_name": "soundbox",
  "server_version": "0.6.4",
  "calls_total": 42,
  "errors_total": 1,
  "sounds_total": 17,
  "calls_24h": 6,
  "last_call_at": "2026-11-29T09:12:44.000Z",
  "active_sessions": 0
  // ...more fields
}
```

| Field | Type | Description |
|---|---|---|
| `endpoint` | string | The MCP URL, built from the request's `Host` |
| `stdio_command` | string | The command that starts this install's stdio bridge, with its absolute path |
| `server_name`, `server_version` | string | The MCP server's name and version |
| `tools` | object[] | Each tool's `name`, `title`, `description` and `calls` count. Empty when MCP failed to start |
| `clients` | object[] | One entry per client name and version: `name` (`unknown` when the client sent none), `version`, `calls`, `errors`, `sounds`, `sessions`, `first_seen`, `last_seen`, and `active` (a call in the last ten minutes) |
| `calls_total`, `errors_total`, `calls_24h` | integer | Recorded calls, failed calls, and calls in the last 24 hours |
| `sounds_total` | integer | Library sounds made over MCP |
| `last_call_at` | string or null | ISO 8601 time of the newest call |
| `active_sessions` | integer | MCP sessions with a call running now |
| `otel` | object | OpenTelemetry export: `enabled`, `installed`, `endpoint`, `source` (`env`, `settings` or `none`), `service_name` and `error` |
| `skills` | object[] | Each bundled skill's `name`, `description`, `path`, `files`, and `installed_at`: the folder it is installed in, per target |
| `skill_targets` | object[] | Each install target's `id`, `label`, `path`, and `exists` (its parent folder exists) |

This endpoint returns only the common errors.

## List calls

`GET /api/mcp/calls`

Returns recorded calls, newest first.

| Name | Type | Required | Description |
|---|---|---|---|
| `?limit` | integer | No | 1 to 1,000. Default 100 |
| `?client` | string | No | One client name |
| `?tool` | string | No | One tool name |
| `?status` | string | No | `running`, `ok` or `error` |
| `?since` | string | No | ISO 8601 time. Calls that started at or after it |

This request lists the last 20 failed calls:

```bash
curl "http://127.0.0.1:17494/api/mcp/calls?status=error&limit=20"
```

A successful response is `200 OK` with an array of
[call objects](#call-object). The example is abridged:

```jsonc
[
  {
    "id": "8c1d0f52-6a3e-4b7d-9e21-5f4a0c3b7d19",
    "ts": "2026-11-29T09:12:44.000Z",
    "tool": "soundbox.split_line",
    "status": "error",
    "error": "ModelError: Split point has to fall inside the clip."
    // ...the rest of the call object
  }
]
```

| Status | Cause |
|---|---|
| `422` | `limit` is not an integer from 1 to 1,000 |

## Record a call

`POST /api/mcp/calls`

Records a call that has started. The stdio bridge reports each call it
proxies through this endpoint, so it appears alongside HTTP calls. The call
is recorded as `running` whatever `status` says, and goes out on the
[calls feed](#follow-calls).

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | Yes | The call's id. [Finish a call](#finish-a-call) uses it |
| `ts` | string | Yes | ISO 8601 start time. `""` means now |
| `tool` | string | Yes | The tool's name |
| `transport` | string | No | `http` or `stdio`. Default `http` |
| `client_name`, `client_version`, `session_id` | string or null | No | Who made the call |
| `args` | object | No | The tool's arguments. Default `{}` |
| `status`, `duration_ms`, `error`, `job_id`, `sound_ids`, `trace_id` | As listed | No | See the [call object](#call-object) |

This request records a call from the stdio bridge:

```bash
curl -X POST "http://127.0.0.1:17494/api/mcp/calls" \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "<CALL_ID>",
    "ts": "",
    "tool": "soundbox.generate",
    "transport": "stdio",
    "args": {
      "prompt": "door slam"
    }
  }'
```

A successful response is `201 Created` with the recorded
[call object](#call-object).

This endpoint returns only the common errors.

## Finish a call

`PATCH /api/mcp/calls/<CALL_ID>`

Settles a call recorded with [Record a call](#record-a-call). Fields sent as
`null` and fields not in the table are ignored. A call that is still
`running` afterwards becomes `ok`.

| Name | Type | Required | Description |
|---|---|---|---|
| `<CALL_ID>` | string | Yes | The call's id |
| `status` | string | No | `ok` or `error` |
| `duration_ms` | integer | No | How long the call took |
| `error` | string | No | Why the call failed |
| `job_id` | string | No | The job the call started |
| `sound_ids` | string[] | No | The sounds the call made |

This request marks a call as failed:

```bash
curl -X PATCH "http://127.0.0.1:17494/api/mcp/calls/<CALL_ID>" \
  -H 'Content-Type: application/json' \
  -d '{"status": "error", "duration_ms": 812, "error": "Timed out"}'
```

A successful response is `200 OK` with the finished
[call object](#call-object).

| Status | Cause |
|---|---|
| `404` | No running call has this id: it is unknown, already finished, or was running when the server restarted |

## Follow calls

`GET /api/mcp/calls/events`

Streams calls as server-sent events. On connect, the stream sends one event
per running call. After that it sends one event when a call starts (`status`
is `running`) and one when it settles. A `: keepalive` comment goes out every
15 seconds while nothing happens. This endpoint takes no parameters.

This request follows calls as they happen:

```bash
curl -N http://127.0.0.1:17494/api/mcp/calls/events
```

A successful response is `200 OK` with `Content-Type: text/event-stream`:

```text
data: <CALL_OBJECT>

: keepalive

data: <CALL_OBJECT>
```

Each `<CALL_OBJECT>` is a [call object](#call-object) as one line of JSON.

This endpoint returns only the common errors.

## Install skills

`POST /api/mcp/skills/install`

Copies the bundled agent skills into a client's skills folder on the server's
machine. Each copy replaces any earlier one with the same name. The bundled
skills are `soundbox-sfx`, `soundbox-sound-pass` and `soundbox-voice-story`.

| Name | Type | Required | Description |
|---|---|---|---|
| `target` | string | No | `claude` (`~/.claude/skills`, the default), `cursor` (`~/.cursor/skills`), `codex` (`~/.codex/skills`) or `dir` |
| `path` | string | For `dir` | The folder to copy into. A leading `~` is the home directory |
| `skills` | string[] | No | Skill names or folder names. Default: every bundled skill |

This request installs every skill for Cursor:

```bash
curl -X POST "http://127.0.0.1:17494/api/mcp/skills/install" \
  -H 'Content-Type: application/json' \
  -d '{"target": "cursor"}'
```

A successful response is `200 OK` with the target, the folder and the skills
copied:

```json
{
  "target": "cursor",
  "dest": "C:\\Users\\x\\.cursor\\skills",
  "installed": [
    "soundbox-sfx",
    "soundbox-sound-pass",
    "soundbox-voice-story"
  ]
}
```

| Status | Cause |
|---|---|
| `400` | `target` is unknown, `dir` has no `path`, no bundled skill matches `skills`, or the copy failed |
| `403` | The server's capabilities turn `skills_install` off |
