Smart House MCP Server
Connects to a Home Assistant instance via its REST API, exposing Home Assistant-managed entities through the same standardized device-control and scene tools.
Publishes/consumes device commands over any MQTT broker (Mosquitto, EMQX, HiveMQ, etc.), with fully configurable per-device topics and payloads, making it the most flexible adapter for arbitrary smart-home hardware.
Controls Philips Hue lights through the Hue Bridge local REST API, supporting power, brightness, CIE xy color, and color temperature (mirek); optional room and group maps let Hue light IDs be exposed as rooms/groups in the server's unified device registry.
Click on "Deploy 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., "@Smart House MCP Server turn bedroom lights to warm white at 20%"
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.
π Smart House MCP Server
One interface to rule them all. Natural language in, vendor-specific action out.
Smart House is an MCP (Model Context Protocol) server that gives any AI assistant full control over your smart home β regardless of what brands or protocols your devices use.
You say "turn bedroom lights to warm white at 20%". The assistant figures out the intent, calls a standardized tool, and the server routes it to the right vendor SDK under the hood. You never think about WiZ vs Hue vs Tuya again.
you β assistant β MCP tool call β adapter β actual deviceπ§ Why This Exists
Every smart home brand has its own API, its own SDK, its own protocol. Some use local UDP. Some use cloud REST. Some use MQTT. Some use a proprietary bridge. Some use jank you reverse-engineered at 2am.
This server sits in the middle. It exposes one set of tools that work across all of them. The adapter layer translates. Your assistant just calls turn_on and doesn't care what's behind it.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MCP Server β
β β
β βββββββββββββββββ ββββββββββββββββββ ββββββββββββββββββ β
β β 11 Tools β β Device β β Scene β β
β β β β Registry β β Engine β β
β β list_devices β β β β β β
β β get_state β β 16+ devices β β 6 built-in β β
β β turn_on/off β β canonical β β + custom β β
β β set_brightnessβ β objects with β β scenes β β
β β set_color β β fuzzy resolve β β β β
β β set_color_tempβ β β β β β
β β control_deviceβ β β β β β
β β run_scene β β β β β β
β β list_scenes β β β β β β
β β create_scene β β β β β β
β βββββββββ¬ββββββββ βββββββββ¬βββββββββ ββββββββββββββββββ β
β β β β
β βββββββββΌββββββββββββββββββββΌββββββββββββββββββββββββββββββββ β
β β Adapter Manager β β
β β β β
β β ββββββββ ββββββββ ββββββββ ββββββββ βββββββββββββ β β
β β β Demo β β WiZ β β Hue β β Tuya β β MQTT β β β
β β β β β β β β β β β β β β
β β β sim β β UDP β β REST β βCloud β β Broker β β β
β β ββββββββ ββββββββ ββββββββ ββββββββ βββββββββββββ β β
β β β β
β β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β Home Assistant (REST API) β β β
β β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββRelated MCP server: mcp-server-tuya
β‘ Quick Start
1. Install
cd Smart_House
npm install2. Test (no hardware needed)
npm testThis runs 38 integration tests against the built-in demo adapter β 16 simulated devices across 6 rooms.
βββ Smart House MCP β Tests βββ
Device Registry:
β has devices (16)
β can get by id
β findByRoom bedroom
β findByType bulb
β findByGroup bedroom lights
...
38 passed, 0 failed3. Start the server
npm start[smart-house] adapter loaded: demo
[demo] registered 16 simulated devices
[smart-house] 16 devices registered total
[smart-house] 6 scenes loaded
[smart-house] 11 tools registered
[smart-house] MCP server ready β waiting for connections4. Connect to Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"smart-house": {
"command": "node",
"args": ["F:/MK Solutions/MCPs/Smart_House/src/index.js"]
}
}
}Restart Claude Desktop. Then just talk:
"Turn bedroom lights to warm white at 20%"
"What's the temperature in the kitchen?"
"Run movie night scene"
"Turn off everything in the house"
"Set living room to a nice sunset orange"
"Open bedroom curtains halfway"
"Create a scene called 'dinner party' that dims the kitchen and turns on the living room lights"
π§ MCP Tools Reference
Device Control
Tool | Description | Key Parameters |
| List all registered devices |
|
| Get current state of device(s) |
|
| Turn on with optional settings |
|
| Turn off device(s) |
|
| Set brightness 1β100% |
|
| Set hex color |
|
| Set color temperature |
|
| Generic command for any device |
|
Scene Management
Tool | Description | Key Parameters |
| Execute a named scene |
|
| List all available scenes | β |
| Create a new scene |
|
control_device Commands
For devices that go beyond on/off/brightness:
Command | For | Parameters |
| AC/Thermostat |
|
| AC |
|
| AC |
|
| Fan |
|
| Curtains |
|
| TV |
|
| TV |
|
| TV |
|
π― Target Resolution
Every tool that controls a device accepts a target string. The server resolves it using a layered fuzzy matcher:
Priority | Method | Example |
1 | Exact ID |
|
2 | Exact name |
|
3 | Group name |
|
4 | Room + type |
|
5 | Name substring |
|
This means you can say "bedroom lights" and it resolves to every bulb in the bedroom. Or "Kitchen Coffee Machine" for a single device. The assistant doesn't need to know device IDs.
π Adapters
Demo β src/adapters/demo.js
Status: β Works out of the box, no hardware needed.
Simulates 16 devices across 6 rooms with realistic state management. Every command updates in-memory state with a small random delay to simulate network latency.
Enabled by default.
WiZ β src/adapters/wiz.js
Protocol: Local UDP, port 38899 Supports: Power, brightness, RGB color, color temperature
WiZ bulbs are controlled over your local network via JSON-over-UDP. The adapter can either auto-discover bulbs via broadcast or use an explicit device list.
// src/config.js
wiz: {
enabled: true,
broadcast: "192.168.1.255", // for auto-discovery
timeout: 3000, // discovery timeout in ms
devices: [ // or list them explicitly
{
ip: "192.168.1.100",
name: "Bedroom WiZ Bulb",
room: "bedroom",
mac: "AA:BB:CC:DD:EE:FF", // optional
groups: ["bedroom lights"]
}
]
}Philips Hue β src/adapters/hue.js
Protocol: Local REST API via Hue Bridge Supports: Power, brightness, CIE xy color, color temperature (mirek)
Connects to your Hue bridge on the local network. You need the bridge IP and an API username.
Getting a Hue API username:
Press the physical button on your Hue bridge
Within 30 seconds, run:
curl -X POST http://<bridge-ip>/api -d '{"devicetype":"smart-house-mcp"}'Copy the
usernamefrom the response
// src/config.js
hue: {
enabled: true,
bridgeIp: "192.168.1.50",
username: "your-hue-api-username",
roomMap: { // optional: map Hue light IDs to rooms
"1": "bedroom",
"2": "living room"
},
groupMap: { // optional: map Hue light IDs to groups
"1": ["bedroom lights"],
"2": ["living room lights"]
}
}Tuya β src/adapters/tuya.js
Protocol: Tuya Open API v2.0 (cloud, HMAC-SHA256 auth) Supports: Power, brightness, HSV color, color temperature
Controls Tuya/Smart Life devices through the cloud API. Requires a Tuya IoT Platform developer account.
Getting Tuya credentials:
Sign up at iot.tuya.com
Create a Cloud Project
Link your Smart Life app account
Copy the Access ID (key) and Access Secret
// src/config.js
tuya: {
enabled: true,
accessKey: "your-access-id",
secretKey: "your-access-secret",
region: "us", // us | eu | cn | in
devices: [
{
id: "eb0f...", // Tuya device ID
name: "Smart Plug Kitchen",
room: "kitchen",
type: "plug", // bulb | plug | ac | curtain | fan
groups: ["kitchen appliances"]
}
]
}MQTT β src/adapters/mqtt.js
Protocol: MQTT (any broker β Mosquitto, EMQX, HiveMQ, etc.)
Supports: Anything β fully configurable per device
Requires: npm install mqtt
The most flexible adapter. Works with any MQTT-based device. Supports both simple string payloads ("ON"/"OFF") and structured JSON mode.
// src/config.js
mqtt: {
enabled: true,
brokerUrl: "mqtt://192.168.1.10:1883",
username: "mqttuser", // optional
password: "mqttpass", // optional
devices: [
{
id: "mqtt-garage-light",
name: "Garage Light",
room: "garage",
type: "bulb",
capabilities: ["power", "brightness"],
commandTopic: "home/garage/light/set",
stateTopic: "home/garage/light/state",
jsonMode: false, // false = simple strings, true = JSON payloads
payloadMap: { // custom payload strings (simple mode only)
turn_on: "ON",
turn_off: "OFF"
}
},
{
id: "mqtt-zigbee-bulb",
name: "Zigbee Bulb",
room: "office",
type: "bulb",
capabilities: ["power", "brightness", "color_temp"],
commandTopic: "zigbee2mqtt/office_bulb/set",
stateTopic: "zigbee2mqtt/office_bulb",
jsonMode: true // sends { "state": "ON", "brightness": 80 }
}
]
}Home Assistant β src/adapters/homeassistant.js
Protocol: Home Assistant REST API Supports: Lights, switches, fans, covers, climate, media players, sensors
The nuclear option. If HA already controls your devices, this adapter lets the MCP server talk through HA instead of directly to each brand. Supports auto-discovery of all entities or an explicit list.
Getting a HA long-lived access token:
Go to your HA instance β Profile β Security
Scroll to "Long-Lived Access Tokens"
Create one, copy it
// src/config.js
homeassistant: {
enabled: true,
url: "http://homeassistant.local:8123",
token: "eyJhbGciOiJI...",
// Option A: auto-discover all entities (no entities array)
// Option B: explicit list for better naming/grouping
entities: [
{
entity_id: "light.bedroom_ceiling",
name: "Bedroom Ceiling Light",
room: "bedroom",
type: "bulb",
groups: ["bedroom lights"]
},
{
entity_id: "climate.bedroom_ac",
name: "Bedroom AC",
room: "bedroom",
type: "ac",
groups: []
}
]
}π¬ Built-in Scenes
Scene | What Happens |
| All lights off, bedroom AC β 22Β°C, curtains closed, TV off |
| Curtains open, kitchen light β daylight 100%, coffee machine on, AC off |
| Living room β 10% warm, TV on HDMI1, other rooms off |
| Bedroom β daylight 100%, TV off |
| Bedroom + living room β 10-15% warm, floor lamp β orange, others off |
| Every single device in the house β off |
Creating Custom Scenes
Via the create_scene tool (the assistant can do this conversationally):
{
"name": "dinner party",
"description": "Warm ambiance for hosting",
"actions": [
{ "target": "kitchen lights", "command": "set_brightness", "params": { "brightness": 70 } },
{ "target": "Kitchen Light", "command": "set_color_temp", "params": { "color_temp": "warm" } },
{ "target": "living room lights", "command": "set_brightness", "params": { "brightness": 40 } },
{ "target": "Living Room Main Light", "command": "set_color_temp", "params": { "color_temp": "soft" } },
{ "target": "Living Room TV", "command": "turn_off" }
]
}ποΈ Demo Devices
The demo adapter ships with a full simulated house:
Room | Device | Type | Capabilities |
Bedroom | Ceiling Light | bulb | power, brightness, color, color_temp |
Nightstand Lamp | bulb | power, brightness, color_temp | |
Charger Plug | plug | power | |
AC | ac | power, temperature, mode, fan_speed | |
Curtains | curtain | power, position | |
Living Room | Main Light | bulb | power, brightness, color, color_temp |
Floor Lamp | bulb | power, brightness, color | |
TV | tv | power, volume, channel, source | |
Fan Plug | plug | power | |
Kitchen | Light | bulb | power, brightness, color_temp |
Coffee Machine | plug | power | |
Temperature Sensor | sensor | temperature, humidity | |
Bathroom | Light | bulb | power, brightness |
Exhaust Fan | fan | power, speed | |
Hallway | Motion Sensor | sensor | motion, luminance |
Garage | Door Opener | plug | power |
π§© Adding a Custom Adapter
Every adapter is a simple module with three functions:
// src/adapters/myvendor.js
module.exports = {
name: "myvendor",
/**
* Called once at startup. Discover devices and register them.
*/
async initialize(registry, config) {
// Talk to your vendor's API, discover devices, then:
registry.register({
id: "myvendor-001",
name: "Office Desk Lamp",
room: "office",
type: "bulb",
adapter: "myvendor",
groups: ["office lights"],
capabilities: ["power", "brightness", "color"],
state: { power: false, brightness: 100, color: "#ffffff" },
meta: {
// anything adapter-specific: IP, API key, device token, etc.
ip: "192.168.1.200",
deviceToken: "abc123"
}
});
},
/**
* Called for every command. Route to real hardware.
*/
async execute(device, command, params) {
const ip = device.meta.ip;
switch (command) {
case "turn_on":
await myVendorApi.setPower(ip, true);
device.state.power = true;
return { power: true };
case "turn_off":
await myVendorApi.setPower(ip, false);
device.state.power = false;
return { power: false };
case "set_brightness":
await myVendorApi.setBrightness(ip, params.brightness);
device.state.brightness = params.brightness;
device.state.power = true;
return { brightness: params.brightness };
case "set_color":
await myVendorApi.setColor(ip, params.color);
device.state.color = params.color;
device.state.power = true;
return { color: params.color };
case "get_state":
return { ...device.state };
default:
throw new Error(`unsupported: ${command}`);
}
},
/**
* Optional cleanup on shutdown.
*/
async disconnect() {
// close connections, etc.
}
};Then wire it in:
1. Add to config (src/config.js):
myvendor: {
enabled: true,
// your config here
}2. Load in server (src/index.js):
const adapterModules = {
// ... existing adapters
myvendor: require("./adapters/myvendor"),
};Done. The tool layer, scene engine, and target resolution all work automatically.
π Project Structure
Smart_House/
β
βββ src/
β βββ index.js # MCP server entry point β wires everything together
β βββ config.js # Adapter configuration β enable/disable, set credentials
β β
β βββ core/
β β βββ device-registry.js # Central device store, queries, fuzzy target resolution
β β βββ adapter-manager.js # Loads adapters, routes commands to the right one
β β βββ scene-engine.js # Scene storage, batch execution
β β
β βββ adapters/
β β βββ demo.js # 16 simulated devices, 6 rooms (no hardware)
β β βββ wiz.js # WiZ bulbs β local UDP, port 38899
β β βββ hue.js # Philips Hue β local REST via bridge
β β βββ tuya.js # Tuya/Smart Life β cloud API v2.0
β β βββ mqtt.js # Generic MQTT β any broker, any device
β β βββ homeassistant.js # Home Assistant β REST API, auto-discovery
β β
β βββ tools/
β β βββ tools.js # 11 MCP tool definitions with Zod schemas
β β
β βββ devices/
β βββ default-scenes.js # 6 pre-built scenes
β
βββ tests/
β βββ run.js # 38 integration tests (runs against demo adapter)
β
βββ package.json
βββ README.mdπ§ͺ Running Tests
npm testTests exercise the full pipeline without MCP transport β registry, resolution, all 11 tools, scene execution, and error handling. No hardware or network required.
π Color Temperature Reference
Name | Kelvin | Vibe |
| 2700K | Cozy, candlelight |
| 3000K | Relaxed, warm white |
| 3500K | Natural, balanced |
| 4000K | Alert, clean |
| 5000K | Bright, productive |
| 6500K | Blue-white, clinical |
π Device Canonical Shape
Every device in the registry follows this shape, regardless of which adapter registered it:
{
id: "demo-bed-bulb-1", // unique identifier
name: "Bedroom Ceiling Light", // human-friendly name
room: "bedroom", // room assignment
type: "bulb", // bulb|plug|ac|tv|curtain|sensor|fan|switch|thermostat
adapter: "demo", // which adapter owns this device
groups: ["bedroom lights"], // arbitrary grouping tags
capabilities: ["power","brightness","color","color_temp"], // what it can do
state: { // current known state
power: false,
brightness: 100,
color: "#ffffff",
color_temp: "daylight"
},
meta: { // adapter-specific data
simulated: true // (ip, mac, entity_id, topic, etc.)
}
}π License
ISC
Available Tools
11 toolscontrol_deviceB
Generic device control β send any command with arbitrary params. Use for AC (set_temperature, set_mode), TV (set_volume, set_channel, set_source), curtains (set_position), fans (set_speed), etc.
Inputs: target (required), command (required), params.
create_sceneC
Create a new scene with a list of actions.
Inputs: name (required), actions (required), description.
get_stateB
Get the current state of a device or group of devices. Accepts device id, name, room+type, or group name.
Inputs: target (required).
list_devicesA
List all smart home devices. Optionally filter by room, type, group, or adapter.
Inputs: room, type, group, adapter.
list_scenesB
List all available scenes.
Inputs: no named parameters.
run_sceneB
Run a predefined scene (e.g. 'movie night', 'goodnight', 'morning').
Inputs: scene (required).
set_brightnessB
Set the brightness of a device or group (1-100). Turns device on automatically.
Inputs: target (required), brightness (required).
set_colorA
Set the color of a device or group using a hex color code. Turns device on automatically.
Inputs: color (required), target (required).
set_color_tempB
Set the color temperature of a device or group. Options: warm, soft, neutral, cool, daylight, bright. Turns device on automatically.
Inputs: target (required), color_temp (required).
turn_offB
Turn off a device or group of devices.
Inputs: target (required).
turn_onA
Turn on a device or group of devices. Optionally set brightness, color, and color_temp in the same command.
Inputs: target (required), color, brightness, color_temp.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 11 tools
Each tool has a clear primary role: on/off, attribute setters, generic control, and scene management. The only real overlap is that control_device is a catch-all that could also do brightness/color, and turn_on accepts brightness/color params that duplicate set_brightness/set_color, but the descriptions steer toward the dedicated tools for common cases.
All 11 tools are lowercase snake_case with a verb-first pattern (turn_on, list_devices, get_state, set_color, run_scene, create_scene), and the paired turn_on/turn_off are symmetric. No mixed casing or stylistic drift anywhere in the set.
11 tools is squarely in the well-scoped range for a smart home controller. Convenience wrappers (set_brightness, set_color, set_color_temp) plus an escape hatch (control_device) plus scene management is a reasonable, non-bloated surface.
Core lifecycle is covered: discovery (list_devices), state inspection (get_state), actuation (on/off/attribute setters/generic control), and scene list/run/create. Scene management is asymmetric though β there is create_scene but no update_scene or delete_scene β and there is no tool for device/group configuration, which agents will have to work around.
Maintenance
Related MCP Connectors
Control your existing Philips lights, Sonos speakers, Roborock vacuums and other supported devices through Port OS cloud. Give ChatGPT, Claude and other MCP-compatible assistants access to the devices you connect. Turn off the living room lights, play music on your speakers, adjust the thermostat, run a vacuum in a room, check a camera snapshot or find a connected tracker. Available actions depend on your linked provider accounts and each deviceβs supported capabilities. Port OS runs in the cloud; no local server is required. You choose the account, device and capability permissions each assistant receives. Device operations require user OAuth; public tool discovery does not grant device access. Port OS is in alpha. Setup: https://portoperatingsystem.com/docs/getting-started/ Support: https://portoperatingsystem.com/contact/
Connect your AI to your own devices, 3D printers, factory tools and a shared agent task pool.
Home energy for AI assistants: live Power flow, Energy history, solar forecast, and device control.
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to control Philips Hue smart lighting systems, including individual lights, groups, scenes, brightness, and color adjustments through natural language commands.-
- AlicenseAqualityDmaintenanceEnables AI assistants to control Tuya/Smart Life smart home devices via tools like on/off, brightness, color, and custom commands.1053 PyPI1MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to control Govee smart devices, including lights, via natural language. Supports turning on/off, changing colors, adjusting brightness, and activating scenes through the Govee API or local network.91MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to discover and control IoT devices on local networks and via Bluetooth LE.71MIT