capture_helper.mcp module

Capture Helper: Model Context Protocol (MCP) surface.

A thin adapter that exposes the FastAPI app from capture_helper.api as MCP tools, so any MCP-aware host (an agent runtime, an IDE integration, a custom shell) can call the camera/microphone capture layer as first-class tools: device enumeration and selection, one-shot camera/mic capture, live preview (JPEG/MJPEG/mic level), and the scene configurator (save/load/ auto-populate). Uses fastapi-mcp (https://github.com/tadata-org/fastapi_mcp): one wrapper publishes the whole existing HTTP surface, so the routes are never duplicated.

Caveat for MCP hosts: several tools here (capture_camera, capture_mic, preview_camera_jpg, preview_camera_mjpeg, preview_mic_level) open a REAL local camera or microphone device on the machine running this server. An agent calling them will trigger an actual hardware capture, not a simulation — treat them with the same care as any other tool that touches physical I/O.

Install the extra to pull in fastapi-mcp:

pip install "capture-helper[mcp]"

Then run the server (HTTP API + MCP endpoint at /mcp):

capture-helper-mcp                 # console entry point
python -m capture_helper.mcp       # equivalent

Author

Warith Harchaoui, Ph.D. — https://linkedin.com/in/warith-harchaoui/

capture_helper.mcp.main()[source]

Console entry point (capture-helper-mcp): serve the API + MCP endpoint.

Boots the FastAPI app (now serving both the plain HTTP routes and the /mcp MCP endpoint) with uvicorn in a single worker. Local-first: binds to loopback by default (override with CAPTURE_HELPER_HOST / CAPTURE_HELPER_PORT).

Return type:

None