Mentioned as a supported home automation platform that can integrate with the ZigBee2MQTT MCP server for device control and automation
Connects to MQTT brokers to subscribe to device messages and publish commands, enabling real-time communication with ZigBee devices through the MQTT protocol
Provides integration information and MQTT topic details for connecting ZigBee devices to n8n workflows and automation scenarios
Provides intelligent device discovery and control for ZigBee devices connected via ZigBee2MQTT, including automatic schema learning, device state monitoring, command sending, and capability-based device searching
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ZigBee2MQTT MCP Serverturn on the living room lamp"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ZigBee2MQTT MCP Server
A Model Context Protocol (MCP) server for ZigBee2MQTT that provides intelligent device discovery and control for AI assistants.
π Remote-Capable! This MCP server can run on a remote server (e.g., where your MQTT broker runs) and you can access it from your Mac via HTTP. See REMOTE-SETUP.md for details!
Deployment Options
Local (stdio): Container runs on your Mac, accessed via stdio
Remote (HTTP/SSE): Container runs on server, accessed via HTTP β REMOTE-SETUP.md
Overview
This MCP server connects to your MQTT broker and automatically analyzes all ZigBee devices connected via ZigBee2MQTT. It learns the structure and capabilities of each device and makes this information available to AI assistants through MCP tools.
Core Features
π Intelligent Schema Discovery: Automatically learns the structure and capabilities of your devices
πΎ Compact Data Storage: Stores only metadata and schemas, not complete message history
π Zigbee2MQTT Documentation: Direct access to official device documentation
π³ Docker-Ready: Easy deployment with Docker Compose
π Remote-Capable: Runs on server, access via HTTP/SSE from anywhere
π Security: Optional API key authentication
π Retained Messages: Uses MQTT retained messages for instant access to device information
π Home Automation: Perfect for n8n, Home Assistant and other automation tools
What is Stored?
β Device Metadata (Name, model, manufacturer) β Field Schemas (Which fields does a device have? What data types?) β Capabilities (Can dim, change color, measure temperature, etc.) β Current State (Only last value, no history)
β Not Stored: Complete message history, time-based sensor data
Estimated Database Size: ~1-2 MB for 100 devices (instead of GB with full history!)
Prerequisites
Node.js 20+ or Docker
Running ZigBee2MQTT installation
MQTT Broker (e.g., Mosquitto)
Installation
Option 1: Docker (Recommended)
Clone repository
git clone <repository-url> cd zigbeeMCPCreate environment file
cp .env.example .envConfigure .env
MQTT_BROKER_URL=mqtt://192.168.1.100:1883 MQTT_USERNAME=your_user MQTT_PASSWORD=your_password MQTT_BASE_TOPIC=zigbee2mqtt DB_PATH=/data/zigbee2mqtt.db # Log Level: debug, info, warn, error, silent # Recommended: error (minimal output) LOG_LEVEL=errorStart container
docker compose up -dView logs
docker compose logs -f
Option 2: Local Installation
Install dependencies
npm installCompile TypeScript
npm run buildStart
npm start
MCP Configuration
Claude Desktop
Add the following to Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"zigbee2mqtt": {
"command": "docker",
"args": [
"exec",
"-i",
"zigbee2mqtt-mcp",
"node",
"dist/index.js"
]
}
}
}Or for local installation:
{
"mcpServers": {
"zigbee2mqtt": {
"command": "node",
"args": ["/path/to/zigbeeMCP/dist/index.js"],
"env": {
"MQTT_BROKER_URL": "mqtt://localhost:1883",
"MQTT_BASE_TOPIC": "zigbee2mqtt",
"DB_PATH": "/path/to/zigbee2mqtt.db"
}
}
}
}Available Tools
The MCP server provides the following tools:
1. list_devices
Lists all ZigBee devices.
Example:
Show me all my ZigBee devices2. get_device_info
Shows detailed information about a specific device.
Parameters:
device: Device friendly name or IEEE address
Example:
Show me details for the living room lamp3. find_devices
Searches for devices by name, model, or description.
Parameters:
query: Search term
Example:
Find all lamps in the living room4. get_device_state
Shows the current state of a device.
Parameters:
device: Device friendly name or IEEE address
Example:
Is the living room lamp on?5. send_command
Sends a command to a device.
Parameters:
device: Device friendly name or IEEE addresscommand: Command as JSON object
Example:
Turn on the living room lamp
Set brightness to 50%6. find_by_capability
Finds all devices with a specific capability.
Parameters:
capability: Capability type (e.g.,on_off,brightness,temperature_sensor)
Example:
Show all dimmable devices
Which devices can measure temperature?Common Capabilities:
on_off- Can be turned on/offbrightness- Dimmablecolor_temperature- Color temperature adjustablecolor- Color changeabletemperature_sensor- Temperature sensorhumidity_sensor- Humidity sensorcontact_sensor- Contact sensoroccupancy_sensor- Motion sensor
7. get_integration_info
Provides integration information for n8n or other tools.
Parameters:
device: Device friendly name or IEEE address
Example:
How can I integrate the living room lamp into n8n?8. get_stats
Shows statistics about the ZigBee network.
Example:
How many devices are connected?9. get_device_documentation
Provides links to official Zigbee2MQTT documentation for a specific device.
Parameters:
device: Device friendly name or IEEE address
Example:
Show me the documentation for my Philips Hue lamp
How can I best control the "living_room_lamp" device?
What can my IKEA TRADFRI switch do?Returns:
Link to device documentation on zigbee2mqtt.io
Model and vendor information
Known capabilities of the device
Direct link to search for the specific model
10. get_recent_devices
Lists devices that were added to the ZigBee network within the last N days.
Parameters:
days: Number of days to look back (default: 7)
Example:
Which devices were added in the last week?
Show me all new devices since yesterday
Which devices have I paired in the last 30 days?Returns:
Number of days
Number of devices found
List of devices with:
Name, model, manufacturer
created_at: Timestamp when device was addedlast_seen: Timestamp of last messageupdated_at: Last update
Note: All timestamps are Unix timestamps (milliseconds since 1970-01-01).
Usage Examples
With Claude Desktop
User: "Is there a lamp in the living room?"
Claude: [Uses find_devices with query="living room"]
β "Yes, I found 'living_room_ceiling_lamp' (Philips Hue White)"
User: "Turn it on"
Claude: [Uses send_command with {"state": "ON"}]
β "The lamp has been turned on"
User: "How can I use this lamp in n8n?"
Claude: [Uses get_integration_info]
β "You can use these MQTT topics:
- Read: zigbee2mqtt/living_room_ceiling_lamp
- Write: zigbee2mqtt/living_room_ceiling_lamp/set
Example payload: {"state": "ON", "brightness": 200}"
User: "What can my IKEA TRADFRI switch do?"
Claude: [Uses get_device_documentation]
β "Your IKEA TRADFRI switch (Model: E1743) supports:
- Capabilities: button, battery
- Documentation: https://www.zigbee2mqtt.io/supported-devices/#s=E1743
- There you'll find all button events and MQTT payloads!"
User: "Which devices did I add in the last week?"
Claude: [Uses get_recent_devices with days=7]
β "3 devices were added in the last 7 days:
1. living_room_outlet (OSRAM Smart+ Plug) - 2 days ago
2. bathroom_sensor (Aqara Temperature Sensor) - 5 days ago
3. hallway_lamp (Philips Hue) - 6 days ago"Architecture
βββββββββββββββββββββββ
β AI Assistant β
β (Claude Desktop) β
ββββββββββββ¬βββββββββββ
β MCP Protocol (stdio)
ββββββββββββΌβββββββββββ
β MCP Server β
β - Tools Handler β
β - Response Gen. β
ββββββββββββ¬βββββββββββ
β
ββββββββββββΌβββββββββββ ββββββββββββββββββββ
β SQLite Database β β MQTT Listener β
β - Devices β β - Subscribe All β
β - Fields ββββββββ€ - Process Msgs β
β - Capabilities β β - Discovery β
β - Current State β ββββββββββ¬ββββββββββ
βββββββββββββββββββββββ β
β
βββββββββΌβββββββββ
β MQTT Broker β
β (Mosquitto) β
βββββββββ¬βββββββββ
β
βββββββββΌβββββββββ
β ZigBee2MQTT β
β - ZigBee Net β
β - Devices β
ββββββββββββββββββTroubleshooting
Container won't start
# Check logs
docker compose logs
# Rebuild container
docker compose down
docker compose build --no-cache
docker compose up -dMQTT connection fails
Check MQTT broker URL in
.envIf broker runs on host, use
mqtt://host.docker.internal:1883Check firewall settings
No devices found
Check if ZigBee2MQTT is running:
zigbee2mqtt/bridge/stateshould be "online"Check base topic in
.env- must match ZigBee2MQTT configCheck MQTT permissions
Database errors
# Reset database
docker compose down
rm -rf data/
docker compose up -dToo many logs in Claude Desktop
The MCP server uses a configurable logging system:
Adjust in
# Minimal output (recommended)
LOG_LEVEL=error
# For debugging
LOG_LEVEL=debugLog Levels:
silent- No outputerror- Only errors (recommended for Claude Desktop)warn- Warnings + errorsinfo- Normal outputdebug- All details
After changes:
docker compose restartDevelopment
Local Development
# Install dependencies
npm install
# TypeScript in watch mode
npm run watch
# In another terminal: start server
npm run devProject Structure
src/
βββ index.ts # Main entry point
βββ types.ts # TypeScript definitions
βββ database.ts # SQLite database logic
βββ mqtt-listener.ts # MQTT client & message handler
βββ schema-discovery.ts # Schema discovery engine
βββ mcp-server.ts # MCP server & toolsLicense
MIT
Support
For questions or issues, please create an issue on GitHub.
This server cannot be installed
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.