Loxone MCP Resources Documentation

This document describes the resource URI scheme and available resources for the Loxone MCP server.

Overview

The Loxone MCP server implements the Model Context Protocol (MCP) Resources specification, providing structured read-only access to Loxone home automation data. Resources use a custom URI scheme (loxone://) to identify and access different types of data.

URI Scheme

All resources follow the pattern: loxone://category[/subcategory][/{parameter}][?query_params]

Components:

Available Resources

Room Resources

List All Rooms

Get Room Devices

Device Resources

All Devices

Devices by Type

Devices by Category

System Resources

System Status

System Capabilities

Categories Overview

Audio Resources

Audio Zones

Audio Sources

Sensor Resources

Door/Window Sensors

Temperature Sensors

Discovered Sensors

Query Parameter Reference

Common Parameters

Filter Parameters

Response Format

All resources return JSON data with the following structure:

{
  "uri": "loxone://resource/path",
  "timestamp": "2024-01-20T10:30:00Z",
  "data": {
    // Resource-specific data
  },
  "metadata": {
    "total_count": 100,
    "returned_count": 20,
    "cache_ttl": 300
  }
}

Caching

Resources implement intelligent caching with TTL values based on data volatility:

Resource Type Default TTL Description
Room lists 3600s Room structure rarely changes
Device lists 600s Device configuration is relatively stable
System status 60s Health checks need to be current
Sensor data 30s Sensor readings change frequently
Audio status 10s Playback state is highly dynamic

Error Handling

Invalid resource requests return standard MCP error responses:

{
  "error": {
    "code": -32602,
    "message": "Invalid resource URI: {details}"
  }
}

Common error codes:

Examples

Get all lights in the living room:

loxone://rooms/Living%20Room/devices?type=LightController

Get all devices sorted by name (descending):

loxone://devices/all?sort=-name&limit=50

Get temperature sensors in the bedroom:

loxone://sensors/temperature?room=Bedroom

Get all blinds/rolladen devices:

loxone://devices/category/blinds

Integration with MCP

Resources are accessed through the standard MCP protocol:

  1. List available resources:
    {
      "jsonrpc": "2.0",
      "id": 1,
      "method": "resources/list"
    }
    
  2. Read a specific resource:
    {
      "jsonrpc": "2.0",
      "id": 2,
      "method": "resources/read",
      "params": {
     "uri": "loxone://rooms/Kitchen/devices"
      }
    }
    

Best Practices

  1. Use Resources for Read-Only Data: Resources are optimized for data retrieval. Use tools for actions that modify state.

  2. Leverage Caching: Resources are cached automatically. Frequent reads of the same resource are efficient.

  3. Pagination for Large Results: Use limit and offset parameters to handle large datasets efficiently.

  4. URL Encoding: Always URL-encode parameters that may contain spaces or special characters.

  5. Error Handling: Implement proper error handling for invalid URIs and missing resources.

Migration from Tools

The following read-only tools have been migrated to resources:

Old Tool New Resource
list_rooms loxone://rooms
get_room_devices loxone://rooms/{roomName}/devices
discover_all_devices loxone://devices/all
get_devices_by_type loxone://devices/type/{type}
get_devices_by_category loxone://devices/category/{category}
get_system_status loxone://system/status
get_available_capabilities loxone://system/capabilities
get_all_categories_overview loxone://system/categories
get_audio_zones loxone://audio/zones
get_audio_sources loxone://audio/sources
get_all_door_window_sensors loxone://sensors/door-window
get_temperature_sensors loxone://sensors/temperature
list_discovered_sensors loxone://sensors/discovered
get_weather_station_data loxone://weather/current
get_energy_consumption loxone://energy/consumption
get_alarm_status loxone://security/status
get_climate_control loxone://climate/overview
get_room_climate loxone://climate/rooms/{room}
list_predefined_workflows loxone://workflows/predefined
get_workflow_examples loxone://workflows/examples