onvif-mcp
MCP server that lets AI agents interact with IP cameras via ONVIF/VAPIX, with fail-closed per-agent policy gates and hash-chained signed audit receipts.
README
<div align="center">
onvif-mcp
<img src="docs/banner.png" alt="onvif-mcp — a governed doorway between AI agents and video infrastructure" width="100%">
The governed doorway between AI agents and video infrastructure.
Every tool call passes a fail-closed policy gate and emits a hash-chained, signed receipt — including denials.<br> The audit trail records what agents tried, not just what they did.
<p> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"></a> <a href="https://bun.sh"><img src="https://img.shields.io/badge/runtime-Bun-f9f1e1.svg?logo=bun" alt="Runtime: Bun"></a> <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/protocol-MCP-8A2BE2.svg" alt="Protocol: MCP"></a> <a href="#transports"><img src="https://img.shields.io/badge/transports-VAPIX%20%7C%20ONVIF%20SOAP-1d3648.svg" alt="Transports: VAPIX | ONVIF SOAP"></a> <a href="https://github.com/oneshot2001/aar"><img src="https://img.shields.io/badge/receipts-AAR%20v0.2%20vocabulary-3ec9a7.svg" alt="Receipts: AAR v0.2 vocabulary"></a> <a href="#status"><img src="https://img.shields.io/badge/status-experimental-d98e3b.svg" alt="Status: experimental"></a> </p>
<a href="https://github.com/oneshot2001/aar">AAR specification</a> · <a href="docs/aar-alignment.md">Conformance plan</a> · <a href="#quick-start">Quick start</a> · <a href="https://github.com/oneshot2001/onvif-mcp/issues">Report an issue</a>
</div>
Agents are getting wired into everything. Nobody has shipped agent access to cameras and video systems that a security director could approve. This is that attempt.
Features
- Four MCP tools over stdio:
list_cameras,get_snapshot,ptz_move,get_receipts - Fail-closed per-agent policy — tool allowlist, camera allowlist, PTZ step bounds per agent identity; unknown agents get nothing
- Signed receipts on every call — hash-chained JSONL, ed25519-signed, produced frames content-hashed into the receipt; one altered byte is detected at the exact sequence number
- Dual transport — AXIS VAPIX and ONVIF SOAP behind one tool contract, selected per camera
- No secrets on disk — camera credentials resolve from a local credential store at startup and are never written or logged
Quick start
bun install
Describe your cameras in cameras.json:
{
"lobby": { "base": "http://192.168.1.33", "user": "root", "credKey": "cam-lobby",
"ptz": true, "protocol": "vapix" },
"gate": { "base": "http://192.168.1.32", "user": "root", "credKey": "cam-gate",
"ptz": true, "protocol": "onvif", "profile": "profile_1_jpeg" }
}
Grant agents authority in policy.json (anything not granted is denied):
{
"agents": {
"claude-main": {
"tools": ["list_cameras", "get_snapshot", "ptz_move", "get_receipts"],
"cameras": ["lobby", "gate"],
"ptz": { "maxStep": 30 }
}
}
}
Register with an MCP client (Claude Code shown):
claude mcp add cameras -- env AGENT_ID=claude-main bun /path/to/onvif-mcp/index.ts
Audit the receipt chain any time:
bun index.ts --verify
# chain OK — every hash linked + signature valid
Tools
| Tool | Does | Policy checks |
|---|---|---|
list_cameras |
Live device info for cameras this agent may see | agent known, tool granted |
get_snapshot |
Capture a JPEG, return path + SHA-256 | + camera granted |
ptz_move |
Relative pan/tilt/zoom in degrees | + camera granted, camera is PTZ, step within maxStep |
get_receipts |
Tail the signed receipt chain | agent known, tool granted |
Every call — allowed or denied — appends a receipt. A denial looks like this:
{ "seq": 19, "profile": "aar-0.2-draft-alignment",
"principal": { "role": "agent", "type": "service", "id": "claude-main" },
"enforcement_point": "onvif-mcp/0.1.0", "node_kind": "authorization",
"action": { "tool": "ptz_move", "params": { "camera": "gate", "pan": 90 } },
"decision": "deny", "detail": "step exceeds policy maxStep 30°",
"prev": "8fb7…", "hash": "8322…", "sig": "jRld…" }
Receipts and the AAR spec
Receipt semantics follow the Agent Action Receipts (AAR)
v0.2 vocabulary: principals, enforcement points, node kinds (observation,
action_attempt, authorization), and calibrated outcome-evidence levels
(device_acknowledged, independently_sensed, unknown).
Honesty note: wire conformance to AAR v0.2 (deterministic CBOR, detached
COSE_Sign1 ES256) is not claimed yet. The current chain is a draft
transport. The gap analysis and conformance plan live in
docs/aar-alignment.md.
Transports
Set protocol per camera: "vapix" (AXIS HTTP CGI) or "onvif" (SOAP
services). Verified live against AXIS hardware: on AXIS OS 12.9.57 the admin
user works for ONVIF over HTTP digest; older 12.x firmware requires a separate
ONVIF account provisioned in the web UI. ONVIF RelativeMove uses the generic
translation space — pan converts as degrees/360 (measured exact on hardware);
tilt/zoom mapping is linear-approximate.
Status
Experimental (v0.1.0). Verified live against three AXIS cameras (two PTZ, one
fixed dome) through real MCP client round-trips: physical PTZ motion with
before/after frame proof, all denial paths exercised and receipted, and
tamper-detection confirmed by mutating a receipt and watching --verify flag
the exact sequence. Not production software — see the roadmap.
Roadmap
- AAR v0.2 wire-conformant receipt producer (CBOR + COSE, verified against the spec's byte-pinned KATs)
- Per-agent signing keys and signed policy objects (agent commissioning)
- Clip/recording export
- Non-AXIS ONVIF hardware validation
Trademark note
ONVIF® is a trademark of ONVIF, Inc. This project is not affiliated with, endorsed by, or certified by ONVIF, Inc. The name is purely descriptive — this server speaks the ONVIF protocol as published in the open specifications. No ONVIF conformance is claimed or implied. No ONVIF logos are used and no WSDL files are redistributed; the SOAP envelopes are hand-authored.
License
MIT © 2026 Matthew Visher.
The AAR specification this project aligns with is separately licensed: spec text CC BY 4.0, reference code Apache-2.0.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。