dahua-nvr-mcp
Python MCP stdio server for Dahua NVRs and cameras. Maintainer: bigoat.
Requires Python 3.11 or later. Device access happens from the machine running this server. No device address or credentials are bundled.
Run with uv
uvx --from dahua-nvr-mcp==0.1.0 dahua-nvr-mcp --help
Create a private configuration file, for example device.env:
DAHUA_BASE_URL=https://192.168.1.100
DAHUA_USERNAME=admin
DAHUA_PASSWORD=REPLACE_WITH_YOUR_DEVICE_PASSWORD
DAHUA_VERIFY_TLS=true
DAHUA_TIMEOUT_SECONDS=15
Start the server through your MCP client, or run:
uvx --from dahua-nvr-mcp==0.1.0 dahua-nvr-mcp --env-file /absolute/path/device.env
No ordinary stdout output while waiting is expected: stdout is reserved for MCP JSON-RPC messages, and logs go to stderr.
MCP client configuration
Replace the configuration-file path with your own absolute path. Windows paths may use forward slashes.
{
"mcpServers": {
"dahua-nvr": {
"command": "uvx",
"args": [
"--from", "dahua-nvr-mcp==0.1.0",
"dahua-nvr-mcp",
"--env-file", "/absolute/path/device.env"
]
}
}
}
Alternatively, install into an existing Python environment:
python -m pip install dahua-nvr-mcp==0.1.0
python -m dahua_nvr_mcp --help
Tools
| Tool | Purpose |
|---|---|
list_network_interfaces |
List enabled non-loopback IPv4 interfaces |
discover_dahua_devices |
Discover local Dahua devices with UDP broadcast |
camera_list |
Read configured camera channels |
camera_add |
Add a camera to an existing unused remote slot |
camera_update |
Update an enabled camera's connection settings |
camera_delete |
Unbind a camera channel without deleting recordings |
gb28181_get_config |
Read GB28181 server/client configuration |
gb28181_update_config |
Update one platform in the complete server table |
device_info |
Read model, serial number, software and hardware versions |
stream_capabilities |
Read extra-stream capabilities |
record_search |
Search recordings in device-local time |
Configuration and compatibility
- Priority: command-line parameters > process environment >
.env> defaults. Without--env-file, the server reads.envin its working directory. - Parameters:
--base-url,--username,--password,--verify-tls true|false,--timeout-seconds,--env-file. - Prefer an environment variable or protected configuration file for passwords: CLI passwords can appear in process listings and shell history.
- Tools/list and LAN discovery do not require NVR credentials. UDP discovery requires exclusive access to local port 5051; close Dahua ConfigTool before discovery.
- RPC channel numbers are zero-based. GB28181 defaults to platform 1 (
slot_index=0), with ordinary JSON RPC (transport=plain). Optional secure RPC is firmware-dependent. - Camera add supports Onvif, Private, RTSP and General. RTSP add accepts
main_stream_url, optionalextra_stream_urlandchannel_name; URL hosts must match the camera address. Camera update currently supports Onvif/Private connection settings. - Write tools read the current configuration, preserve unrelated fields, and verify by reading back. An accepted write does not prove that a camera is connected or SIP registration is online. Ambiguous writes are not automatically repeated.
- Public results recursively redact credential fields and remove URL userinfo/query credentials. Raw configuration remains private in runtime memory for comparison and writeback. Do not write redacted output back as an original configuration.
- Unknown password masks are rejected; native placeholders are preserved only for a specifically verified firmware profile. GB28181 client-table writes are not supported.
- Prefer HTTPS with certificate verification. HTTP carries sensitive data in plaintext and should only be used on a trusted network.
--verify-tls falsedisables certificate verification, not login authentication.
Firmware behavior varies. Validate read operations first, and only use write tools on devices you are authorized to manage. This is an independent integration, not an official Dahua product.
Metadata
Release files for dahua-nvr-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dahua_nvr_mcp-0.1.0.tar.gz | 27.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dahua_nvr_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 60.3 kB
Release files / dahua_nvr_mcp-0.1.0.tar.gz
| Download URL | dahua_nvr_mcp-0.1.0.tar.gz |
|---|---|
| Size | 27.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d81367c9f6b623900d03f965c0ac263515337d3afc1ea193d848663659ca0bb3
|
|
BLAKE2b-256 checksum How to use checksums |
f9c379231167da726fb233f31658b3c7e868cab38154873a5100c3ca4e20cbe5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / dahua_nvr_mcp-0.1.0-py3-none-any.whl
| Download URL | dahua_nvr_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 32.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f3e9cc7ecc4cd17a1c13df40258083ebfa64dae9a625a82f8efb50cd27bf4e2d
|
|
BLAKE2b-256 checksum How to use checksums |
b16042f752e1eef1bfd4602aaed236b235875aec22c81d9917ab771675f0efcd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for dahua-nvr-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.