Bridging Loxone home automation with the Model Context Protocol ecosystem through high-performance Rust implementation
A Model Context Protocol (MCP) server that enables programmatic control of Loxone home automation systems. This implementation provides comprehensive device control through 17 specialized tools and 25+ resources, supporting both stdio (for Claude Desktop) and HTTP transports.
- Comprehensive Control: 17 MCP tools for device control + 25+ resources for data access
- MCP Compliant: Proper separation of tools (actions) and resources (read-only data)
- Multiple Transports: stdio for Claude Desktop, HTTP/SSE for web integrations
- Enhanced Security: Framework-based authentication with advanced features
- Performance Optimized: Connection pooling, intelligent caching, batch operations
- Framework Integration: Built on PulseEngine MCP framework for standardized protocol handling
- Rust 1.70 or higher
- Loxone Miniserver (Gen 1 or Gen 2)
- Network access to Miniserver
git clone https://github.com/avrabe/mcp-loxone
cd mcp-loxone
cargo build --release
-
Quick Setup with Credential ID:
# Interactive setup with ID generation cargo run --bin loxone-mcp-setup --generate-id --name "Main House" # Store credentials manually cargo run --bin loxone-mcp-auth store \ --name "Office" \ --host 192.168.1.100 \ --username admin \ --password secure123
-
Manage Multiple Servers:
# List stored credentials cargo run --bin loxone-mcp-auth list # Test connections cargo run --bin loxone-mcp-auth test <credential-id>
-
Basic Setup:
cargo run --bin loxone-mcp-setup
-
Environment variables:
export LOXONE_HOST="http://192.168.1.100" export LOXONE_USER="your-username" export LOXONE_PASS="your-password"
-
Production with Infisical (optional):
export INFISICAL_PROJECT_ID="your-project-id" export INFISICAL_CLIENT_ID="your-client-id" export INFISICAL_CLIENT_SECRET="your-client-secret" export INFISICAL_ENVIRONMENT="production"
If you're currently using environment variables, see the Credential Migration Guide for step-by-step instructions to migrate to the new Credential ID system.
{
"mcpServers": {
"loxone": {
"command": "/path/to/loxone-mcp-server",
"args": ["stdio", "--credential-id", "abc123def-456-789"]
}
}
}
{
"mcpServers": {
"loxone": {
"command": "/path/to/loxone-mcp-server",
"args": ["stdio"],
"env": {
"LOXONE_HOST": "192.168.1.100",
"LOXONE_USER": "admin",
"LOXONE_PASS": "password"
}
}
}
}
cargo run --bin loxone-mcp-server http --port 3001 --credential-id abc123def-456-789
cargo run --bin loxone-mcp-server http --port 3001
# Test with credential ID
cargo run --bin loxone-mcp-auth test <credential-id>
# Or list available credentials
cargo run --bin loxone-mcp-auth list
The server implements 17 tools for actions and 25+ resources for data access:
- Device Control:
control_device
,control_multiple_devices
- Lighting:
control_lights_unified
,control_all_lights
,control_room_lights
- Blinds/Rolladen:
control_rolladen_unified
,control_all_rolladen
,control_room_rolladen
,discover_rolladen_capabilities
- Climate:
set_room_temperature
,set_room_mode
- Audio:
control_audio_zone
,set_audio_volume
- Security:
arm_alarm
,disarm_alarm
- Workflows:
create_workflow
,execute_workflow_demo
- Rooms:
loxone://rooms
,loxone://rooms/{room}/devices
,loxone://rooms/{room}/overview
- Devices:
loxone://devices/all
,loxone://devices/category/{category}
,loxone://devices/type/{type}
- System:
loxone://system/status
,loxone://system/capabilities
,loxone://system/categories
- Sensors:
loxone://sensors/door-window
,loxone://sensors/temperature
,loxone://sensors/motion
- Audio:
loxone://audio/zones
,loxone://audio/sources
- And more... (weather, energy, security, climate)
Full tool documentation β | Resource documentation β
The server uses an async Rust architecture with:
- Transport Layer: Supports stdio and HTTP/SSE
- Tool Layer: Modular tool implementations
- Client Layer: HTTP and WebSocket clients for Miniserver communication
- Security Layer: Authentication, rate limiting, input validation
- Cache Layer: Intelligent state caching with TTL
- Framework Authentication: Enhanced security with PulseEngine MCP v0.4.0
- API Key Management with role-based permissions
- JWT tokens for stateless sessions
- Encrypted storage with AES-GCM
- Vault integration (Infisical support)
- 8 predefined security profiles
- Rate Limiting: Configurable per-role limits
- Input Validation: All inputs sanitized and validated
- Audit Logging: Comprehensive activity logging
# Development build with debug symbols
cargo build
# Run tests
cargo test
# Format and lint
cargo fmt && cargo clippy
src/
βββ server/ # MCP protocol implementation
βββ tools/ # Tool implementations
βββ client/ # Loxone client
βββ security/ # Auth and validation
βββ main.rs # Entry point
- WASM Support: Currently disabled due to tokio compatibility issues
- Real-time Updates: WebSocket subscriptions planned but not yet implemented
- Miniserver Version: Tested with Gen 1 and Gen 2, newer versions may have differences
Contributions are welcome! Please see contributing.md for guidelines.
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Built on the PulseEngine MCP framework. Special thanks to the Loxone community for protocol documentation.