Loxone MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Loxone MCP Server
Bridge AI systems with Loxone home automation through the Model Context Protocol.
Features
Query States — Read component states, rooms, and categories via MCP Resources
Control Components — Operate lights, blinds, switches via MCP Tools
Real-Time Updates — WebSocket-driven state change notifications
Secure Remote Access — HTTP+SSE transport with credential passthrough
Local Mode — stdio transport for same-machine AI clients
Prometheus Metrics — Operational health at
/metricsAudit Logging — JSONL audit trail with rotation and sensitive data redaction
Related MCP server: Loxone Miniserver MCP
Quick Start
Prerequisites
Python 3.13+
Access to a Loxone Miniserver on your local network
Install
# Clone and install
git clone https://github.com/ondrejlevy/loxone-mcp.git
cd loxone-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e .Configure
Copy the example environment file and set your Loxone credentials:
cp .env.example .env
# Edit .env with your miniserver IP, username, and passwordOr use a YAML config file:
cp config/example-config.yaml config/config.yaml
# Edit config/config.yamlRun
# HTTP transport (default) — for remote AI clients
python -m loxone_mcp
# stdio transport — for local AI clients (e.g., Claude Desktop)
python -m loxone_mcp --transport stdio
# Both transports simultaneously
python -m loxone_mcp --transport both
# With YAML config
python -m loxone_mcp --config config/config.yaml
# Debug mode
python -m loxone_mcp --debugDocker
cd docker
docker compose up -dMCP Client Configuration
Examples for connecting AI clients to the Loxone MCP Server.
VS Code (GitHub Copilot)
Add to .vscode/mcp.json in your project:
{
"servers": {
"loxone": {
"command": "python",
"args": ["-m", "loxone_mcp", "--transport", "stdio"],
"env": {
"LOXONE_HOST": "192.168.1.100",
"LOXONE_USERNAME": "mcp-user",
"LOXONE_PASSWORD": "your-password"
}
}
}
}Or connect to a running HTTP server:
{
"servers": {
"loxone": {
"type": "sse",
"url": "http://localhost:8080/sse"
}
}
}Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"loxone": {
"command": "python",
"args": ["-m", "loxone_mcp", "--transport", "stdio"],
"env": {
"LOXONE_HOST": "192.168.1.100",
"LOXONE_USERNAME": "mcp-user",
"LOXONE_PASSWORD": "your-password"
}
}
}
}Claude Code
Add to .mcp.json in your project root (project scope) or ~/.claude.json (global):
{
"mcpServers": {
"loxone": {
"command": "python",
"args": ["-m", "loxone_mcp", "--transport", "stdio"],
"env": {
"LOXONE_HOST": "192.168.1.100",
"LOXONE_USERNAME": "mcp-user",
"LOXONE_PASSWORD": "your-password"
}
}
}
}Or via CLI:
claude mcp add loxone -- python -m loxone_mcp --transport stdioGitHub Copilot CLI
Add to ~/.config/github-copilot/mcp.json:
{
"servers": {
"loxone": {
"command": "python",
"args": ["-m", "loxone_mcp", "--transport", "stdio"],
"env": {
"LOXONE_HOST": "192.168.1.100",
"LOXONE_USERNAME": "mcp-user",
"LOXONE_PASSWORD": "your-password"
}
}
}
}OpenAI Codex CLI
Add to ~/.codex/config.json:
{
"mcpServers": {
"loxone": {
"command": "python",
"args": ["-m", "loxone_mcp", "--transport", "stdio"],
"env": {
"LOXONE_HOST": "192.168.1.100",
"LOXONE_USERNAME": "mcp-user",
"LOXONE_PASSWORD": "your-password"
}
}
}
}Tip: For Docker-based setups, point the HTTP/SSE URL to your Docker host (e.g.,
http://host.docker.internal:8080/sse). For stdio transport, thepythoncommand must be available in yourPATHwithloxone-mcpinstalled.
MCP Resources
URI | Description |
| Full Loxone structure file |
| All components with enriched room/category names |
| All rooms with component counts |
| All categories with component counts |
MCP Tools
Tool | Description |
| Get current state of a specific component |
| Get all components in a room with states |
| Get all components of a given type |
| Execute a control action on a component |
Control Actions by Component Type
Component Type | Actions |
LightController |
|
Dimmer |
|
Jalousie |
|
Switch |
|
IRoomControllerV2 |
|
Access Control
Set the access mode to restrict operations:
Mode | Resources | Tools (read) | Tools (control) |
| ✓ | ✓ | ✓ |
| ✓ | ✓ | ✗ |
| ✗ | ✗ | ✓ |
Configure via LOXONE_ACCESS_MODE env var or access_control.mode in YAML.
Monitoring
Prometheus metrics are exposed at GET /metrics:
mcp_requests_total— Request count by method and statusmcp_request_duration_seconds— Request latency histogrammcp_active_connections— Current connection countloxone_websocket_connected— WebSocket connection statusloxone_api_duration_seconds— Loxone API call latencyloxone_auth_attempts_total— Authentication attemptsloxone_state_updates_total— State update countstructure_cache_hits_total/structure_cache_misses_total— Cache performancecache_size_bytes— Cache memory usage
Audit Logging
All operations are logged to logs/audit.jsonl in JSON Lines format:
{"timestamp": "2026-02-10T12:00:00Z", "event_type": "TOOL_EXECUTION", "user": "admin", "action": "control_component", "target": "0a1b2c3d-...", "success": true, "duration_ms": 145}Features:
Daily log rotation (
audit-YYYY-MM-DD.jsonl)Configurable retention (default: 90 days)
Automatic sensitive data redaction (passwords, tokens)
Architecture
┌──────────────┐ ┌──────────────────┐ ┌──────────────┐
│ AI Client │────▶│ Loxone MCP │────▶│ Loxone │
│ (Claude, │◀────│ Server │◀────│ Miniserver │
│ Cursor) │ │ │ │ │
│ │ │ ┌─Resources─┐ │ │ ┌─HTTP──┐ │
│ MCP Proto │ │ ├─Tools────┤ │ │ ├─WS────┤ │
│ (stdio/HTTP)│ │ ├─Metrics──┤ │ │ └───────┘ │
│ │ │ ├─Audit────┤ │ │ │
└──────────────┘ │ └──────────┘ │ └──────────────┘
└──────────────────┘CI/CD Pipeline
Workflows
CI (ci.yml)
Runs on: push to main/develop, pull requests
Lint Code: Code style and format check with Ruff
Type Check: Static analysis with Mypy
Run Tests: Unit and integration tests with Pytest (requires 80% coverage)
Generate SBOM: Software Bill of Materials (CycloneDX format)
Docker Build (docker.yml)
Runs on: push to main, version tags (v*)
Multi-platform build (linux/amd64, linux/arm64)
Push to GitHub Container Registry (
ghcr.io)SLSA provenance attestation for supply chain security
Container vulnerability scan with Trivy
Automated Docker SBOM generation
Pull image:
docker pull ghcr.io/ondrejlevy/loxone-mcp:latestSecurity (security.yml)
Runs on: push, pull requests, weekly schedule (Monday 06:00 UTC)
Python Security Audit: Dependency vulnerabilities with pip-audit
Trivy Filesystem: Source code and dependency scanning
Trivy Container: Docker image vulnerability scanning
CodeQL Analysis: Advanced static security analysis
All security findings are automatically uploaded to the Security tab.
Running Locally
# Lint
ruff check src/ tests/
# Format
ruff format src/ tests/
# Type check
mypy src/
# Tests with coverage
pytest --cov=loxone_mcp --cov-report=term
# Security audit
pip-auditDevelopment
# Install dev dependencies
pip install -e ".[dev]"
# Run all checks (like CI)
ruff check src/ tests/ && \
mypy src/loxone_mcp/ && \
pytest --cov=loxone_mcp --cov-report=term
# Auto-fix linting issues
ruff check src/ tests/ --fix
# Format code
ruff format src/ tests/See CI/CD Pipeline section for available workflows and local testing commands.
Configuration Reference
See config/example-config.yaml for all available settings with documentation.
Environment Variables
Variable | Required | Default | Description |
| Yes | — | Miniserver IP or hostname |
| Yes | — | Loxone username |
| Yes | — | Loxone password |
| No |
| Miniserver port |
| No |
| Use TLS for Loxone connections |
| No |
| Access control mode |
| No |
| Server bind address |
| No |
| Server port |
| No |
| Transport: http, stdio, both |
| No |
| Log level |
| No |
| Debug mode |
| No |
| Enable Prometheus metrics |
| No |
| Enable audit logging |
| No |
| Audit log path |
| No |
| Audit log retention |
| No |
| Structure cache TTL (seconds) |
| No |
| Structure change poll interval |
License
MIT License. See LICENSE for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Control a Loxone Miniserver smart home: lights, blinds, climate, scenes and energy.
Home energy for AI assistants: live Power flow, Energy history, solar forecast, and device control.
Control your Tesla from your AI assistant - climate, charging, access, and security.
Give the physical world an API: cameras become typed endpoints your agent can read and act on.
Related MCP Servers
- AlicenseAqualityDmaintenanceConnects AI assistants to Loxone smart home systems for controlling devices, managing scenes, and monitoring real-time states through natural language. Supports lights, blinds, climate control, and automation with secure PIN-protected commands.3MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Loxone Miniserver - expose smart-home rooms, controls, and commands to Claude and other AI assistants7 npm5MIT
- AlicenseNot gradedqualityBmaintenanceEnables natural language control of Loxone smart home systems, including lighting, audio, climate, and environmental monitoring, through MCP-compatible clients.55 npm3AGPL 3.0
- AlicenseNot gradedqualityDmaintenanceA zero-dependency local proxy that provides a stable, headless connection to a Loxone Miniserver's MCP Server, enabling control and monitoring of Loxone smart home via natural language.3MIT