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.0.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.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kukios_mcp_client-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 16af01cfcce7557bb05e8ec0813769af3daee9bc498db39fdba2af8022f57dd0
MD5 7bf5a2f60015d3eece01ac2ddebdf5e1
BLAKE2b-256 af5f269a10bd7a40fc5cf725842adc78317d3dfe260a04c6e5e594dcb0fb82cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kukios_mcp_client-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 094a6cc9c936cba52626a0b425e1157a52d98ac3a3e2469516ba4820ae30688c
MD5 2b8a58c27b5311a248a974bd5f1a9167
BLAKE2b-256 6b9a731593280b3dbaecac48c8d0f19222a00d417ecbb96d3807f1c005b13903

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