Observed since 20 Oct, 21:36 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Physical camera perception, measurement, and verification tool for MCP AI agents
Physical camera perception, quantitative measurement, and verification tool for MCP AI agents.
Agent Cam MCP Tool gives AI coding agents eyes on the physical world. It interfaces with USB webcams and RTSP/HTTP network camera streams, exposing them to any Model Context Protocol (MCP) compatible agent (Google Antigravity, Claude Code, OpenAI Codex, Cursor).
Agents working on embedded systems, robotics, CNC machinery, or 3D printers frequently declare builds or firmware flashes "successful" while the physical hardware remains unresponsive, stuck in a boot loop, or displaying error codes. Traditional agents rely solely on build return codes and serial logs.
Agent Cam MCP Tool allows the agent to inspect the physical hardware at any moment:
Agent Cam MCP Tool utilizes a single long-lived daemon architecture to ensure multiple agent sessions never contend for hardware access:
graph TD
Agent[AI Agent: Antigravity / Claude / Cursor] -->|MCP over stdio| Shim[agent-cam-mcp Stdio Shim]
Agent -->|MCP over HTTP/SSE| Daemon[Daemon 127.0.0.1:8765]
Shim -->|Fast Local REST / IPC| Daemon
Daemon --> CamMgr[Camera Manager]
CamMgr -->|DirectShow / V4L2 / AVFoundation| USB[USB Webcams]
CamMgr -->|RTSP / HTTP Stream| IP[IP Cameras]
CamMgr --> Buffer[RAM Ring Buffer: JPEG 4 FPS]
Daemon --> Analysis[Analysis Engine: SSIM, Metrics, Watcher]
Daemon --> Policy[Policy Engine: Rate Limits, Privacy Masks]
Daemon --> Adapters[Adapters: Serial, Logfile, MQTT]
Daemon --> WebUI[Dashboard: REST, WebSocket, MJPEG]
Operating systems restrict camera hardware to a single accessing process. If every agent session spawned an independent camera process, conflicts and device locks would occur. The Agent Cam daemon exclusively owns the hardware, while the lightweight stdio shim transparently connects to the daemon, starting it in the background if it is not already running.
measure tool provides deterministic numerical metrics without transmitting heavy image tokens.watch tool monitors physical feeds until a condition fires (change, motion_start, motion_stop, brightness_above, brightness_below, color_present) or a timeout occurs.Install via uv or pip:
# Using uv (recommended)
uv tool install agent-cam-mcp
# Or using pip
pip install agent-cam-mcp
With optional extras:
uv tool install "agent-cam-mcp[all]"
# Extras available: [serial], [mqtt], [ocr], [all]
Verify all system dependencies and cameras:
agent-cam-mcp doctor
agent-cam-mcp install --client antigravity
The installer automatically writes absolute executable paths to client configurations to prevent path resolution failures when IDEs are launched from desktop shortcuts.
Config location: ~/.gemini/antigravity-ide/mcp_config.json
{
"mcpServers": {
"agent-cam": {
"command": "D:\\Projects\\mcp-tool-development\\agent-cam-mcp-tool\\.venv\\Scripts\\agent-cam-mcp.exe",
"args": [],
"env": {},
"disabled": false
}
}
}
Run the registration command:
claude mcp add agent-cam -- "D:\path\to\agent-cam-mcp.exe"
Config location: ~/.cursor/mcp.json
{
"mcpServers": {
"agent-cam": {
"command": "D:\\path\\to\\agent-cam-mcp.exe",
"args": []
}
}
}
Config location: ~/.codex/config.toml
[mcp_servers.agent-cam]
command = "D:\\path\\to\\agent-cam-mcp.exe"
args = []
| Command | Description |
|---|---|
agent-cam-mcp | Run the stdio shim (launched by AI IDEs) |
agent-cam-mcp serve [--port 8765] [--host 127.0.0.1] | Run the daemon process in the foreground |
agent-cam-mcp ui | Ensure daemon is running and open dashboard in browser |
agent-cam-mcp status | Print daemon uptime, cameras, and connected clients |
agent-cam-mcp stop | Stop background daemon cleanly |
agent-cam-mcp doctor [--json] | Execute 11 self-diagnosis checks |
agent-cam-mcp install --client <name> [--dry-run] | Configure client (antigravity, claude-code, cursor, codex, print) |
agent-cam-mcp version | Print package version |
All tools return structured JSON text blocks alongside image content when applicable.
| Tool | Parameters | Description |
|---|---|---|
get_status | none | Daemon version, uptime, cameras, pause flag, buffer fill. Agents call this first. |
list_cameras | refresh?: bool | List physical USB and IP cameras with IDs, resolutions, and states. |
capture_image | camera?, region?, width?, annotate?, format? | Captures live image (default width 1024px, JPEG quality 80). |
capture_sequence | camera?, seconds (1-30), fps (1-10), region? | Returns a multi-frame sequence rendered into a contact sheet. |
get_timeline | last_seconds (1-60), camera?, include_events? | Contact sheet of buffered frames aligned with adapter events. |
measure | region?, camera? | Computes mean brightness, contrast, lit %, edge density, sharpness, motion. |
watch | region?, condition, threshold?, timeout_s (1-120) | Asynchronously waits for visual condition with before/after evidence. |
define_region | name, x, y, w, h, camera?, units? | Saves named region of interest using normalized or pixel coordinates. |
list_regions | none | Lists all defined named regions. |
delete_region | name | Deletes a defined region. |
request_region_from_user | name, message | Prompts user on the dashboard to draw a region interactively. |
save_baseline | name, region?, camera? | Persists a golden reference image in the data directory. |
compare_to_baseline | name, region?, camera? | Computes SSIM score, changed pixel %, and diff heatmap. |
read_text | region?, camera? | Extracts text and confidence using OCR (optional extra). |
set_camera_settings | camera, exposure?, focus?, brightness?, lock_auto? | Negotiates driver settings and reports accepted vs ignored values. |
read_events | source, last_seconds?, lines?, until_text?, timeout_s? | Reads timestamped events from serial ports, logfiles, or MQTT. |
run_action | name, args? | Executes allowlisted system commands with optional timeline observation. |
Add the following verification policy to your project instructions (AGENTS.md, GEMINI.md, or CLAUDE.md):
# Physical Verification Policy
Never report physical task completion or hardware success without verification:
1. Call `get_status` to ensure camera streams are active.
2. Call `capture_image` or `measure` to verify physical state (LEDs, displays, moving components).
3. If checking state changes, use `watch` or `compare_to_baseline`.
4. Quote exact observed values in your response (e.g. "Status LED brightness rose from 12.0 to 184.5").
5. Never assume success based solely on compiler output or flash utility logs.
Measured on a standard workstation (Python 3.11, Windows 11):
| Operation | Measured Latency | Specification Target | Status |
|---|---|---|---|
measure (1080p frame) | 43.47 ms | < 100 ms | PASS |
capture_image (1024px JPEG, warm) | 3.23 ms median | < 250 ms | PASS |
capture_image (95th percentile) | 4.11 ms | < 250 ms | PASS |
| Buffer RAM consumption (30s @ 4 fps) | < 15.0 MB | < 300 MB cap | PASS |
| Daemon startup health latency | 0.85 s | < 3.0 s | PASS |
127.0.0.1. Non-localhost binding requires explicit flags and prints warnings.Host and Origin headers prevents cross-site scripting and DNS rebinding attacks.run_action tool only runs commands defined in config.json. Subprocesses execute argv lists directly (shell=False).paused_by_user status.| Symptom | Cause | Solution |
|---|---|---|
| Black image returned | Privacy shutter closed or inadequate lighting | Remove lens cover; verify room illumination. |
camera_busy error | Another application holds camera lock | Close video meeting software, browser tabs, or other capture tools. |
| Permission denied | OS camera privacy settings block access | Enable camera access in Windows Settings > Privacy > Camera or macOS System Settings. |
| Tools not showing in IDE | IDE has not reloaded MCP configuration | Restart the IDE completely to reload mcp_config.json. |
| Port 8765 occupied | Previous process lingering | Run agent-cam-mcp stop or check running processes. |
| High CPU usage | Full resolution MJPEG streaming | The dashboard automatically downscales preview streams to 720p. |
Released under the MIT License. Copyright (c) 2026 SK Raihan.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.1 | 4 Oct 2026 | 19 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 21:36 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:1ddf9854654244ae0f5db0130e84790baceeeb08155cdf8efe2e490519324010