Provides control and monitoring of Plugwise smart home devices including thermostats, smart plugs, radiator valves, motion sensors, and energy monitoring gateways through automatic network discovery and real-time device state management.
Plugwise MCP Server
A TypeScript-based Model Context Protocol (MCP) server for Plugwise smart home integration with automatic network discovery.
β¨ Key Features
π Automatic Network Scanning: Discovers all Plugwise hubs on your network
π Credential Management: Stores hub passwords securely from .env file
π Device Control: Control thermostats, switches, and smart plugs
π‘οΈ Temperature Management: Set temperatures, presets, and schedules
π Energy Monitoring: Read power consumption and sensor data
π Multi-Hub Support: Manage multiple gateways simultaneously
π Real-time Updates: Get current device states and measurements
π Quick Start
Installation via npm (Recommended)
Install globally to use with any MCP client:
Or use directly with npx (no installation needed):
Installation from Source
Prerequisites
Node.js 17 or higher
npm or yarn
Plugwise gateway (Adam, Anna, Smile P1, or Stretch)
Quick Test
Test the installation without real hardware using mock mode:
Or with real hardware:
See Quick Test Guide for more options.
Start the Server
When installed via npm:
When running from source:
Server runs at:
MCP Endpoint:
http://localhost:3000/mcpHealth Check:
http://localhost:3000/health
π Adding the MCP Server to Your Client
The Plugwise MCP server can work with any MCP client that supports standard I/O (stdio) as the transport medium. Here are specific instructions for some popular tools:
Claude Desktop
To configure Claude Desktop to use the Plugwise MCP server, edit the claude_desktop_config.json file. You can open or create this file from the Claude > Settings menu. Select the Developer tab, then click Edit Config.
Cline
To configure Cline to use the Plugwise MCP server, edit the cline_mcp_settings.json file. You can open or create this file by clicking the MCP Servers icon at the top of the Cline pane, then clicking the Configure MCP Servers button.
Cursor
To configure Cursor to use the Plugwise MCP server, edit either the file .cursor/mcp.json (to configure only a specific project) or the file ~/.cursor/mcp.json (to make the MCP server available in all projects):
Visual Studio Code Copilot
To configure a single project, edit the .vscode/mcp.json file in your workspace:
To make the server available in every project you open, edit your user settings:
Windsurf Editor
To configure Windsurf Editor, edit the file ~/.codeium/windsurf/mcp_config.json:
Environment Variables
The server reads hub passwords from environment variables. You can provide these in two ways:
Option 1: MCP Configuration (Recommended)
Add the env field directly to your MCP client configuration as shown in the examples above.
Option 2: .env File
Create a .env file in your project root or set system-wide environment variables:
Security Note: When using the MCP configuration env field, credentials are passed securely to the server process. For enhanced security, consider using .env files which are typically excluded from version control.
Quick Test
π‘ MCP Tools
Network Discovery
connect
Connect to a Plugwise gateway.
Device Management
get_devices
Get all devices and their current states.
Climate Control
set_temperature
Set thermostat temperature setpoint.
set_preset
Change thermostat preset mode.
Device Control
control_switch
Turn switches/plugs on or off.
Gateway Management
set_gateway_mode: Set gateway mode (home, away, vacation)set_dhw_mode: Set domestic hot water mode (auto, boost, comfort, off)set_regulation_mode: Set heating regulation modedelete_notification: Clear gateway notificationsreboot_gateway: Reboot the gateway (use with caution)
MCP Resources
plugwise://devices: Access current state of all devices as a resource
MCP Prompts
setup_guide: Get comprehensive step-by-step setup instructions
π§ͺ Testing
Comprehensive Read-Only Test Suite
This runs a complete test of all read-only MCP operations:
β Server health check
β MCP protocol initialization
β Network scanning for hubs
β Gateway connection and info retrieval
β Device state reading
β Resources and prompts
Safe: Only tests read operations, never changes device states.
See Test Documentation for details.
Complete Workflow Demo
This demonstrates:
β Network scanning with .env passwords
β Auto-connection without credentials
β Device discovery and listing
β Multi-hub management
Network Scanning Test
Full MCP Test Suite
Bash Script for Hub Discovery
ποΈ Supported Devices
Gateways
Adam: Smart home hub with OpenTherm support (thermostat control, floor heating)
Anna: Standalone thermostat gateway
Smile P1: Energy monitoring gateway (electricity, gas, solar)
Stretch: Legacy hub for connecting Circle smart plugs
Connected Devices
Jip: Motion sensor with illuminance detection
Lisa: Radiator valve (requires hub)
Tom/Floor: Floor heating controller
Koen: Radiator valve (requires a Plug as intermediary)
Plug: Smart plug with power monitoring (Zigbee)
Aqara Plug: Third-party Zigbee smart plug
Circle: Legacy Circle/Circle+ plugs (via Stretch only)
π Documentation
Setup Guide - Detailed setup instructions
MCP Server Documentation - Complete API reference
Network Scanning Guide - Network discovery deep dive
Network Scanning Summary - Feature overview
π§ Development
Development Mode
Run with hot-reload:
Build
Compile TypeScript to JavaScript:
Project Structure
π Security
Password Storage: Store passwords in
.envfile only (never in code)Git Ignore:
.envis in.gitignoreto prevent committing secretsNetwork Security: Plugwise uses HTTP Basic Auth (not HTTPS)
Keep gateways on secure local network
Use VPN for remote access
Consider separate VLAN for IoT devices
API Access: The API has full control over your heating system - restrict access accordingly
π Troubleshooting
No Hubs Found During Scan
Check
.envfile hasHUB1,HUB2, etc. definedVerify passwords are correct (case-sensitive, check gateway sticker)
Ensure gateways are powered on and connected to network
Confirm you're on the same network as the hubs
Try:
ping <gateway_ip>to test connectivity
Connection Errors
Verify IP address is correct
Check firewall isn't blocking port 80
Test with manual connection:
curl http://<ip>/core/domain_objectsEnsure gateway isn't overloaded with requests
π€ Integration Examples
Using with Claude Code
Using with VS Code Copilot
Add to .vscode/mcp.json:
Using MCP Inspector
Connect to: http://localhost:3000/mcp
π Example Workflows
Morning Routine
Energy Monitoring
Multi-Hub Management
π Documentation
Migration Guides
Structure Migration Plan - Complete plan for restructuring project
Structure Comparison - Visual comparison of architectures
Migration Checklist - Step-by-step migration checklist
Migration Summary - Quick reference summary
Architecture & Design
Architecture Diagram - System architecture overview
Code Organization - Project structure and conventions
Reorganization Overview - Historical reorganization notes
Implementation Guides
Autoload Hubs - Automatic hub loading implementation
Network Scanning - Network discovery implementation
Temperature Tools - Temperature control features
Sensor & Switch Parsing - Device parsing logic
Quick References
Quick Reference - Common commands and patterns
Autoload Quick Reference - Autoload feature guide
Temperature Tools Quick Reference - Temperature API guide
Testing & Development
Quick Test Guide - Fast start testing guide
Test Scripts Documentation - Comprehensive testing documentation
Test All Script - HTTP-based testing guide
Multi-Hub Testing - Testing with multiple hubs
List Devices Script - Device enumeration guide
Publishing & Setup
Publishing Guide - How to publish to npm
Setup Guide - Initial setup instructions
Publish Checklist - Pre-publish verification
π Credits
Based on the excellent python-plugwise library.
Architectural patterns inspired by sonos-ts-mcp.
π License
MIT License - See LICENSE file for details
π Version
Current version: 1.0.2
β Full MCP protocol support
β Automatic network scanning
β Multi-hub management
β Complete device control
β Comprehensive documentation
β Structure migration planning
This server cannot be installed