Token导航 LogoToken导航TokenDH.com
Frigate MCP logo
AI代理stdio官方级别未说明来源级核验

Frigate MCP

MCP Server

一个为Frigate NVR设计的模型上下文协议(MCP)服务器,使AI助手能够与Frigate安全摄像头系统交互。

工具数

7

提示词数

0

GitHub Stars

1

资源数

0
PythonClaudeAI代理Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

dedsxc

提供方

dedsxc

最后核验

2026/5/17 20:19

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python -m venv .venv

详细介绍

护卫舰MCP服务器

A. 模型上下文协议(MCP) 服务器 护卫舰NVR,使AI助手能够与您的护卫舰安全摄像头系统进行交互。

](https://www.python.org/downloads/) ![License](LICENSE)

🌟 特性

  • 相机管理:列出并监控所有配置的摄像头
  • 事件检测:通过按相机、对象类型和时间进行过滤来查询检测事件
  • 实时快照:获取当前或历史相机快照
  • 录音:访问录制摘要和片段
  • 系统统计信息:监控护卫舰性能、探测器速度和相机FPS
  • 配置:检索完整的护卫舰配置

📋 先决条件

  • Python 3.10或更高版本
  • 跑步 护卫舰NVR 例子
  • 访问Frigate HTTP API

🚀 安装

1.克隆存储库

git clone https://github.com/yourusername/frigate-mcp.git
cd frigate-mcp

2.创建虚拟环境

python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

3.安装依赖项

pip install -e .

4.配置环境

创建 .env 项目根目录中的文件:

# Required: URL of your Frigate instance
FRIGATE_FRIGATE_URL=http://localhost:5000

# Optional: API key if authentication is required
# FRIGATE_API_KEY=your_secret_key_here

# Optional: HTTP timeout in seconds (default: 30)
# FRIGATE_TIMEOUT=30

🔧 配置

服务器使用环境变量进行配置。您可以在以下位置设置它们:

  1. .env 文件 (建议开发)
  2. 环境变量 (推荐用于生产)

配置选项

变量描述默认值必填
FRIGATE_FRIGATE_URL护卫舰实例的基本URLhttp://localhost:5000没有
FRIGATE_API_KEY用于身份验证的API密钥
FRIGATE_TIMEOUTHTTP请求超时(秒)30没有
FRIGATE_SERVER_HOSTSSE/HTTP模式的服务器主机0.0.0.0没有
FRIGATE_SERVER_PORTSSE/HTTP模式的服务器端口8000没有

示例配置

本地护卫舰实例:

FRIGATE_FRIGATE_URL=http://localhost:5000

带身份验证的远程护卫舰:

FRIGATE_FRIGATE_URL=http://192.168.1.100:5000
FRIGATE_API_KEY=your_secret_key
FRIGATE_TIMEOUT=60

🎯 用法

服务器支持三种操作模式:

1.STDIO模式(默认)

对于与Claude Desktop等MCP客户端的直接集成:

python -m frigate_mcp.server
# or
frigate-mcp

2.SSE模式(服务器发送事件)

对于具有实时更新的基于web的客户端:

frigate-mcp-sse

服务器将在以下时间启动 http://localhost:8000/sse (可通过环境变量配置)。

特征:

  • 实时事件流
  • 基于HTTP的类似WebSocket的体验
  • 易于在浏览器中调试的开发工具
  • 与web应用程序兼容

3.HTTP模式(REST API)

对于生产部署和API访问:

STDIO模式 (适用于MCP客户):

python -m frigate_mcp.server

SSE模式 (适用于web客户端):

frigate-mcp-sse

HTTP模式 (适用于REST API):

frigate-mcp-http

与MCP客户端集成

克劳德桌面(STDIO模式)

测试连接

运行附带的测试脚本以验证您的护卫舰连接:

python test_connection.py

预期产量:

============================================================
Frigate MCP Server - Connection Test
============================================================

🔧 Frigate Configuration:
   URL: http://localhost:5000
   API URL: http://localhost:5000/api
   Timeout: 30s

📹 Testing /api/config (cameras)...
   ✅ Found 1 camera(s)
      - front_door: enabled

📊 Testing /api/stats...
   ✅ Frigate version: 0.16.3
   ✅ Detectors: ['coral']
   ✅ Active cameras: ['front_door']
...

运行MCP服务器

在stdio模式下启动服务器(适用于MCP客户端):

python -m frigate_mcp.server

克劳德桌面(STDIO模式)

添加到您的MCP客户端配置中(例如,Claude Desktop config.json):

{
  "mcpServers": {
    "frigate": {
      "command": "/path/to/frigate-mcp/.venv/bin/python",
      "args": ["-m", "frigate_mcp.server"],
      "env": {
        "FRIGATE_FRIGATE_URL": "http://localhost:5000"
      }
    }
  }
}

Web客户端(SSE模式)

连接到SSE端点以进行实时更新:

const eventSource = new EventSource('http://localhost:8000/sse');

eventSource.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log('Received:', data);
};

REST API(HTTP模式)

发出标准HTTP请求:

# Get cameras
curl http://localhost:8000/tools/get_cameras

# Get events
curl http://localhost:8000/tools/get_events?limit=5

# Get stats
curl http://localhost:8000/tools/get_stats

或者使用任何HTTP客户端:

import requests

response = requests.post(
    'http://localhost:8000/tools/get_events',
    json={'camera': 'front_door', 'limit': 10}
)
print(response.json())   "frigate": {
      "command": "/path/to/frigate-mcp/.venv/bin/python",
      "args": ["-m", "frigate_mcp.server"],
      "env": {
        "FRIGATE_FRIGATE_URL": "http://localhost:5000"
      }
    }
  }
}

🛠️ 可用工具

服务器提供7个MCP工具用于与护卫舰交互:

1. get_cameras()

列出所有已配置的摄像头及其状态和属性。

退货:

[
  {
    "name": "front_door",
    "enabled": true,
    "width": 1920,
    "height": 1080,
    "fps": 5
  }
]

2. get_events(camera, label, limit)

使用可选筛选获取最近的检测事件。

参数:

  • camera (可选):按相机名称过滤
  • label (可选):按对象类型筛选(person, car, dog等等)
  • limit (默认值:10):要返回的最大事件数(1-100)

例子:

get_events(camera="front_door", label="person", limit=5)

退货:

[
  {
    "id": "1234567890.123456-abcdef",
    "camera": "front_door",
    "label": "person",
    "start_time": 1704067200.5,
    "end_time": 1704067205.8,
    "has_clip": true,
    "has_snapshot": true,
    "zones": ["entrance"],
    "thumbnail": "http://localhost:5000/api/events/1234.../thumbnail.jpg"
  }
]

3. get_stats()

获取护卫舰系统统计数据和性能指标。

退货:

{
  "service": {
    "uptime": 86400,
    "version": "0.16.3",
    "storage": {...}
  },
  "detectors": {
    "coral": {
      "inference_speed": 8.5,
      "detection_start": 1704067200.0
    }
  },
  "cameras": {
    "front_door": {
      "camera_fps": 5.0,
      "process_fps": 5.0,
      "detection_fps": 1.2
    }
  }
}

4. get_event_details(event_id)

获取有关特定事件的全面详细信息。

参数:

  • event_id:唯一事件标识符

退货:

{
  "id": "1234567890.123456-abcdef",
  "camera": "front_door",
  "label": "person",
  "start_time": 1704067200.5,
  "end_time": 1704067205.8,
  "duration": 5.3,
  "score": 0.87,
  "zones": ["entrance"],
  "has_clip": true,
  "has_snapshot": true,
  "media": {
    "thumbnail": "http://localhost:5000/api/events/.../thumbnail.jpg",
    "snapshot": "http://localhost:5000/api/events/.../snapshot.jpg",
    "clip": "http://localhost:5000/api/events/.../clip.mp4"
  }
}

5. get_snapshot(camera, timestamp)

从特定相机获取快照URL。

参数:

  • camera:相机名称
  • timestamp (可选):历史快照的Unix时间戳

退货:

{
  "camera": "front_door",
  "timestamp": "latest",
  "url": "http://localhost:5000/api/front_door/latest.jpg",
  "description": "Snapshot from front_door (latest)"
}

6. get_recordings(camera, date)

获取特定相机和日期的录制信息。

参数:

  • camera:相机名称
  • date (可选):日期 YYYY-MM-DD 格式(默认为今天)

退货:

{
  "camera": "front_door",
  "date": "2024-01-01",
  "recordings_count": 24,
  "total_duration": 86400,
  "recordings": [
    {
      "day": "2024-01-01",
      "hour": "10",
      "duration": 3600,
      "events": 5
    }
  ]
}

7. get_config()

获取护卫舰配置摘要。

退货:

{
  "cameras": ["front_door", "backyard", "garage"],
  "detectors": ["coral"],
  "mqtt": {
    "enabled": true,
    "host": "localhost"
  },
  "model": "path/to/model.tflite",
  "version": "0.16.3"
}

🏗️ 项目结构

frigate-mcp/
├── src/
│   └── frigate_mcp/
│       ├── __init__.py       # Package metadata
│       ├── config.py         # Configuration management
│       └── server.py         # MCP server & tools
├── test_connection.py        # Connection test script
├── pyproject.toml           # Project dependencies
├── .env                     # Environment variables (not in git)
└── README.md                # This file

______________________________________________________________________

由以下材料制成❤️ 为护卫舰和MCP社区

目录标签

目录标签

PythonClaudeAI代理视频监控本地部署AI助手摄像头管理事件检测系统集成

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

api-key

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

7

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdioapi-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP