deConz MCP

by marcinn2

Not rated
GitHub

About

MCP Server for deConz server developed by Dresden Elektronik (bridge between smart home automation platforms and wireless Zigbee networks)

Details

Author
marcinn2
Categories
Communication, Other

Setup

Install deConz MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/marcinn2/deConz-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

AnMCP (Model Context Protocol)server that exposes thedeCONZ REST APIto AI assistants. Control Zigbee lights, sensors, groups, scenes, rules, and schedules through natural language.

Supportsstdio,SSE, andStreamable HTTPtransports. HTTP transports are protected by a configurablebearer token.

- Python ≥ 3.10
-
uv(recommended) or pip
- A runningdeCONZ / Phoscongateway with a ConBee or RaspBee adapter
- A validdeCONZ REST API key(see
Obtaining an API key)

# Clone the repository git clone https://github.com/your-org/deconz-mcp.git cd deconz-mcp # Install with uv (creates an isolated virtual environment) uv sync # Or install with pip into your environment pip install -e .

- Open thePhoscon Appin your browser (usuallyhttp://<gateway-ip>/pwa).
- Go toMenu → Settings → Gateway → Advanced.
- ClickAuthenticate app— this opens the network for 60 seconds.
- Within those 60 seconds, run:

curl -s -X POST http://<gateway-ip>/api \ -H "Content-Type: application/json" \ -d '{"devicetype": "deconz-mcp"}'
[{"success": {"username": "YOUR-API-KEY-HERE"}}]
DECONZ_HOST=192.168.1.10 DECONZ_API_KEY=abc123def deconz-mcp
DECONZ_HOST=192.168.1.10 \ DECONZ_API_KEY=abc123def \ MCP_AUTH_TOKEN=my-mcp-secret \ deconz-mcp --transport streamable-http --host 0.0.0.0 --port 8080
DECONZ_HOST=192.168.1.10 \ DECONZ_API_KEY=abc123def \ MCP_AUTH_TOKEN=my-mcp-secret \ deconz-mcp --transport server --host 0.0.0.0 --port 8080
  • Not required when using stdio and callingconfigure_deconzat runtime.
† Strongly recommended for HTTP transports exposed beyond localhost.
usage: deconz-mcp [--transport {stdio,sse,streamable-http,server}] [--host HOST] [--port PORT] [--log-level {DEBUG,INFO,WARNING,ERROR}] [--auth-token TOKEN] [--base-url URL]

The deCONZ REST API key is a gateway credential that travels as part of the URL path (/api/<apikey>/...). It is configured server-side viaDECONZ_API_KEYand is never exposed to MCP clients.

TheMCP_AUTH_TOKEN/--auth-tokenoption protects the MCP server itself. Every HTTP request from an MCP client must include:

The token is verified with a constant-time comparison to prevent timing attacks. When running over localhost only (default bind127.0.0.1), bearer auth is optional but recommended.

Resources are read-only, cacheable snapshots that MCP clients can fetch without issuing tool calls.

Prompts are pre-built conversation starters that guide the AI through common workflows.

Add to~/Library/Application Support/Claude/claude_desktop_config.json(macOS):

{ "mcpServers": { "deconz": { "command": "deconz-mcp", "env": { "DECONZ_HOST": "192.168.1.10", "DECONZ_API_KEY": "your-api-key-here" } } } }

Or if installed in a virtual environment:

{ "mcpServers": { "deconz": { "command": "/path/to/deconz-mcp/.venv/bin/deconz-mcp", "env": { "DECONZ_HOST": "192.168.1.10", "DECONZ_API_KEY": "your-api-key-here" } } } }
{ "mcpServers": { "deconz": { "url": "http://localhost:8080/mcp", "headers": { "Authorization": "Bearer my-mcp-secret" } } } }
{ "mcpServers": { "deconz": { "url": "http://localhost:8080/sse", "headers": { "Authorization": "Bearer my-mcp-secret" } } } }

A pre-built multi-platform image (linux/amd64 + linux/arm64) is published to the registry:

registry.mne.pl/deconz-mcp:latest registry.mne.pl/deconz-mcp:0.1.0

A multi-stageDockerfileis also included if you prefer to build locally. The builder stage uses the officialuvimage to install dependencies and compile the package as a wheel; the runtime stage ispython:3.12-slim(57 MB total).

docker pull registry.mne.pl/deconz-mcp:latest
# Single-platform (current machine) docker build -t deconz-mcp:latest . # Multi-platform push (requires a buildx builder with multi-platform support) docker buildx build \ --platform linux/amd64,linux/arm64 \ --tag registry.mne.pl/deconz-mcp:latest \ --tag registry.mne.pl/deconz-mcp:0.1.0 \ --push .

Run — HTTP server (SSE + Streamable HTTP)

docker run -p 8000:8000 \ -e DECONZ_HOST=192.168.1.10 \ -e DECONZ_API_KEY=abc123def \ -e MCP_AUTH_TOKEN=my-mcp-secret \ registry.mne.pl/deconz-mcp:latest
docker run -i \ -e DECONZ_HOST=192.168.1.10 \ -e DECONZ_API_KEY=abc123def \ registry.mne.pl/deconz-mcp:latest --transport stdio

A ready-to-use Compose file is indocs/docker-compose.yml. It defines two services:

# Copy and edit the environment file cp .env.example .env # set DECONZ_HOST, DECONZ_API_KEY, MCP_AUTH_TOKEN # Start the HTTP server docker compose -f docs/docker-compose.yml up # Run a one-shot stdio session docker compose -f docs/docker-compose.yml --profile stdio run --rm deconz-mcp-stdio

Use the stdio service in Claude Desktop:

{ "mcpServers": { "deconz": { "command": "docker", "args": ["compose", "-f", "/path/to/docs/docker-compose.yml", "--profile", "stdio", "run", "--rm", "deconz-mcp-stdio"], "env": { "DECONZ_HOST": "192.168.1.10", "DECONZ_API_KEY": "your-api-key-here" } } } }

The manifest atk8s/deployment.yamlcontains all resources needed to run the server in a cluster:

# 1. Encode your secrets echo -n 'your-api-key' | base64 # → paste into Secret.DECONZ_API_KEY echo -n 'your-mcp-token' | base64 # → paste into Secret.MCP_AUTH_TOKEN # 2. Edit the ConfigMap (DECONZ_HOST, MCP_BASE_URL) in k8s/deployment.yaml # 3. Apply kubectl apply -f k8s/deployment.yaml # 4. Verify kubectl -n deconz-mcp get pods kubectl -n deconz-mcp logs -f deploy/deconz-mcp
kubectl -n deconz-mcp port-forward svc/deconz-mcp 8000:80 curl http://localhost:8000/health # {"status": "ok", "deconz_configured": true}

TheDeploymentconfigures both a liveness probe and a readiness probe against/health, so Kubernetes automatically restarts the pod if the server becomes unresponsive.

Uncomment theIngresssection at the bottom ofk8s/deployment.yamland set your hostname. TLS termination happens at the ingress controller; the pod always speaks plain HTTP internally.

HTTP transports expose a liveness probe:

curl http://localhost:8080/health # {"status": "ok", "deconz_configured": true}
deConz-mcp/ ├── Dockerfile # Multi-stage image build ├── pyproject.toml # Package metadata and dependencies ├── uv.lock # Locked dependency versions ├── README.md ├── docs/ │ └── docker-compose.yml # Compose services (HTTP + stdio) ├── k8s/ │ └── deployment.yaml # Kubernetes: Namespace, Secret, ConfigMap, │ # Deployment, Service, Ingress (template) └── src/ └── deconz_mcp/ ├── __init__.py ├── __main__.py # CLI entrypoint and transport wiring ├── client.py # Async deCONZ REST API HTTP client └── server.py # FastMCP server: tools, resources, prompts

For the full API reference, see thedeCONZ REST API documentation.

Preliminary assessment only — not legal advice.See full notes below.

When this server runs in a private household and is accessed only by the residents, processing of smart-home device data is likely covered by thehousehold exemption(GDPR Recital 18). In that scenario the GDPR does not apply and no additional compliance steps are required.

Deploying this server in offices, rental properties, hotels, co-working spaces, or any environment where you process data on behalf of other peopletakes you outside the household exemption. In those cases:

- Presence and motion sensor dataconstitutes personal behavioral data (Art. 4(1) GDPR). Establish a documented lawful basis (Art. 6) before processing it.
- Conduct aData Protection Impact Assessment(Art. 35) if the deployment involves systematic monitoring of occupants on a large scale.
- Provide aprivacy noticeto data subjects describing what is collected, for how long, and under what legal basis.

- No data is sent to third parties, analytics services, or cloud providers.
- No telemetry, tracking pixels, or consent libraries are present in this codebase.
- All communication stays between the MCP client, this server, and the local deCONZ gateway.

This GDPR assessment was generated as a preliminary, exploratory evaluation. It does not constitute legal advice and does not replace a legal audit. For binding guidance, consult a qualified data protection lawyer in your jurisdiction.

This software is not affiliated with or endorsed by Dresden Elektronik. Use at your own risk. It does not come with any warranty of any kind. There is no liability for the developer. This software is a personal project that I maintain in my free time. Refer to the licence for more information.

MCP server for managing OpenSprinkler controller via Claude Desktop or any MCP-compatible client.

Connects to a Coreflux MQTT broker, offering tools for Coreflux commands and integration with AI assistants.

An MCP server that connects to a Coreflux MQTT broker, providing Coreflux and MQTT actions as tools for AI assistants.

A free, private, and secure remote MCP server for Home Assistant.

MCP server for Azure IoT Hub - device registry, twins, direct methods, jobs, messaging

MCP server for Google Cast — discover devices, play media, control volume, launch apps, and manage queues over stdio

Home automation you can just talk to. No dashboards, no app to learn.

A safe-by-default MCP server that exposes your Control4 home automation (lights, scenes, locks, thermostats, and media) as structured tools over HTTP and Claude Desktop STDIO for reliable AI-powered control on your local network.

Control and query the status of Ecovacs cleaning robots using the MCP protocol.

Control AVM FRITZ!Box routers - manage devices, WiFi, network settings, parental controls, and schedule time-delayed actions

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.