Frigate-MCP

Model Context Protocol server for Frigate NVR multi-camera management, snapshots, and PTZ controls.

Dokumentasi

Frigate-MCP

CI PyPI version Smithery Python 3.10+ License: MIT

A Model Context Protocol (MCP) server, CLI, and HTTP gateway for Frigate NVR multi-camera management. Connect AI agents (such as Claude Desktop, Cursor, Antigravity, and LibreChat) directly to your home security cameras to query events, control PTZ pan/tilt/zoom, adjust image sensor settings, capture snapshots, and receive real-time MQTT alerts.


Quick Install & Run

Option 1: Smithery (Claude Desktop 1-Click Install)

Install into Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @KevinOBytes/frigate-mcp --client claude

Option 2: Run with uvx (Zero Install)

Run directly without installing via uvx:

uvx frigate-mcp serve --transport stdio

Option 3: Docker / Docker Compose

docker-compose up -d

Frigate-MCP integrates with Frigate to provide enhanced multi-camera processing capabilities via the Model Context Protocol (MCP).

It works by running as a docker container that can then access frigate services using the docker container and the frigate python library. This allows for seamless integration and management of multiple cameras within the Frigate ecosystem.

It can do things such as list available cameras, take pictures, record video clips, control camera settings, and manage multi-camera configurations.

It returns a json response for all commands, providing structured information about the status and results of the requested operations and any returns.

JSON Response Example

Basic Response

{
    "status": "success",
    "message": "Operation completed successfully",
    "data": null
}

Returning an image

{
    "status": "success",
    "message": "Image captured successfully",
    "status_code": 200,
    "data": {
        "camera_id": "camera_1",
        "image": "image_data"
    }
}

Response Status Codes

Responses include a status code indicating the result of the operation. Common status codes are:

  • 200: Success
  • 400: Bad Request
  • 401: Unauthorized
  • 404: Not Found
  • 500: Internal Server Error
  • 403: Forbidden

Start / Stop

Start Frigate-MCP

docker-compose up -d

Stop Frigate-MCP

docker-compose down

Frigate MCP Commands

Frigate-mcp supports multiple commands for its MCP server which can be used to manage and interact with the multi-camera processing capabilities.

Basic Commands

commanddescription
frigate-mcp --helpShow help information
frigate-mcp --versionShow version information
frigate-mcp quitQuit the MCP server
frigate-mcp statusShow the current status of the MCP server
frigate-mcp startStart the MCP server
frigate-mcp stopStop the MCP server
frigate-mcp restartRestart the MCP server
frigate-mcp helpShow help information

Control

commanddescription
frigate-mcp listlist available cameras and camera_id's
frigate-mcp picture <camera_id>take a picture from the specified camera
frigate-mcp clip <camera_id>take a video clip from the specified camera
frigate-mcp record <camera_id>start recording from the specified camera
frigate-mcp stop-record <camera_id>stop recording from the specified camera
frigate-mcp pan <camera_id> leftpan the specified camera to the left
frigate-mcp pan <camera_id> rightpan the specified camera to the right
frigate-mcp tilt <camera_id> uptilt the specified camera upwards
frigate-mcp tilt <camera_id> downtilt the specified camera downwards
frigate-mcp zoom <camera_id> inzoom the specified camera in
frigate-mcp zoom <camera_id> outzoom the specified camera out
frigate-mcp focus <camera_id>focus the specified camera
frigate-mcp auto-focus <camera_id>enable auto-focus for the specified camera
frigate-mcp disable-auto-focus <camera_id>disable auto-focus for the specified camera
frigate-mcp night-vision <camera_id> onenable night vision for the specified camera
frigate-mcp night-vision <camera_id> offdisable night vision for the specified camera
frigate-mcp infrared <camera_id> onenable infrared for the specified camera
frigate-mcp infrared <camera_id> offdisable infrared for the specified camera
frigate-mcp motion-detection <camera_id> onenable motion detection for the specified camera
frigate-mcp motion-detection <camera_id> offdisable motion detection for the specified camera
frigate-mcp privacy-mode <camera_id> onenable privacy mode for the specified camera
frigate-mcp privacy-mode <camera_id> offdisable privacy mode for the specified camera
frigate-mcp audio <camera_id> onenable audio for the specified camera
frigate-mcp audio <camera_id> offdisable audio for the specified camera
frigate-mcp speaker <camera_id> onenable speaker for the specified camera
frigate-mcp speaker <camera_id> offdisable speaker for the specified camera
frigate-mcp microphone <camera_id> onenable microphone for the specified camera
frigate-mcp microphone <camera_id> offdisable microphone for the specified camera
frigate-mcp speaker-volume <camera_id> set the speaker volume for the specified camera (level: 0-100)
frigate-mcp microphone-volume <camera_id> set the microphone volume for the specified camera (level: 0-100)
frigate-mcp brightness <camera_id> set the brightness for the specified camera (level: 0-100)
frigate-mcp contrast <camera_id> set the contrast for the specified camera (level: 0-100)
frigate-mcp saturation <camera_id> set the saturation for the specified camera (level: 0-100)
frigate-mcp sharpness <camera_id> set the sharpness for the specified camera (level: 0-100)
frigate-mcp white-balance <camera_id> set the white balance for the specified camera (level: 0-100)
frigate-mcp exposure <camera_id> set the exposure for the specified camera (level: 0-100)
frigate-mcp gain <camera_id> set the gain for the specified camera (level: 0-100)
frigate-mcp hue <camera_id> set the hue for the specified camera (level: 0-100)
frigate-mcp gamma <camera_id> set the gamma for the specified camera (level: 0-100)
frigate-mcp backlight-compensation <camera_id> set the backlight compensation for the specified camera (level: 0-100)
frigate-mcp noise-reduction <camera_id> set the noise reduction for the specified camera (level: 0-100)
frigate-mcp sharpness <camera_id> set the sharpness for the specified camera (level: 0-100)
frigate-mcp settings <camera_id>get the current settings for the specified camera
frigate-mcp set setting <camera_id> set the specified setting for the specified camera to the given value
frigate-mcp events [camera_id]list detected object events and alerts
frigate-mcp event-picture <event_id>retrieve snapshot image for a detected event
frigate-mcp event-clip <event_id>retrieve video clip for a detected event
frigate-mcp retain-event <event_id> [true/false]retain an event indefinitely

Development

Ensure you have Python 3.12 installed, as it is required for the development environment.

  1. Clone the repository:
git clone https://github.com/KevinOBytes/frigate-mcp.git
cd frigate-mcp
  1. Create and activate a virtual environment:
python3.12 -m venv .venv
source .venv/bin/activate
  1. Install dependencies and the package in editable mode:
pip install --no-cache-dir -r requirements.txt
pip install -e .
  1. Run tests and linting:
pytest -v
ruff check .
ruff format --check .

Running the MCP Server

Stdio Transport (Claude Desktop / Cursor / Antigravity)

Run the server communicating over standard IO:

frigate-mcp serve --transport stdio

Claude Desktop Configuration

Add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "frigate-mcp": {
      "command": "/path/to/frigate-mcp/.venv/bin/frigate-mcp",
      "args": ["serve", "--transport", "stdio"],
      "env": {
        "FRIGATE_URL": "http://localhost:5000"
      }
    }
  }
}

SSE / HTTP Transport (Docker / Network)

Run the server as a background service or container listening on port 5000:

# Direct execution
frigate-mcp serve --transport sse --host 0.0.0.0 --port 5000

# Or using Docker Compose
docker-compose up -d

HTTP Endpoints:

  • GET /sse: Server-Sent Events MCP endpoint
  • POST /messages: MCP client messages endpoint
  • GET /health: Health check endpoint
  • GET /status: Server status endpoint
  • POST /command: JSON command dispatch endpoint

State Persistence & Caching

Frigate-MCP includes a dual-tier state persistence layer:

  1. Redis: Automatically connects to the Redis service configured in docker-compose.yml (REDIS_URL).
  2. Disk Fallback: Automatically saves state to ./data/cameras_state.json (mounted as /data in Docker), ensuring settings persist across process restarts and multi-worker deployments.