AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Dahua Mcp

mcp-brianegge-dahua-mcp · by brianegge

MCP server for Dahua/Amcrest IP camera management

No reviews yet
0 installs
17 views
0.0% view→install

Install

$ agentstack add mcp-brianegge-dahua-mcp

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-brianegge-dahua-mcp)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Dahua Mcp? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Dahua MCP Server

MCP server for managing Dahua/Amcrest IP cameras via their CGI HTTP API. Supports multiple cameras from a single instance, with both stdio and HTTP transports.

Quick Start

1. Create a cameras config file

Create ~/.config/dahua-mcp/cameras.yaml (or cameras.json) with your camera credentials. This is the default config location — no env var needed.

JSON (cameras.json):

{
  "cameras": [
    {
      "name": "front-door",
      "host": "192.168.1.108",
      "port": 80,
      "username": "admin",
      "password": "secret"
    },
    {
      "name": "backyard",
      "host": "192.168.1.109",
      "port": 80,
      "username": "admin",
      "password": "secret"
    }
  ]
}

YAML (cameras.yaml):

cameras:
  - name: front-door
    host: 192.168.1.108
    port: 80
    username: admin
    password: secret
  - name: backyard
    host: 192.168.1.109
    port: 80
    username: admin
    password: secret

Each camera entry supports:

| Field | Required | Default | Description | |-------|----------|---------|-------------| | name | Yes | — | Unique camera name used in all tool calls | | host | Yes | — | Camera hostname or IP address | | port | No | 80 | HTTP port (443 auto-enables HTTPS) | | username | Yes | — | Camera username | | password | Yes | — | Camera password | | verify_ssl | No | false | Verify SSL certificates |

2. Add the MCP server

Option A: stdio (Claude Code / Claude Desktop)

Using the Claude Code CLI (cameras config auto-discovered from ~/.config/dahua-mcp/):

# From PyPI
claude mcp add dahua-mcp -- uvx dahua-mcp

# From a local clone
claude mcp add dahua-mcp -- uv run --directory /path/to/dahua-mcp dahua-mcp

# With a custom config path
claude mcp add dahua-mcp -e DAHUA_CAMERAS_CONFIG=/path/to/cameras.json -- uvx dahua-mcp

Or manually add to your Claude Code settings (~/.claude.json) or Claude Desktop config:

{
  "mcpServers": {
    "dahua-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": ["dahua-mcp"]
    }
  }
}

Or run from a local clone:

{
  "mcpServers": {
    "dahua-mcp": {
      "type": "stdio",
      "command": "uv",
      "args": ["run", "--directory", "/path/to/dahua-mcp", "dahua-mcp"]
    }
  }
}

To override the config location, add an env block:

{
  "env": {
    "DAHUA_CAMERAS_CONFIG": "/custom/path/cameras.yaml"
  }
}
Option B: Docker container (HTTP transport)

Run the container with your config file volume-mounted:

docker run -d \
  -v /path/to/cameras.json:/config/cameras.json:ro \
  -p 8000:8000 \
  ghcr.io/brianegge/dahua-mcp:latest

Then add the HTTP server to your MCP client config:

{
  "mcpServers": {
    "dahua-mcp": {
      "type": "http",
      "url": "http://localhost:8000/mcp"
    }
  }
}

To use a YAML config with Docker:

docker run -d \
  -v /path/to/cameras.yaml:/config/cameras.yaml:ro \
  -e DAHUA_CAMERAS_CONFIG=/config/cameras.yaml \
  -p 8000:8000 \
  ghcr.io/brianegge/dahua-mcp:latest

To add bearer token authentication:

docker run -d \
  -v /path/to/cameras.json:/config/cameras.json:ro \
  -e MCP_HTTP_BEARER_TOKEN=your-secret-token \
  -p 8000:8000 \
  ghcr.io/brianegge/dahua-mcp:latest
{
  "mcpServers": {
    "dahua-mcp": {
      "type": "http",
      "url": "http://localhost:8000/mcp",
      "headers": {
        "Authorization": "Bearer your-secret-token"
      }
    }
  }
}

Environment Variables

All settings beyond camera credentials are configured via environment variables:

| Variable | Default | Description | |----------|---------|-------------| | DAHUA_CAMERAS_CONFIG | ~/.config/dahua-mcp/cameras.yaml | Path to cameras config file (JSON or YAML). Auto-discovers from ~/.config/dahua-mcp/ if not set. | | DAHUA_TIMEOUT | 20 | HTTP request timeout in seconds | | READ_ONLY_MODE | false | Disable all write tools (reboot, set_config, etc.) | | DISABLED_TAGS | — | Comma-separated tags to disable (e.g. destructive,write) | | LOG_LEVEL | INFO | Logging level | | RATE_LIMIT_ENABLED | false | Enable rate limiting | | RATE_LIMIT_MAX_REQUESTS | 60 | Max requests per window | | RATE_LIMIT_WINDOW_MINUTES | 1 | Rate limit window in minutes | | MCP_TRANSPORT | stdio | Transport type: stdio, sse, or http | | MCP_HTTP_HOST | 0.0.0.0 | HTTP bind host | | MCP_HTTP_PORT | 8000 | HTTP bind port | | MCP_HTTP_BEARER_TOKEN | — | Optional bearer token for HTTP auth |

Available Tools

Discovery

| Tool | Description | Read-Only | |------|-------------|-----------| | list_cameras | List all configured cameras (name, host, port) | Yes |

System Info

| Tool | Description | Read-Only | |------|-------------|-----------| | get_system_info | Get full system info (device type, serial, firmware, etc.) | Yes | | get_device_type | Get the device type/model | Yes | | get_software_version | Get firmware version | Yes | | get_machine_name | Get the camera's machine name | Yes | | get_serial_number | Get the serial number | Yes | | get_hardware_version | Get the hardware version | Yes | | get_vendor | Get the vendor/manufacturer | Yes |

Config Read

| Tool | Description | Read-Only | |------|-------------|-----------| | get_config | Get any config section by name | Yes | | get_motion_detection | Get motion detection config | Yes | | get_video_in_mode | Get video input mode (day/night profile) | Yes | | get_encoding_config | Get encoding/streaming config | Yes | | get_network_config | Get network config (IP, gateway, DNS) | Yes | | get_ntp_config | Get NTP time sync config | Yes |

Config Write

| Tool | Description | Destructive | |------|-------------|-------------| | set_config | Set arbitrary config key-value pairs | Yes | | enable_motion_detection | Enable/disable motion detection | No | | set_record_mode | Set recording mode (auto/manual/off) | No |

System Control

| Tool | Description | Destructive | |------|-------------|-------------| | reboot | Reboot the camera | Yes | | take_snapshot | Take a JPEG snapshot (base64) | No |

Logs

| Tool | Description | Read-Only | |------|-------------|-----------| | search_logs | Search camera logs by time range and type | Yes |

Development

git clone https://github.com/brianegge/dahua-mcp.git
cd dahua-mcp
uv sync
uv run pre-commit install  # Install ruff format/lint hook
uv run pytest              # Run tests
uv run ruff check .        # Lint

License

MIT License - see LICENSE file for details.

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.