MCP tool schemas
Every tool rekkefly mcp offers, with its arguments, as the server reports
them in tools/list. Unknown arguments are rejected, and a tool that fails
returns isError: true with the reason. How to connect a client, and an
example session: AI agents (MCP).
| Tool | What it does | Read-only |
|---|---|---|
list_cameras | List cameras | Yes |
list_configs | List rig configs | Yes |
get_config | Read a config | Yes |
update_config | Change a config | No |
start_rig | Start a rig | No |
launch_rigs | Start every rig in a manifest | No |
rig_status | Rig status and live angles | Yes |
measure | Measure a rig for a while | Yes |
stop_rig | Stop a rig | No |
record | Start or stop recording | No |
save_background | Save the background | No |
snapshot | Look at the tracking | Yes |
track_video | Track a video file | No |
clip_video | Cut a video | No |
benchmark | Measure tracking speed | Yes |
list_cameras
Cameras this computer can open, with the numbers to use as device.
No arguments.
list_configs
Every rig config (.toml) in the config folder with its camera or video, outputs and whether it is running, plus rig manifests (rigs.toml).
No arguments.
get_config
A rig config as JSON (every field) and as its commented TOML file, which explains each setting.
| Argument | Type | Required | Meaning |
|---|---|---|---|
config | string | Yes | A config name in the config folder (camera-a, bogong-moth) or a path to a .toml file. |
update_config
Change fields of a rig config and save it (comments in the file are kept). changes is a JSON merge patch on the get_config JSON, for example {“tracking”: {“left”: {“spike_width_deg”: 6}}} or {“head”: {“x”: 320, “y”: 170}}. Invalid values are rejected and nothing is written. A rig running this config picks up marker and detector changes at once; source and output changes need a restart.
| Argument | Type | Required | Meaning |
|---|---|---|---|
changes | object | Yes | The fields to change, nested as in get_config. |
config | string | Yes | A config name in the config folder (camera-a, bogong-moth) or a path to a .toml file. |
create | boolean | Create the config from the defaults if it does not exist (default false). |
start_rig
Start tracking headless with a config and publish its outputs (Kinefly ZMQ, UDP). Give a camera device, a video file or demo to override the config’s source for this run only; the other overrides apply to this run only too. Returns the rig’s status once it shows its first frame (or fails).
| Argument | Type | Required | Meaning |
|---|---|---|---|
config | string | A config name or path. Default: the next free rig config (camera-a, camera-b, …). | |
demo | boolean | Track the simulated fly for this run. | |
device | string | Camera for this run: auto, a number from list_cameras, a device path or part of the name. | |
fast | boolean | With a video: as fast as possible instead of at its frame rate. | |
frames | integer, ≥ 0 | Stop after this many frames. | |
label | string | Label (instance name) for this run; also the rig’s id here. | |
loop | boolean | With a video: play it in a loop. | |
record | boolean | Record video from the start. | |
udp_port | integer, ≥ 0 | Send UDP measurements from this local port for this run. | |
udp_target | string | Send UDP measurements to this IP:port for this run. | |
video | string | Track this video file for this run (AVI natively; other formats need FFmpeg). Uses the video’s own markers if it has them. | |
wait_seconds | number, ≥ 0 | How long to wait for the first frame (default 5). | |
zmq_port | integer, ≥ 0 | Publish Kinefly ZMQ on this TCP port for this run. |
launch_rigs
Start every enabled rig in a rig manifest (rigs.toml): each with its own label, camera or video and ports. All or none: if one cannot start, the others are stopped again.
| Argument | Type | Required | Meaning |
|---|---|---|---|
demo | boolean | Use the simulated fly for every rig (to test ports and labels). | |
frames | integer, ≥ 0 | Stop each rig after this many frames. | |
manifest | string | Manifest name or path (default rigs). | |
record | boolean | Record every rig. |
rig_status
Status of one running rig (or all): frames, frame rate, tracking time, the latest wing angles in degrees (left, right, L−R, head, abdomen), recording and outputs.
| Argument | Type | Required | Meaning |
|---|---|---|---|
rig | string | A running rig’s label, as rig_status lists it. |
measure
Collect every frame of a running rig for some seconds and summarise each angle in degrees (frames measured, mean, spread, minimum, maximum), for example the mean L−R of a trial. skipped_frames counts gaps in the camera’s frame numbers: exposures the camera dropped, or that could not be delivered. Optionally writes every frame to a CSV. Blocks for seconds.
| Argument | Type | Required | Meaning |
|---|---|---|---|
csv | string | Also write every frame here (degrees). | |
rig | string | Yes | A running rig’s label, as rig_status lists it. |
seconds | number, ≥ 0 | How long to measure (default 5, at most 600). |
stop_rig
Stop a rig (or every rig if none is named), finishing any recording, and return its final status.
| Argument | Type | Required | Meaning |
|---|---|---|---|
rig | string | A running rig’s label, as rig_status lists it. |
record
Start or stop recording a running rig’s camera to its recording folder (MJPEG AVI by default).
| Argument | Type | Required | Meaning |
|---|---|---|---|
enabled | boolean | Yes | true starts, false stops. |
rig | string | Yes | A running rig’s label, as rig_status lists it. |
save_background
Save the rig’s next frame as its background image, for background subtraction. Capture an empty scene first.
| Argument | Type | Required | Meaning |
|---|---|---|---|
rig | string | Yes | A running rig’s label, as rig_status lists it. |
snapshot
An image of a frame with the tracking drawn on it (body axis, sectors, detected edges) and its angles. Use rig for the latest live frame, or video (with frame and optionally config) for any frame of a file. Check this after moving markers.
| Argument | Type | Required | Meaning |
|---|---|---|---|
config | string | With video: the config whose markers to use (default: the video’s own, or the defaults). | |
frame | integer, ≥ 0 | With video: the frame number (default 0). | |
rig | string | A running rig’s label, as rig_status lists it. | |
video | string | A video file, instead of a running rig. | |
width | integer, ≥ 0 | Image width in pixels (default 640). |
track_video
Track every frame of a video as fast as possible and summarise it: frames per second, tracking time, and mean, spread and range of each angle. Optionally writes a CSV (one row per frame) and the full measurements as JSON lines.
| Argument | Type | Required | Meaning |
|---|---|---|---|
config | string | Config whose markers and settings to use (default: the video’s own markers, or the defaults). | |
csv | string | Write per-frame angles here. | |
frames | integer, ≥ 0 | Stop after this many frames. | |
jsonl | string | Write full measurements here. | |
method | string: "robust", "classic" | Override the wing detector: robust (ignores legs and antennae) or classic (Kinefly’s strongest edge). | |
video | string | Yes | The video file. |
video_markers | boolean | Use the video’s own markers (a .toml beside it) even when a config is given. |
clip_video
Cut part of a video into a new, usually much smaller AVI. Never overwrites.
| Argument | Type | Required | Meaning |
|---|---|---|---|
duration | number, ≥ 0 | Seconds to keep (default: to the end). | |
every | integer, ≥ 0 | Keep every Nth frame. | |
format | string: "mjpeg", "png", "raw" | mjpeg (small, default), png (lossless) or raw. | |
input | string | Yes | The video to cut (AVI natively; other formats need FFmpeg). |
output | string | Yes | The new AVI file. |
quality | integer, ≥ 0 | MJPEG quality 1–100 (default 90). | |
start | number, ≥ 0 | Seconds to skip. |
benchmark
Tracking time per frame for a config on a synthetic frame (no camera needed).
| Argument | Type | Required | Meaning |
|---|---|---|---|
config | string | Config to measure (default: the defaults, 640×480). | |
frames | integer, ≥ 0 | Frames to time (default 2000). |