Skip to main content

Official client library for KūkiOS IAQ Monitoring Platform via MCP

Project description

KūkiOS MCP Client

Official client library for connecting to KūkiOS IAQ Monitoring Platform via MCP (Model Context Protocol).

Features

  • Auto Authentication - Automatic token management and refresh
  • Python + Node.js - Cross-language support
  • Simple API - Easy-to-use methods for all MCP tools
  • Error Handling - Graceful error handling and retries
  • Type Hints - Full type annotations for Python
  • Promise-based - Modern async/await for Node.js

Installation

Python

pip install kukios-mcp-client

Node.js

npm install kukios-mcp-client

Quick Start

Python

from kukios_mcp_client import KukiOSClient

# Initialize client
client = KukiOSClient(
    url="https://dashbeta.what-if.sg",
    email="user@email.com",
    password="your-password"
)

# List all devices
devices = client.list_devices()
print(f"Found {len(devices)} devices")

# Get IAQ health score
health = client.get_iaq_health_score(device_id="...")
print(f"Health Score: {health['health_score']}/100 (Grade {health['grade']})")

Node.js

const { KukiOSClient } = require('kukios-mcp-client');

// Initialize client
const client = new KukiOSClient({
    url: 'https://dashbeta.what-if.sg',
    email: 'user@email.com',
    password: 'your-password'
});

// List all devices
const devices = await client.listDevices();
console.log(`Found ${devices.length} devices`);

// Get IAQ health score
const health = await client.getIAQHealthScore(deviceId);
console.log(`Health Score: ${health.health_score}/100 (Grade ${health.grade})`);

API Reference

Authentication

  • auth_login(email, password) - Login and store credentials
  • auth_refresh(refresh_token) - Refresh JWT token
  • get_current_user() - Get current user info
  • get_token_status() - Check token expiry and status

Buildings

  • list_buildings(page, page_size) - List all buildings
  • get_building(building_id) - Get building details

Devices

  • list_devices() - List all devices
  • get_device(device_id) - Get device details
  • create_device(name, building_id, ...) - Create new device
  • update_device_position(device_id, x, y) - Update floorplan position
  • delete_device(device_id) - Delete device
  • batch_get_devices(device_ids) - Get multiple devices

Readings

  • get_latest_readings(device_id) - Get latest sensor data
  • get_historical_readings(device_id, start, end) - Get historical data
  • batch_get_latest_readings(device_ids) - Get readings for multiple devices

IAQ Analysis

  • analyze_iaq_quality(device_id) - Analyze with recommendations
  • get_iaq_recommendations(device_id) - Get prioritized actions
  • get_iaq_health_score(device_id) - Get health score (0-100)
  • compare_to_standards(device_id, standard) - Compare against standards

Compliance

  • list_standards() - List compliance standards
  • calculate_compliance(device_id, standard) - Calculate compliance grade

Reports

  • list_reports() - List reports
  • generate_report_pdf(building_id) - Generate PDF report

Alerts

  • list_alerts(status, severity, device_id) - List IAQ alerts
  • acknowledge_alert(alert_id) - Acknowledge alert
  • resolve_alert(alert_id) - Resolve alert

Auto Re-Authentication

The client automatically handles token expiry and refresh:

  1. Token Expiry Check - Before each request, checks if token expires within 24 hours
  2. Auto Refresh - Uses refresh token to get new access token
  3. Full Re-Auth - If refresh fails, re-authenticates with stored credentials
  4. Retry - Retries failed requests with new token

All transparent to the user!

Error Handling

Python

try:
    devices = client.list_devices()
except KukiOSAuthError as e:
    print(f"Authentication failed: {e}")
except KukiOSAPIError as e:
    print(f"API error: {e}")
except KukiOSConnectionError as e:
    print(f"Connection failed: {e}")

Node.js

try {
    const devices = await client.listDevices();
} catch (error) {
    if (error instanceof KukiOSAuthError) {
        console.error(`Authentication failed: ${error.message}`);
    } else if (error instanceof KukiOSAPIError) {
        console.error(`API error: ${error.message}`);
    } else if (error instanceof KukiOSConnectionError) {
        console.error(`Connection failed: ${error.message}`);
    }
}

Configuration

Environment Variables

export KUKIOS_URL="https://dashbeta.what-if.sg"
export KUKIOS_EMAIL="user@email.com"
export KUKIOS_PASSWORD="your-password"

Advanced Options

client = KukiOSClient(
    url="https://dashbeta.what-if.sg",
    email="user@email.com",
    password="your-password",
    timeout=30,  # Request timeout in seconds
    max_retries=3,  # Maximum retry attempts
    retry_delay=1,  # Initial retry delay in seconds
    cache_ttl=300  # Cache TTL in seconds
)

MCP Integration

Claude Desktop

{
  "mcpServers": {
    "kukios": {
      "url": "https://dashbeta.what-if.sg",
      "headers": {
        "Authorization": "Bearer YOUR_TOKEN"
      }
    }
  }
}

mcporter

mcporter config add kukios \
  --url https://dashbeta.what-if.sg \
  --header "Authorization: Bearer YOUR_TOKEN"

Note: KūkiOS MCP server is cloud-hosted. All connections go to https://dashbeta.what-if.sg. No local MCP server required.

Support

License

MIT © What If Labs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kukios_mcp_client-1.0.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kukios_mcp_client-1.0.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file kukios_mcp_client-1.0.1.tar.gz.

File metadata

  • Download URL: kukios_mcp_client-1.0.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for kukios_mcp_client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 875ffc38e406fb506f48b3b21f8270001ed9e10542ed7d811b9dcffa8d95b4cf
MD5 c6c0c73f805209e0bd81db3f1a16f702
BLAKE2b-256 3afa5b4e1f8e6b2c4c91f07d5bdeaff71688b1146dcf4db811b0eb91a6462a4a

See more details on using hashes here.

File details

Details for the file kukios_mcp_client-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for kukios_mcp_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 531bec0eec5af19f0e9d58176a6965d43a6b5af8c3832472ee98035152aaa5c5
MD5 48ece27328751a65b6fcd17c95b0abad
BLAKE2b-256 be1f8cd0fcfa497b0ad3ff9a19a97dc5ea8ab3694c82473d752b59736e7b85e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page