A Model Context Protocol (MCP) server for integrating with Homey Pro smart home system. This server provides access to Homey devices, zones, variables, and logic through the MCP protocol.
- Devices: Retrieve and search all Homey devices
- Zones: List all zones in your home
- Variables: Access to Homey variables
- Logic: Retrieve information about logic flows
- Temperature: Specialized functions for temperature sensors
- Cache: Automatic data caching for better performance
homey-mcp/
├── src/ # Main source code
│ ├── server.js # MCP server main file
│ ├── homey.js # Homey API client
│ ├── entities.js # Data models (Device, Zone, Variable, etc.)
│ └── index.js # Standalone test script
├── scripts/ # Test and verification scripts
│ ├── test-mcp.sh # Main test script
│ ├── verify-mcp.sh # Quick verification
│ ├── test-temperature.sh # Test temperature functions
│ ├── interactive-test.sh # Interactive testing
│ ├── status-check.sh # Status check
│ └── final-verification.sh # Comprehensive test
├── config/ # Configuration files
│ └── .env.example # Example environment variables
├── cache/ # Cache files (auto-generated)
│ ├── devices.json
│ ├── zones.json
│ ├── variables.json
│ └── logic.json
├── .env # Your environment variables
├── package.json
├── claude_desktop_config.json # Claude Desktop configuration
└── README.md
git clone <repository-url>
cd homey-mcp
npm installCopy the example file and fill in your values:
cp config/.env.example .envEdit .env and add:
HOMEY_TOKEN: Your Homey API token (get this from Homey Developer Tools)HOMEY_ID: Your Homey ID (found in Homey Pro settings)
# Test basic functionality
npm start
# Test MCP server
npm run mcpThe server can be used with Claude Desktop or other MCP-compatible clients:
npm run mcpFor testing and development:
npm startAdd the following to your claude_desktop_config.json:
{
"mcpServers": {
"homey": {
"command": "node",
"args": ["/path/to/homey-mcp/src/server.js"],
"env": {
"HOMEY_TOKEN": "your_token_here",
"HOMEY_ID": "your_homey_id_here"
}
}
}
}Get all devices or filter by zone.
Parameters:
zone(optional): Filter devices by zone name
Search for devices based on name or properties.
Parameters:
query: Search text
Get all zones in the home.
Get all Homey variables.
Get information about logic flows.
Get temperature data from sensors.
Parameters:
zone(optional): Filter by zonedeviceId(optional): Get from specific device
The project includes several test scripts in the scripts/ folder:
# Quick verification
./scripts/verify-mcp.sh
# Comprehensive testing
./scripts/test-mcp.sh
# Test temperature functions
./scripts/test-temperature.sh
# Interactive testing
./scripts/interactive-test.sh
# Status check
./scripts/status-check.sh
# Final verification
./scripts/final-verification.sh- @modelcontextprotocol/sdk: MCP SDK for server implementation
- dotenv: Environment variable management
- API tokens and sensitive data are stored in the
.envfile - Cache files may contain sensitive data and are excluded from git
- Use
.copilotignoreto exclude sensitive files from AI assistance
- Implement the logic in
src/homey.js - Add MCP tool definition in
src/server.js - Update entities in
src/entities.jsif necessary - Create tests in the
scripts/folder
The server uses automatic caching to reduce API calls to Homey:
- Cache is stored in the
cache/folder - Cache can be enabled/disabled via options
- Cache files are updated automatically when needed
- Check that the
.envfile is correctly configured - Verify that Homey Pro is available and online
- Confirm that the API token has necessary permissions
- Run test scripts to diagnose problems
- MCP compatibility: Debug messages have been removed from the server to ensure clean JSON communication with Claude Desktop
- "Unexpected token" error in Claude: This is caused by debug output to stdout. All console.log/debug messages have been removed from the MCP server.
- Cache problems: Delete the
cache/folder and let the server regenerate the cache files. - Environment variable problems: Check that the
.envfile is in the root folder and contains correct values.
MIT License