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
Start the Server
When installed via npm:
When running from source:
Server runs at:
MCP Endpoint:
http://localhost:3000/mcp
Health 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. Create a .env
file in your project root or set system-wide environment variables:
Quick Test
๐ก MCP Tools
Network Discovery
scan_network
Automatically scan your network for Plugwise hubs using passwords from .env
.
Features:
Tests known IPs first if
HUBxIP
variables are provided (instant)Falls back to full network scan if needed (1-2 minutes)
Stores credentials automatically for later use
connect
Connect to a Plugwise gateway. After scanning, credentials are automatic!
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
.env
file only (never in code)Git Ignore:
.env
is in.gitignore
to 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
.env
file 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_objects
Ensure gateway isn't overloaded with requests
Scan Takes Too Long
Add
HUBxIP
variables to.env
for instant scanningSpecify network:
scan_network({ network: '192.168.1.0/24' })
Check network size (scanning /16 is much slower than /24)
๐ค 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
๐ Credits
Based on the excellent python-plugwise library.
๐ License
MIT License - See LICENSE file for details
๐ Version
Current version: 1.0.0
โ Full MCP protocol support
โ Automatic network scanning
โ Multi-hub management
โ Complete device control
โ Comprehensive documentation
This server cannot be installed
Enables control and monitoring of Plugwise smart home devices including thermostats, switches, and energy meters with automatic network discovery. Supports temperature control, energy monitoring, and multi-hub management through natural language commands.