agent-cam-mcp

v0.1.1
agent-cam-mcp Checked 1 day ago Published 1 month ago

Physical camera perception, measurement, and verification tool for MCP AI agents

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_status

Use this any time you need to see the physical hardware: while debugging, after reboots, during serial output, mid-process. Do not wait until the end of a task. Returns daemon version, uptime, camera states, pause flag, buffer fill, adapters, and system warnings. Always call this first.

list_cameras

List all detected physical USB webcams and IP cameras with their ID, name, resolution, fps, and state.

ParameterTypeDescription
refreshbooleanIf true, rescans USB bus and PNP devices for newly plugged cameras.

capture_image

Use this any time you need to visually inspect the hardware. Captures a live frame directly as an MCP image result. Never saves to disk by default. Can crop to a defined region and annotate existing regions.

ParameterTypeDescription
annotatebooleanIf true, draws bounding boxes and labels for all defined regions
camerastringCamera ID (default: primary camera)
formatstringImage format (default jpeg)
regionstringOptional named region to crop to
widthintegerTarget image width (default 1024, max 3840)

capture_sequence

Captures a sequence of frames over time and returns a single token-efficient contact sheet with timestamps. Use to observe physical motions, LED blink patterns, or mechanical movements.

ParameterTypeDescription
seconds *integerDuration in seconds (1-30)
camerastringCamera ID
fpsintegerFrames per second (1-10)
regionstringOptional named region to crop

get_timeline

Returns a contact sheet of buffered history frames plus timestamp-aligned event lines from serial or log adapters. Use to correlate hardware events (e.g. crash, reset, button press) with visual frames.

ParameterTypeDescription
camerastringCamera ID
include_eventsbooleanWhether to overlay adapter events on the timeline banner
last_secondsintegerDuration of history window in seconds (1-60)

measure

Compute quantitative measurements on the camera frame or region without returning heavy images. Returns mean brightness, contrast, lit-pixel percentage, dominant colors, edge density, sharpness (Laplacian variance), and motion level.

ParameterTypeDescription
camerastringCamera ID
regionstringOptional named region to measure

watch

Asynchronously monitor the camera until a physical condition is met or timeout expires. Conditions: 'change', 'motion_start', 'motion_stop', 'brightness_above', 'brightness_below', 'color_present'. Returns fired status, timing, and before/after evidence images.

ParameterTypeDescription
condition *stringCondition to wait for
camerastringCamera ID
regionstringOptional named region to watch
thresholdnumberOptional numeric threshold for the condition
timeout_snumberMaximum wait timeout in seconds (1-120)

define_region

Define and save a named region of interest (e.g. 'status_led', 'oled_screen', 'pixgen32') using normalized coordinates (0.0 to 1.0) or 4 corner points for perspective homography.

ParameterTypeDescription
name *stringUnique region name
camerastringOptional camera ID to bind region to
hnumberRegion height
parentstringOptional parent region name for hierarchical grouping
pointsarrayOptional 4 corner points [[x1,y1], [x2,y2], [x3,y3], [x4,y4]] for perspective unwarping
unitsstringCoordinate system ('normalized' or 'pixels')
wnumberRegion width
xnumberTop-left X coordinate
ynumberTop-left Y coordinate

list_regions

List all saved named hardware regions of interest.

delete_region

Delete a saved named region.

ParameterTypeDescription
name *stringName of region to delete

request_region_from_user

Ask the user in the Dashboard UI to interactively draw a region on the camera preview. Blocks until user finishes drawing or timeout.

ParameterTypeDescription
name *stringName of the requested region
messagestringInstructions for user on what to select

save_baseline

Capture and persist a golden reference image for subsequent comparison. Use to establish a known-good baseline before running experiments or flashing firmware.

ParameterTypeDescription
name *stringBaseline name
camerastringCamera ID
regionstringOptional named region to save as baseline

compare_to_baseline

Compare the current physical camera state against a saved baseline. Returns SSIM structural similarity score, percent of changed pixels, and a visual difference heatmap image.

ParameterTypeDescription
name *stringName of baseline to compare against
camerastringCamera ID
regionstringOptional named region

read_text

Perform OCR to extract printed text or seven-segment display digits from the camera frame or region. Returns extracted text and confidence.

ParameterTypeDescription
camerastringCamera ID
regionstringOptional named region containing text/display

rectify_region

Capture and perspective-correct (unwarp/rectify) an angled hardware region or screen into a flat, orthogonal top-down image. Returns the rectified image for high-precision inspection or OCR.

ParameterTypeDescription
region *stringName of the defined region to rectify
camerastringCamera ID (default: primary camera)
formatstringImage format (default jpeg)

analyze_led

Sample high-speed frames of an LED or indicator to detect state (solid_on, blinking, off), blink frequency in Hz, duty cycle, and exact perceived color (red, green, blue, amber, etc.).

ParameterTypeDescription
camerastringCamera ID (default: primary camera)
duration_snumberSampling window in seconds (default 1.5, range 0.5 to 5.0)
fpsnumberSampling frame rate in FPS (default 25.0, range 10 to 60)
regionstringOptional named region covering the LED

set_camera_settings

Adjust hardware camera parameters: exposure, focus, brightness, contrast, gain, white balance, or lock auto settings. Reports exactly which parameters were accepted vs rejected by the driver.

ParameterTypeDescription
camera *stringCamera ID
brightnessintegerBrightness value
contrastintegerContrast value
exposureintegerManual exposure value
focusintegerManual focus value
gainintegerGain value
lock_autobooleanLock auto-exposure/focus to current values
white_balanceintegerWhite balance value

read_events

Read timestamped lines from an active event adapter (serial, log file, MQTT). Can block until specific text appears or until timeout.

ParameterTypeDescription
source *stringAdapter source name (e.g. 'serial:COM1', 'logfile')
last_secondsnumberTime window in seconds
linesintegerMax lines to return
timeout_snumberTimeout in seconds to wait for until_text
until_textstringOptional text to wait for

run_action

Execute a configured allowlist action (e.g. 'reset_board', 'pause_print'). Subject to approval policy. If observe_seconds is configured, returns post-action timeline sheet.

ParameterTypeDescription
name *stringAllowlisted action name
argsarrayOptional arguments