Camera MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Camera MCPwhat do you see?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Camera MCP
Lightweight USB camera snapshot service. Captures fresh images from an attached USB camera and serves them via a simple HTTP API.
Core value: Every API call captures a new frame — no stale caches, no pre-recorded footage.
Quick Start
Prerequisites
Docker & Docker Compose v2
Python 3.12+ with
uv(for local development without Docker)USB camera attached to the host
Development
# Clone and enter
cd camera_mcp
# Copy environment file
cp .env.example .env
# Start with Docker
make dev
# Or run locally
uv sync --group dev
uv run uvicorn src.camera_mcp.main:app --host 0.0.0.0 --port 8579 --reloadOpen http://localhost:8579/health to verify.
Running Tests
make test # All tests
make test-unit # Unit tests only
make test-coverage # With coverage reportAll tests run without hardware — cv2.VideoCapture is mocked.
Related MCP server: OpticMCP
API
Endpoint | Method | Description |
| GET | Capture a fresh JPEG image from the first camera (index 0) |
| GET | Capture a fresh JPEG image from a specific camera |
| GET | Info for all detected cameras |
| GET | Info for a specific camera |
| GET | Service health and camera status |
Capture
# Default — first camera, 1280px max width
curl -H "Authorization: Bearer $CAMERA_AUTH_TOKEN" http://localhost:8579/capture > photo.jpg
# Custom width
curl -H "Authorization: Bearer $CAMERA_AUTH_TOKEN" "http://localhost:8579/capture?max_width=640" > photo.jpg
# Second camera (index 1)
curl -H "Authorization: Bearer $CAMERA_AUTH_TOKEN" http://localhost:8579/capture/1 > photo_cam2.jpgReturns image/jpeg on success (200), 404 if the camera doesn't exist, or JSON error (503) if camera is unavailable.
Health
curl http://localhost:8579/health{
"status": "ok",
"place": "home",
"places": ["default", "home"],
"cameras": [
{ "index": 0, "connected": true, "device": "/dev/video0" },
{ "index": 1, "connected": true, "device": "/dev/video1" }
],
"camera_count": 2,
"uptime_seconds": 1234.5,
"last_error": null
}place is the display name of this deployment's location, places all its aliases (see CAMERA_PLACES). A deployment whose names include default is the one to use when no location is specified.
Environment Variables
Variable | Default | Description |
|
| Listen address |
|
| Listen port |
|
| Default max image width (px) |
|
| JPEG quality (1-100) |
|
| Log level (DEBUG, INFO, WARNING, ERROR) |
|
| Comma-separated location names for this deployment, e.g. |
See .env.example for all options.
Architecture
Single-container stateless service:
FastAPI for the HTTP layer
OpenCV (cv2) for camera capture and image processing
No database — each request is independent
Supports multiple USB cameras — auto-detected on startup, indexed access via API
Auto-reconnects on camera disconnect
Deployment
See DEPLOYMENT.md for production deployment guide.
MCP Server
The project includes an MCP server that exposes camera tools to Claude Code. When the camera API is running, Claude can capture live images and check camera status.
Available Tools
capture_image(camera_index, max_width)— Capture a fresh JPEG image from a USB camera.camera_indexselects which camera (0-based, defaults to 0).camera_status()— Check camera health and connection status for all detected cameras. Also reports the deployment's location (e.g.Location: home (default)).
Setup
Start the camera API service:
make dev # or uv run uvicorn src.camera_mcp.main:app --host 0.0.0.0 --port 8579Open Claude Code in this project directory — the MCP server is configured via
.mcp.jsonand will be available automatically. If it doesn't exist, create it withcp .mcp.json.example .mcp.json, pointcommandat your.venv/bin/camera-mcp-mcp, and paste yourCAMERA_AUTH_TOKENfrom.env(the file is gitignored — it holds a secret).Use natural language to interact with the camera:
"can you see?" → calls
camera_status"what do you see?" → calls
capture_image()(first camera)"take a photo with the second camera" → calls
capture_image(camera_index=1)
Multiple Locations
Each deployment serves one physical location and names itself with CAMERA_PLACES (comma-separated, e.g. default,home). The name(s) are reported by /health, printed by camera_status, and advertised in the MCP server's instructions — so an agent with several camera servers registered can tell them apart.
To add a second location:
Clone this repo to the new machine and deploy as usual (Docker or bare metal).
Set its names in
.env:CAMERA_PLACES=office— orCAMERA_PLACES=default,homefor the instance that should be the fallback.Mark exactly one deployment with
default: it is what agents use when you don't name a location.
Connect its MCP server to your agent (another
.mcp.jsonentry, or the streamable-http URL in another machine's config).
Then "take a photo" hits the default location, while "what do the office cameras see?" goes to the one named office.
Standalone
Run the MCP server manually:
uv run camera-mcp-mcpTech Stack
Python 3.12, FastAPI, OpenCV, uvicorn, uv (package manager), ruff, mypy, pytest.
This server cannot be deployed
Maintenance
Related MCP Connectors
Turns a phone into a camera+Bluetooth remote so AI assistants can see and control any PC.
Provides YouCam API for AI image and video editing and generation.
- mytesla.ioOAuthio.mytesla
Control your Tesla from your AI assistant - climate, charging, access, and security.
Provides YouCam API for skin, face & body analysis, beauty/makeup try-on, and hair & beard styling.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables users to send live webcam images to Claude Desktop or other MCP clients, facilitating interaction through capturing images, screenshots, and providing a webcam view for visual input.212 npm121MIT
- AlicenseNot gradedqualityCmaintenanceProvides camera and vision tools for AI assistants to list available cameras, capture images from USB cameras, and save frames to disk for use with LLMs.4MIT
- AlicenseBqualityDmaintenanceEnables PTZ camera control with gimbal positioning, snapshots, and AI visual analysis for OBSBOT and UVC cameras. Supports autonomous scanning patterns and integrates with vision-language models for real-time camera analysis.71MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that provides LLM agents with direct access to webcam hardware for capturing high-resolution photos and recording video sequences. It enables autonomous agents to monitor environments and interact with the physical world through standard Model Context Protocol tools.3MIT