Loxone MCP Server

An MCP server for Loxone home automation systems, allowing AI assistants to control lights, blinds, sensors, and weather.

๐Ÿ  Loxone MCP Server

Control your Loxone smart home through the Model Context Protocol

ย 

Rust MCP Edition CI License

ย 

An async Rust MCP server that connects AI assistants to Loxone Miniservers. Control lights, blinds, climate, security, audio, and more โ€” all through standardized MCP tools and resources.

[!NOTE] Built on the PulseEngine MCP framework v0.17.0 for standardized protocol handling, authentication, and transport layers.

Features

  • ๐Ÿ”Œ 17 MCP Tools โ€” Control lights, blinds, HVAC, security, audio, door locks, intercoms, and scenes โ€” all wired to real Miniserver commands
  • ๐Ÿ“Š 25+ MCP Resources โ€” Read-only access to rooms, devices, sensors, energy, weather, and system status with live state
  • ๐Ÿš€ Three Transports โ€” stdio (Claude Desktop), HTTP/SSE (n8n, web clients), and Streamable HTTP
  • ๐Ÿ” Security by Default โ€” SSL verification on, UUID validation, rate limiting, input sanitization, dev-mode restricted to localhost
  • โšก Async Rust โ€” Connection pooling, intelligent caching, batch operations
  • ๐ŸงŠ Nix Flake โ€” Reproducible builds with OpenClaw plugin integration
  • ๐Ÿ”‘ Credential Management โ€” Credential ID system, environment variables, or Infisical vault

Quick Start

# Build
cargo build --release

# Setup credentials
cargo run --bin loxone-mcp-setup -- --generate-id --name "My Home"

# Run with Claude Desktop
cargo run --bin loxone-mcp-server -- stdio --credential-id <your-id>

Installation

From Source

git clone https://github.com/avrabe/mcp-loxone
cd mcp-loxone
cargo build --release

Nix Flake

nix build github:avrabe/mcp-loxone
# Or run directly
nix run github:avrabe/mcp-loxone

Docker

docker build -t loxone-mcp .
docker run -e LOXONE_HOST=192.168.1.100 \
           -e LOXONE_USER=admin \
           -e LOXONE_PASS=secret \
           -p 3001:3001 loxone-mcp

Configuration

Credential ID (Recommended)

# Interactive setup โ€” generates a unique credential ID
cargo run --bin loxone-mcp-setup -- --generate-id --name "Main House"

# Or store manually
cargo run --bin loxone-mcp-auth -- store \
  --name "Office" --host 192.168.1.100 \
  --username admin --password secure123

# Manage credentials
cargo run --bin loxone-mcp-auth -- list
cargo run --bin loxone-mcp-auth -- test <credential-id>

Environment Variables

export LOXONE_HOST="192.168.1.100"
export LOXONE_USER="admin"
export LOXONE_PASS="password"

Infisical Vault (Production)

export INFISICAL_PROJECT_ID="your-project-id"
export INFISICAL_CLIENT_ID="your-client-id"
export INFISICAL_CLIENT_SECRET="your-client-secret"

[!TIP] Migrating from environment variables? See the Credential Migration Guide.

Usage

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "loxone": {
      "command": "loxone-mcp-server",
      "args": ["stdio", "--credential-id", "abc123def-456-789"]
    }
  }
}

HTTP Server (n8n, MCP Inspector)

# Standard HTTP/SSE
loxone-mcp-server http --port 3001 --credential-id <id>

# Streamable HTTP (new MCP Inspector)
loxone-mcp-server streamable-http --port 3001 --credential-id <id>

OpenClaw Integration

The flake exports an openclawPlugin for nix-openclaw:

customPlugins = [
  {
    source = "github:avrabe/mcp-loxone";
    config.env = {
      LOXONE_HOST = "/path/to/secrets/loxone-host";
      LOXONE_USER = "/path/to/secrets/loxone-user";
      LOXONE_PASS = "/path/to/secrets/loxone-pass";
    };
  }
];

Tools & Resources

Tools (Actions)

CategoryToolsDescription
Lightingcontrol_lightOn/off, dim 0-100%
Blindscontrol_blindUp/down/stop, position 0-100%
Climateset_temperatureTarget temperature with safe range validation
Securityset_security_modeArm, disarm, night, away modes
Doorscontrol_door_lockLock, unlock, open
Intercomcontrol_intercomAnswer, decline, open door
Audiocontrol_audioPlay, pause, volume per zone
Scenesactivate_sceneTrigger named scenes
Generalcontrol_device, get_*_statusDirect device control, live status queries

Resources (Read-Only)

URI PatternData
loxone://roomsRoom listing with device counts
loxone://rooms/{room}/devicesDevices in a specific room
loxone://devices/allFull device inventory
loxone://devices/category/{cat}Devices by category
loxone://sensors/*Door/window, temperature, motion
loxone://audio/zonesAudio zone configuration
loxone://system/statusMiniserver status and capabilities
loxone://energy/*Power monitoring and consumption

Architecture

AI Assistant (Claude, n8n, OpenClaw)
        โ”‚
   MCP Protocol (stdio / HTTP / Streamable HTTP)
        โ”‚
   โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚   loxone-mcp-server          โ”‚
   โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
   โ”‚  โ”‚ Security Layer          โ”‚ โ”‚
   โ”‚  โ”‚ Auth ยท Rate Limit ยท TLS โ”‚ โ”‚
   โ”‚  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚
   โ”‚  โ”‚ Tool Handlers           โ”‚ โ”‚
   โ”‚  โ”‚ 17 tools โ†’ send_command โ”‚ โ”‚
   โ”‚  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚
   โ”‚  โ”‚ Loxone Client           โ”‚ โ”‚
   โ”‚  โ”‚ HTTP ยท WebSocket ยท Cacheโ”‚ โ”‚
   โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
   โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
   HTTP /jdev/sps/io/{uuid}/{cmd}
        โ”‚
   Loxone Miniserver
        โ”‚
   Physical Devices

Development

Requirements

  • Rust 1.85+ (2024 edition)
  • Loxone Miniserver (Gen 1 or Gen 2)

Building & Testing

cargo build                                    # Dev build
cargo test --lib                               # Unit tests
cargo fmt && cargo clippy -- -D warnings       # Format + lint
cargo audit                                    # Security audit

Live Miniserver Testing

# Requires network access to Miniserver
LOXONE_LIVE_TEST=1 cargo test \
  --test live_miniserver_tests \
  --features test-utils -- --nocapture

Project Structure

src/
โ”œโ”€โ”€ server/          # MCP protocol, tool handlers (macro_backend.rs)
โ”œโ”€โ”€ client/          # HTTP/WebSocket clients with UUID validation
โ”œโ”€โ”€ config/          # Credentials, master key auto-persistence
โ”œโ”€โ”€ security/        # Input sanitization, rate limiting, CORS
โ”œโ”€โ”€ monitoring/      # Metrics, dashboards, InfluxDB
โ”œโ”€โ”€ history/         # Time-series data storage
โ”œโ”€โ”€ discovery/       # mDNS network discovery
โ””โ”€โ”€ main.rs          # CLI, transport selection, startup

Binaries

BinaryPurpose
loxone-mcp-serverMain MCP server (stdio/HTTP/streamable-http)
loxone-mcp-authCredential management (store, list, test, delete)
loxone-mcp-setupInteractive setup with credential ID generation
loxone-mcp-test-endpointsAPI endpoint testing (development)

License

Licensed under either of:

at your option.

ย 

Built on PulseEngine MCP framework โ€” async Rust for the Model Context Protocol

Related Servers