Skip to main content

MCP server for air-Q Cloud API — access air quality data from anywhere

Project description

mcp-airq-cloud

MCP PyPI Total Downloads Python License Tests Coverage

MCP server for the air-Q Cloud API — access air quality data from anywhere.

Unlike mcp-airq (which communicates directly with devices on the local network), this server uses the air-Q Cloud REST API to retrieve sensor data remotely.

The same mcp-airq-cloud executable also works as a direct CLI when you pass a tool name as a subcommand.

Tools

Tool Description
list_devices List configured air-Q Cloud devices
get_air_quality Get latest sensor readings (supports device/location/group selection)
get_air_quality_history Get historical data within a time range as column-oriented JSON
plot_air_quality_history Render historical charts as png, webp, svg, or html
export_air_quality_history Export one historical sensor as csv or xlsx

All tools are read-only — the Cloud API does not support device configuration or control.

Installation

pip install mcp-airq-cloud

Or install from source:

git clone https://github.com/CorantGmbH/mcp-airq-cloud.git
cd mcp-airq-cloud
uv sync --frozen --extra dev

CLI Usage

Use the same command directly from the shell:

mcp-airq-cloud list-devices
mcp-airq-cloud get-air-quality --device "Living Room"
mcp-airq-cloud get-air-quality-history --device "Living Room" --last-hours 24 --sensors co2 pm2_5
mcp-airq-cloud plot-air-quality-history --sensor co2 --device "Living Room" --output-format svg --output co2.svg
mcp-airq-cloud export-air-quality-history --sensor co2 --device "Living Room" --output-format xlsx --output co2.xlsx

The CLI subcommands mirror the MCP tool names. Both styles work:

mcp-airq-cloud list-devices
mcp-airq-cloud list_devices

To force MCP server mode from an interactive terminal, run:

mcp-airq-cloud serve

The CLI is pipe-friendly: successful command output goes to stdout, while tool errors go to stderr with exit code 1. Plot commands can also stream directly to stdout.

mcp-airq-cloud get-air-quality --device "Living Room" | jq '.co2'
mcp-airq-cloud get-air-quality-history --device "Living Room" --compact-json | jq '.columns.co2'
mcp-airq-cloud get-air-quality-history --device "Living Room" --yaml | yq '.columns.co2'
mcp-airq-cloud plot-air-quality-history --sensor co2 --device "Living Room" --output - > co2.png
mcp-airq-cloud export-air-quality-history --sensor co2 --device "Living Room" --output - > co2.xlsx

Configuration

You need a Cloud API key and the 32-character device ID for each device. Both can be obtained at my.air-q.com.

Option 1: Environment variable (inline JSON)

export AIRQ_CLOUD_DEVICES='[{"id": "de45d2ed777780c96c0deae7a220b745", "api_key": "your-api-key", "name": "Living Room"}]'

Option 2: Default config file (recommended)

Place a JSON file at ~/.config/airq-cloud-devices.json — no environment variable needed:

[
  {"id": "de45d2ed777780c96c0deae7a220b745", "api_key": "your-api-key", "name": "Living Room"}
]

Option 3: Custom config file path

export AIRQ_CLOUD_CONFIG_FILE=/path/to/devices.json

Option 4: Global API key

If all devices share the same API key, set it once:

export AIRQ_CLOUD_API_KEY="your-api-key"
export AIRQ_CLOUD_DEVICES='[{"id": "de45d2ed777780c96c0deae7a220b745", "name": "Living Room"}]'

Device config fields

Field Required Description
id yes 32-character cloud device ID
api_key no Per-device API key (falls back to AIRQ_CLOUD_API_KEY)
name no Friendly name (defaults to first 8 chars of ID)
location no Location for grouping (e.g. "Wohnzimmer")
group no Group for grouping (e.g. "zu Hause")

Usage with Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "air-Q Cloud": {
      "command": "mcp-airq-cloud",
      "env": {
        "AIRQ_CLOUD_DEVICES": "[{\"id\": \"<device-id>\", \"api_key\": \"<key>\", \"name\": \"Living Room\"}]"
      }
    }
  }
}

Usage with Claude Code

claude mcp add air-Q-Cloud mcp-airq-cloud \
  -e AIRQ_CLOUD_DEVICES='[{"id":"<ID>","api_key":"<KEY>","name":"<Name>"}]'

Development

uv sync --frozen --extra dev
uv run pre-commit install
uv run pytest

The repository uses a project-local .venv plus uv.lock for reproducible tooling. Run developer commands through uv run, for example:

uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pre-commit run --all-files

License

Apache 2.0 — see LICENSE.

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

mcp_airq_cloud-1.4.0.tar.gz (194.9 kB view details)

Uploaded Source

Built Distribution

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

mcp_airq_cloud-1.4.0-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

Details for the file mcp_airq_cloud-1.4.0.tar.gz.

File metadata

  • Download URL: mcp_airq_cloud-1.4.0.tar.gz
  • Upload date:
  • Size: 194.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcp_airq_cloud-1.4.0.tar.gz
Algorithm Hash digest
SHA256 2b1dc177a78b38f6e8801507903f06430c06a00019c75601894a41d5b3a9921c
MD5 d48acfba76e437a5fec1724d815d24d1
BLAKE2b-256 ef4dff3d5a1cfd83e0e67e959d715a90b2b6094f2cc376b2c100220a22e9205f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_airq_cloud-1.4.0.tar.gz:

Publisher: publish.yml on CorantGmbH/mcp-airq-cloud

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_airq_cloud-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_airq_cloud-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 28.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcp_airq_cloud-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6600bac2ac30d746d2fd695b00c978c933f073d63c7031d077d65b6a851c589d
MD5 9d8d0d6f1d1df61ca21c96cf4d2ba7ed
BLAKE2b-256 6961dbd3d6f396e9124526dc26018fbc8f008a4969156fcd00d3cd826ade053d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_airq_cloud-1.4.0-py3-none-any.whl:

Publisher: publish.yml on CorantGmbH/mcp-airq-cloud

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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