hikvision-mcp

hikvision-mcp

Enables safely inspecting and configuring Hikvision cameras via a local MCP server, with permission enforcement, read-only diagnostics, and supervised mutation flows.

Category
访问服务器

README

hikvision-mcp

[!IMPORTANT] Alpha software for local, trusted deployments. Test against your exact camera model and firmware before enabling writes.

A local, capability-aware MCP server for safely inspecting and configuring Hikvision cameras. The current release implements the PRD's first end-to-end vertical slice:

  • TOML configuration and environment-variable secrets;
  • per-camera and per-tool permission enforcement;
  • async ISAPI with digest authentication, safe XML parsing, and bounded event streaming;
  • camera identity and capability probing;
  • warning-light read and partial configuration updates using the camera's JSON schema;
  • read-only intrusion regions, targets, arming schedules, and event linkage;
  • read-only motion, tamper, line-crossing, intrusion, region entrance/exit, and scene-change rules with zones, schedules, targets, and linkage;
  • camera health, stream profiles, image/day-night settings, storage status, audible-alarm configuration, and two-way-audio capability reads;
  • bounded live alert monitoring with semantic event type and active/inactive state;
  • mandatory proposal/apply approval fallback;
  • conflict detection, verified read-back, SQLite audit/change history, and rollback;
  • stdio and localhost Streamable HTTP MCP transports.

The warning-light, field-detection, and alert-stream adapters have sanitized fixture coverage for DS-2CD2346G2-ISU/SL firmware V5.7.14 and V5.7.19. The expanded read surface has sanitized V5.7.19 fixture coverage. Hardware writes still require explicit approval and should be opt-in until a PUT/read-back cycle has been validated on the target. Firmware differences belong in adapter subclasses, never MCP handlers.

Compatibility

Surface V5.7.14 fixtures V5.7.19 fixtures V5.7.19 reference hardware
Warning light, intrusion, alert stream Yes Yes Read-only verified
Health, streams, image, storage, audio — Yes Read-only verified
General detection rules — Yes Seven advertised rule types read

The reference hardware is a DS-2CD2346G2-ISU/SL. Other Hikvision devices are handled through capability probing, automatic or configured channel selection, and model/firmware adapter registration; they are not claimed as tested until sanitized fixtures or hardware evidence are added.

Install

uv sync --extra dev
Copy-Item config.example.toml config.toml
$env:HIKVISION_CAMERA_USERNAME = "service-account"
$env:HIKVISION_CAMERA_PASSWORD = "..."

On Linux or macOS, use cp and export for the equivalent file copy and environment values.

Keep config.toml local and never commit credentials. Validate and run:

uv run hikvision-mcp config validate --config config.toml
uv run hikvision-mcp serve --transport stdio --config config.toml
uv run hikvision-mcp serve --transport streamable-http --config config.toml

The HTTP MCP endpoint is http://127.0.0.1:8000/mcp by default.

Safe mutation flow

The example configuration is read-only. Deliberately raise both the server and camera policy ceilings to Level 3 before using this flow.

  1. Call get_capabilities(camera="example_camera").
  2. Call get_warning_light.
  3. Call configure_warning_light; this only creates a proposal.
  4. Obtain explicit human approval.
  5. Call apply_change(proposal_id=..., approved=true).
  6. The server checks for conflicts, writes once, reads back, verifies, and audits.
  7. Use rollback_change to create a separately approved rollback proposal.

Read-only diagnostics

  • get_detection_rules(camera="example_camera") reads detector types advertised by the camera. Pass kinds to probe specific types. Each result reports support independently and preserves readable configuration if schedule or linkage sub-resources are unavailable.

  • get_camera_health, get_stream_profiles, get_image_settings, and get_storage_status expose operational state without allowing networking, accounts, firmware, or reset actions.

  • get_audio_alarm and get_two_way_audio describe audible deterrence and talk-channel configuration. They do not play audio, open a talk session, or change camera state.

  • get_intrusion_detection(camera="example_camera") returns field-detection enablement, regions, polygons, targets, sensitivity, arming schedule, and linkage methods.

  • monitor_events(camera="example_camera", duration_seconds=15) watches the alert stream for a bounded period. Use event_types=["fielddetection"] to filter exact camera event names.

  • get_warning_light(camera="example_camera") returns duration, frequency, and schedule. The reference V5.7.19 firmware does not advertise brightness or a standalone enabled flag.

Quality checks

uv run ruff check .
uv run mypy
uv run pytest

See CONFIGURATION.md, SECURITY.md, and DEVELOPMENT.md.

Project status and support

This project is not affiliated with or endorsed by Hikvision. Hikvision and ISAPI are used only to identify compatible products and protocols. Hardware and firmware behavior varies; unsupported or unknown features return unsupported_capability rather than being guessed.

Bug reports and contributions are welcome. Read CONTRIBUTING.md before submitting camera payloads or changes, and use SECURITY.md for vulnerabilities.

Licensed under the MIT License.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选