echonetlite-mcp
README.md
# echonetlite-mcp
[](https://www.npmjs.com/package/echonetlite-mcp)
[](https://opensource.org/licenses/MIT)
[](https://nodejs.org/)
[](https://www.typescriptlang.org/)
An MCP (Model Context Protocol) server for **ECHONETLite** home automation ā control air conditioners, discover devices, and read sensors via the Model Context Protocol.
> ECHONETLite is a Japanese IoT protocol widely used in smart home devices, particularly HVAC systems by major manufacturers like Daikin, Panasonic, Mitsubishi Electric, and Toshiba.
## Features
- š”ļø **Real-time HVAC monitoring** ā temperature, humidity, operating status
- āļø **Full climate control** ā mode, fan speed, airflow direction, swing
- š **Network device discovery** ā find ECHONETLite devices via multicast UDP
- š¬ **Node Profile probing** ā discover manufacturer, product code, UID, and all EOJ instances on any device
- ā” **Real-time notifications** ā async updates from device multicast listeners
- š **MRA enrichment** ā Machine Readable Index integration for property names, descriptions, and value decoding
- š¬ **EPC introspection** ā query property maps (STATMAP/SETMAP/GETMAP) with MRA-based names
- š·ļø **Human-readable values** ā raw EPC values decoded to human-friendly format using MRA definitions
- š§© **EPC element parsing** ā parse complex object/array-type EPC values into named elements with MRA definitions
- šÆ **Multi-EPC queries** ā query multiple EPC codes in a single request
- š§ **Generic EOJ support** ā set/query any ECHONETLite object by group/class/instance codes
- š¦ **TypeScript-first** ā full type definitions included
- š **MCP compatible** ā works with any MCP client (Claude Desktop, LM Studio, VS Code extensions, etc.)
## Prerequisites
- Node.js 18+
- An ECHONETLite-compatible device on the same local network
## Installation
```bash
npm install echonetlite-mcp
```
Or use it as an MCP server directly:
```bash
git clone https://github.com/scottyphillips/echonetlite-mcp.git
cd echonetlite-mcp
npm install
npm run build
```
## Configuration
The server defaults to communicating with a device at `192.168.1.6` on UDP port 3610, using multicast address `224.0.23.0:3610` for discovery and notifications.
### Setting the Default Device IP
**Option A: Environment variable (recommended)**
```bash
# Windows CMD
set ECHONET_DEFAULT_HOST=192.168.1.10 && node dist/index.js
# PowerShell
$env:ECHONET_DEFAULT_HOST="192.168.1.10"; node dist/index.js
# Linux/macOS
ECHONET_DEFAULT_HOST=192.168.1.10 node dist/index.js
```
**Option B: Edit config.ts**
```typescript
export const DEFAULT_HOST = '192.168.1.10'; // Change to your device IP
```
### Lite Mode (Restricted Tool Set)
Enable **Lite Mode** to restrict exposed tools to a minimal subset. In lite mode, only these 6 tools are available:
| Tool | Description |
|------|-------------|
| `discover_devices` | Discover all ECHONETLite devices on the local network |
| `discover_nodes` | Active Node Profile probing of a specific device |
| `set_epc` | Generic EPC setter for any EOJ instance |
| `get_property_maps` | Query STATMAP/SETMAP/GETMAP with MRA names |
| `query_epc` | Query EPC codes from device with decoded values |
| `get_epc_definition` | Get MRA definition for EPC codes without querying |
All HVAC-specific tools (`get_device_status`, `set_operation`, `set_temperature`, etc.) are hidden in lite mode.
**Enable Lite Mode:**
```bash
# Windows CMD
set ECHONET_LITE_MODE=true && node dist/index.js
# PowerShell
$env:ECHONET_LITE_MODE="true"; node dist/index.js
# Linux/macOS
ECHONET_LITE_MODE=true node dist/index.js
```
When lite mode is enabled, the server logs `(Mode: LITE)` on startup. When disabled (default), it logs `(Mode: FULL)` with all tools available.
### Per-Tool Override
Every tool accepts an optional `host` parameter to override the default for that specific call:
```json
{ "name": "get_device_status", "arguments": { "host": "192.168.1.20" } }
```
## Running the Server
```bash
# Build first
npm run build
# Run (stdio transport)
node dist/index.js
```
The server communicates via stdio, making it compatible with any MCP client.
## Integration with AI Clients
### Claude Desktop
Add to your Claude Desktop MCP configuration (`claude_desktop_config.json`):
```json
{
"mcpServers": {
"echonetlite": {
"command": "node",
"args": ["/path/to/echonetlite-mcp/dist/index.js"],
"env": {
"ECHONET_DEFAULT_HOST": "192.168.1.6"
}
}
}
}
```
### LM Studio
LM Studio supports MCP servers via stdio transport. Create or edit the MCP config file:
**Windows:** `%APPDATA%\lm-studio\mcp_config.json`
**macOS/Linux:** `~/.config/lm-studio/mcp_config.json`
```json
{
"mcpServers": {
"echonetlite-mcp": {
"command": "node",
"args": ["C:\\path\\to\\echonetlite-mcp\\dist/index.js"],
"env": {
"ECHONET_DEFAULT_HOST": "192.168.1.6"
}
}
}
}
```
### VS Code MCP Extension
Configure in your VS Code MCP extension settings:
```json
{
"mcp.servers": [
{
"name": "echonetlite",
"command": "node",
"args": ["/path/to/echonetlite-mcp/dist/index.js"],
"env": {
"ECHONET_DEFAULT_HOST": "192.168.1.6"
}
}
]
}
```
## Available Tools
> **Note:** When `ECHONET_LITE_MODE=true`, only `discover_devices`, `discover_nodes`, `set_epc`, `get_property_maps`, `query_epc`, and `get_epc_definition` are available.
### Device Discovery
| Tool | Description | Parameters |
|------|-------------|------------|
| `discover_devices` | Discover all ECHONETLite devices on the local network via multicast | `timeout` (optional) - Discovery timeout in ms (default: 3000) |
| `discover_nodes` | Active Node Profile probing of a specific device ā discovers manufacturer, product code, UID, and all EOJ instances with MRA enrichment | `host` (required), `timeout` (optional) |
### HVAC Control (Full Mode Only)
| Tool | Description | Parameters |
|------|-------------|------------|
| `get_device_status` | Get full status of the HVAC device | `host` (optional) - IP address |
| `set_operation` | Turn HVAC ON or OFF | `host`, `operation` ("on" / "off") |
| `set_operating_mode` | Set operating mode | `host`, `mode` ("auto" / "cool" / "heat" / "dry" / "fan_only") |
| `set_temperature` | Set target temperature | `host`, `temperature` (0-50°C) |
| `set_fan_speed` | Set air flow rate | `host`, `speed` ("auto" / "level1"-"level8") |
| `set_airflow_vertical` | Set vertical vane position | `host`, `position` ("upper" / "upper-central" / "central" / "lower-central" / "lower") |
| `set_airflow_horizontal` | Set horizontal vane position | `host`, `position` (28 positions: rc-right, left-lc, lc-center-rc, ...) |
| `set_swing_mode` | Set swing mode function | `host`, `mode` ("not-used" / "vert" / "horiz" / "vert-horiz") |
| `set_auto_direction` | Set automatic direction mode | `host`, `mode` ("auto" / "non-auto" / "auto-vert" / "auto-horiz") |
| `set_silent_mode` | Set silent operation mode | `host`, `mode` ("normal" / "high-speed" / "silent") |
| `set_power_saving` | Set power-saving mode | `host`, `state` ("saving" / "normal") |
### Sensor Readings (Full Mode Only)
| Tool | Description | Parameters |
|------|-------------|------------|
| `get_temperatures` | Get room + outdoor temperatures | `host` (optional) - IP address |
| `get_humidity` | Get room humidity | `host` (optional) - IP address |
### EPC Introspection & MRA Lookup (Available in All Modes)
| Tool | Description | Parameters |
|------|-------------|------------|
| `get_property_maps` | Query STATMAP/SETMAP/GETMAP with MRA-based property names and descriptions | `host`, `eojgc`, `eojcc`, `eojInstance` (all optional) |
| `query_epc` | Query one or more EPC codes from device, returns raw + human-readable decoded values | `epcs` (required), `host`, `eojgc`, `eojcc`, `eojInstance` (all optional) |
| `get_epc_definition` | Get MRA definition for EPC codes without querying the device ā includes enum values, bitmaps, level ranges, $ref-resolved definitions | `epcs` (required), `host`, `eojgc`, `eojcc`, `eojInstance` (all optional) |
| `set_epc` | Generic EPC setter ā set any writable property on any EOJ instance by hex value | `host`, `eojgc`, `eojcc`, `eojInstance`, `epc`, `value` |
| `parse_epc_elements` | Parse object/array-type EPC values into named elements with raw hex bytes per element ā use after querying EPC data (e.g., 0xE2) to get structured breakdown | `epc` (required), `rawHex` (required), `host`, `eojgc`, `eojcc`, `eojInstance`, `propertyName`, `shortName` (all optional) |
## Available Resources
| Resource URI | Description |
|-------------|-------------|
| `device://status` | Current HVAC status (updated via async notifications from multicast listener) |
| `device://capabilities` | Device property map (GETMAP, SETMAP, NTFMAP) |
## EPC Reference Table
| EPC | Property | Access | Values |
|-----|----------|--------|--------|
| 0x80 | Operation status | Set/Get | 0x30=ON, 0x31=OFF |
| 0x8F | Power-saving operation | Set/Get | Saving/Normal |
| 0xA0 | Air flow rate (fan speed) | Set/Get | Auto=0x41, Levels=0x31-0x38 |
| 0xA1 | Automatic airflow direction | Set/Get | Auto/Non-auto/Auto-vert/Auto-horiz |
| 0xA3 | Air swing mode | Set/Get | Not-used/Vert/Horiz/Vert-horiz |
| 0xA4 | Airflow direction (vertical) | Set/Get | Upper/Upper-central/Central/Lower-central/Lower |
| 0xA5 | Airflow direction (horizontal) | Set/Get | 28 positions (rc-right, left-lc, center, etc.) |
| 0xB0 | Operation mode | Set/Get | Auto=0x41, Cool=0x42, Heat=0x43, Dry=0x44, Fan-only=0x45 |
| 0xB1 | Automatic temperature control | Set/Get | ā |
| 0xB2 | Normal/High-speed/Silent operation | Set/Get | ā |
| 0xB3 | Set temperature | Set/Get | 0-50°C (signed int) |
| 0xB4 | Set humidity in dehumidifying mode | Set/Get | ā |
| 0xBA | Room relative humidity | Get | Percentage |
| 0xBB | Room temperature | Get | -127 to 125°C (signed int) |
| 0xBE | Outdoor air temperature | Get | Signed int |
| 0xC0 | Ventilation function | Set/Get | ā |
| 0xC1 | Humidifier function | Set/Get | ā |
| 0xCC | Special function setting | Set/Get | Clothes dryer, Mite/mold control, etc. |
| 0xCF | Air purification mode | Set/Get | ā |
| 0x9D | STATMAP (access capability) | Get | Property access map |
| 0x9E | SETMAP (settable properties) | Get | Settable property map |
| 0x9F | GETMAP (readable properties) | Get | Readable property map |
## Example Prompts
Try these natural language prompts with your MCP client:
- `"Turn on my air conditioner"` ā calls `set_operation` with `operation="on"` (Full Mode)
- `"Set temperature to 23 degrees"` ā calls `set_temperature` with `temperature=23`
- `"Switch to cooling mode"` ā calls `set_operating_mode` with `mode="cool"`
- `"What are the current temperatures?"` ā calls `get_temperatures`
- `"Find all ECHONET devices on my network"` ā calls `discover_devices`
- `"Set fan speed to level 3"` ā calls `set_fan_speed` with `speed="level3"`
- `"What EPC codes can I query on this device?"` ā calls `get_property_maps`
- `"Get the current operation status and target temperature"` ā calls `query_epc` with `epcs=["0x80", "0xB3"]`
- `"What settings are available for operating mode?"` ā calls `get_epc_definition` with `epcs=["0xB0"]`
- `"Discover all nodes on 192.168.1.6"` ā calls `discover_nodes` with full MRA enrichment
- `"Parse the EPC 0xE2 value 0x00 0x0A 0xFF 0xFF for EOJ 0x02 0x88 0x01"` ā calls `parse_epc_elements` to split raw bytes into named elements
## Project Structure
```
echonetlite-mcp/
āāā src/
ā āāā index.ts # MCP server entry point & tool definitions (~1200 lines)
node dist/index.js
```
## MRA Integration
This server includes full MRA (Machine Readable Index) data integration:
- **Property names & descriptions** ā human-readable labels for each EPC code from MRA definitions
- **Value decoding** ā raw hex values decoded to meaningful strings/numbers using MRA type schemas
- **Enum/bitmap support** ā full enumeration of possible values with $ref resolution
- **Level ranges & number formats** ā signed/unsigned integers, fixed-point decimals
- **$ref resolution** ā external definition references from definitions.json resolved automatically
- **MRA enrichment in all tools** ā `query_epc`, `get_property_maps`, `get_epc_definition` return enriched responses
The MRA data enables intelligent discovery of what settings are available for any EPC code without needing to query the device first.
## References
- [ECHONETLite Standard Spec](https://echonet.jp/)
- [MCP Specification](https://modelcontextprotocol.io/)
- [node-echonet-lite](https://github.com/futomi/node-echonet-lite)
- [pychonet](https://github.com/scottyphillips/pychonet)
## License
MIT License ā see [LICENSE](LICENSE) for details.
## Support
For issues, questions, or contributions, please open an issue on [GitHub](https://github.com/scottyphillips/echonetlite-mcp/issues).
[](https://www.buymeacoffee.com/RgKWqyt)
TDQS
B3.4/5.0
Scored across 14 tools
Disambiguation5/5
Each tool targets a distinct aspect of the air conditioner: discovery, status retrieval, humidity, temperatures, and various control parameters. There is no overlap or ambiguity.
Naming Consistency5/5
All tool names follow a consistent pattern: verb_noun using snake_case (e.g., discover_devices, get_status, set_temperature). The verbs (discover, get, set) are uniform and clear.
Tool Count5/5
14 tools cover essential operations for an air conditioner without being excessive. The scope is well-defined for a home automation HVAC control server.
Completeness5/5
The set covers all core CRUD-like operations: discovery, status reading, temperature/humidity sensing, and full control (on/off, mode, fan, airflow, power saving, silent). No obvious missing functionality.
Maintenance
ActivityInactive
ResponsivenessNo issues