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 credentialsauth_refresh(refresh_token)- Refresh JWT tokenget_current_user()- Get current user infoget_token_status()- Check token expiry and status
Buildings
list_buildings(page, page_size)- List all buildingsget_building(building_id)- Get building details
Devices
list_devices()- List all devicesget_device(device_id)- Get device detailscreate_device(name, building_id, ...)- Create new deviceupdate_device_position(device_id, x, y)- Update floorplan positiondelete_device(device_id)- Delete devicebatch_get_devices(device_ids)- Get multiple devices
Readings
get_latest_readings(device_id)- Get latest sensor dataget_historical_readings(device_id, start, end)- Get historical databatch_get_latest_readings(device_ids)- Get readings for multiple devices
IAQ Analysis
analyze_iaq_quality(device_id)- Analyze with recommendationsget_iaq_recommendations(device_id)- Get prioritized actionsget_iaq_health_score(device_id)- Get health score (0-100)compare_to_standards(device_id, standard)- Compare against standards
Compliance
list_standards()- List compliance standardscalculate_compliance(device_id, standard)- Calculate compliance grade
Reports
list_reports()- List reportsgenerate_report_pdf(building_id)- Generate PDF report
Alerts
list_alerts(status, severity, device_id)- List IAQ alertsacknowledge_alert(alert_id)- Acknowledge alertresolve_alert(alert_id)- Resolve alert
Auto Re-Authentication
The client automatically handles token expiry and refresh:
- Token Expiry Check - Before each request, checks if token expires within 24 hours
- Auto Refresh - Uses refresh token to get new access token
- Full Re-Auth - If refresh fails, re-authenticates with stored credentials
- 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
- 📧 Email: hello@what-if.sg
- 🌐 Website: https://what-if.sg
License
MIT © What If Labs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
875ffc38e406fb506f48b3b21f8270001ed9e10542ed7d811b9dcffa8d95b4cf
|
|
| MD5 |
c6c0c73f805209e0bd81db3f1a16f702
|
|
| BLAKE2b-256 |
3afa5b4e1f8e6b2c4c91f07d5bdeaff71688b1146dcf4db811b0eb91a6462a4a
|
File details
Details for the file kukios_mcp_client-1.0.1-py3-none-any.whl.
File metadata
- Download URL: kukios_mcp_client-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
531bec0eec5af19f0e9d58176a6965d43a6b5af8c3832472ee98035152aaa5c5
|
|
| MD5 |
48ece27328751a65b6fcd17c95b0abad
|
|
| BLAKE2b-256 |
be1f8cd0fcfa497b0ad3ff9a19a97dc5ea8ab3694c82473d752b59736e7b85e5
|