Loxone MCP API Reference

Overview

The Loxone MCP server provides 17 tools for device control and 25+ resources for data access, organized into functional categories for comprehensive home automation control.

Authentication

All API requests require authentication using API keys:

# Using X-API-Key header
curl -H "X-API-Key: lmcp_admin_001_abc123def456" http://localhost:3001/api/devices

# Using Authorization Bearer
curl -H "Authorization: Bearer lmcp_admin_001_abc123def456" http://localhost:3001/api/devices

Tool Categories

The server implements 17 action-based tools, organized by functionality:

Device Control (2 tools)

Lighting Control (3 tools)

Blinds/Rolladen Control (4 tools)

Climate Control (2 tools)

Audio Control (2 tools)

Security Control (2 tools)

Workflow Management (2 tools)

Resources for Read-Only Data

For data retrieval, use the 25+ resources available via the MCP Resources protocol:

Room Data

Device Data

System Information

Sensor Data

See resources.md for complete resource documentation.

HTTP Endpoints

MCP Protocol Endpoints

# Main MCP message endpoint (for MCP Inspector)
POST /message
Content-Type: application/json
X-API-Key: your-api-key

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "list_devices",
    "arguments": {}
  },
  "id": 1
}

# Server-Sent Events stream
GET /sse
X-API-Key: your-api-key

Admin Endpoints

# API Key Management UI
GET /admin/keys

# API Key REST endpoints
GET    /admin/api/keys      # List all keys
POST   /admin/api/keys      # Create new key
PUT    /admin/api/keys/:id  # Update key
DELETE /admin/api/keys/:id  # Delete key

# System Status
GET /admin/status           # System status
GET /admin/rate-limits      # Rate limit status

Monitoring Endpoints

# Dashboard
GET /dashboard/             # Real-time monitoring dashboard
GET /dashboard/ws           # WebSocket for live updates
GET /dashboard/api/status   # Dashboard API status
GET /dashboard/api/data     # Dashboard data

# Metrics
GET /metrics                # Prometheus metrics
GET /health                 # Health check

Error Responses

All errors follow a consistent format:

{
  "error": {
    "code": "INVALID_API_KEY",
    "message": "The provided API key is invalid or expired",
    "details": {
      "key_id": "lmcp_***_***"
    }
  }
}

Common error codes:

Rate Limiting

Default rate limits by role:

Rate limit headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1673884800

WebSocket Events

Connect to /dashboard/ws for real-time updates:

const ws = new WebSocket('ws://localhost:3001/dashboard/ws');

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log('Event:', data.type, data.payload);
};

Event types:

Examples

Turn on all lights in living room

curl -X POST http://localhost:3001/message \
  -H "Content-Type: application/json" \
  -H "X-API-Key: lmcp_operator_001_abc123" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "room_all_on",
      "arguments": {
        "room_id": "living_room"
      }
    },
    "id": 1
  }'

Get current temperature

curl -X POST http://localhost:3001/message \
  -H "Content-Type: application/json" \
  -H "X-API-Key: lmcp_monitor_001_xyz789" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "get_zone_temperature",
      "arguments": {
        "zone_id": "bedroom"
      }
    },
    "id": 1
  }'

Set dimmer to 50%

curl -X POST http://localhost:3001/message \
  -H "Content-Type: application/json" \
  -H "X-API-Key: lmcp_operator_001_abc123" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "set_dimmer",
      "arguments": {
        "device_id": "bedroom_light",
        "level": 50
      }
    },
    "id": 1
  }'