air-Q

io.github.CorantGmbH由 GitHub 账号 CorantGmbH 发布v1.6.5更新于 Oct 24, 2026

MCP server for direct HTTP communication with air-Q air quality sensor devices

已验证STDIO仅桌面位置与生活数据与分析

概览

AI 生成的概览

该 MCP 服务器让助手查询和配置局域网内的 air-Q 空气质量传感器,并生成历史图表与导出数据。

可以做什么
  • 列出已配置设备,读取实时传感器读数、设备信息、配置、日志及 LED、夜间模式、亮度设置
  • 按设备名称、位置或分组查询多台设备与多项传感器的读数
  • 以列式 JSON 获取历史传感器数据,支持时间范围与降采样
  • 按传感器绘制历史图表(PNG、WebP、SVG、HTML),并将历史数据导出为 CSV 或 XLSX
  • 修改设备设置:名称、LED 主题、夜间模式、亮度、网络(静态 IP 或 DHCP)
  • 控制设备:闪烁 LED 以便识别、重启或关机
适用场景
适用于局域网内有一台或多台 air-Q 传感器,希望助手汇报 CO2、VOC、湿度或 PM 读数、绘制或导出趋势,或调整设备显示与网络设置的场景。
运行要求
以本地 Python 包运行(pip install mcp-airq 或 uvx mcp-airq)。需要通过 AIRQ_CONFIG_FILE 指定设备配置 JSON 文件,或在 AIRQ_DEVICES 中内联 JSON 设备列表。每个设备条目需提供地址(IP 或 mDNS 主机名)和设备密码。设备须在局域网内可访问。
安装前请注意
设备配置中包含设备密码,README 建议限制该文件权限;同样的密钥也可通过 AIRQ_DEVICES 内联传入。配置与控制类工具会改变设备状态,重启或关机会造成停机(关机后需手动重启)。更改网络配置可能导致设备无法访问。

安装

在 SourceWeft 中

  1. 打开 控制台中的 air-Q,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-airq

[MCP] [PyPI] [Total Downloads] [Python] [License] [Tests] [Coverage]

MCP server for air-Q air quality sensor devices. Enables Claude Desktop, Claude Code, and other MCP clients to directly query and configure air-Q devices on your local network.

Built on aioairq, the official async Python library for air-Q.

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

Installation

bash
pip install mcp-airq

Or run directly with uvx:

bash
uvx mcp-airq

CLI Usage

Use the same command directly from the shell:

bash
mcp-airq list-devicesmcp-airq get-air-quality --device "Living Room"mcp-airq get-air-quality-history --device "Living Room" --last-hours 12 --sensors co2mcp-airq plot-air-quality-history --sensor co2 --output-format pngmcp-airq export-air-quality-history --sensor co2 --output-format xlsxmcp-airq set-night-mode --activated --device "Bedroom"

For historical plots and exports:

  • omit device, location, and group to combine all configured devices into one artifact
  • use location or group to combine only the matching devices
  • plot_air_quality_history returns one file per requested sensor, with one series per matching device
  • export_air_quality_history returns one CSV/XLSX file per request, with rows for all matching devices

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

bash
mcp-airq list-devicesmcp-airq list_devices

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

bash
mcp-airq serve

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

bash
mcp-airq get-air-quality --device "Living Room" | jq '.co2'mcp-airq get-air-quality --device "Living Room" --compact-json | jq '.co2'mcp-airq get-air-quality --device "Living Room" --yaml | yq '.co2'

Device Configuration

Create a JSON file with your device(s), e.g. ~/.config/airq-devices.json:

json
[  {"address": "192.168.4.1", "password": "your_password", "name": "air-Q Pro", "location": "Living Room", "group": "Home"},  {"address": "192.168.4.2", "password": "your_password", "name": "air-Q Radon", "location": "Living Room", "group": "Home"},  {"address": "office_air-q.local", "password": "other_pass", "name": "Office", "group": "Work"}]

Each entry requires:

  • address — IP address or mDNS hostname (e.g. abcde_air-q.local)
  • password — Device password (default: airqsetup)
  • name (optional) — Human-readable name; defaults to address
  • location (optional) — Physical room/area for grouping (e.g. "Living Room")
  • group (optional) — Second grouping dimension, orthogonal to location (e.g. "Home", "Work")

Then restrict access to the file (it contains passwords):

bash
chmod 600 ~/.config/airq-devices.json

Alternatively, pass the device list inline via the AIRQ_DEVICES environment variable as a JSON string.

Claude Desktop

Add to your claude_desktop_config.json:

json
{  "mcpServers": {    "airq": {      "command": "uvx",      "args": ["mcp-airq"],      "env": {        "AIRQ_CONFIG_FILE": "/home/you/.config/airq-devices.json"      }    }  }}

Claude Code

Register the server once via the CLI:

bash
claude mcp add airq -e AIRQ_CONFIG_FILE=~/.config/airq-devices.json -- uvx mcp-airq

This writes to ~/.claude/settings.json and is automatically picked up by the Claude Code VSCode extension as well — no separate configuration needed.

If the server fails to connect: MCP servers run in a subprocess that may not inherit your shell's PATH. Replace uvx with its full path (which uvx → e.g. /home/you/.local/bin/uvx):

bash
claude mcp add airq -e AIRQ_CONFIG_FILE=~/.config/airq-devices.json -- /home/you/.local/bin/uvx mcp-airq

OpenAI Codex

Register the server once via the CLI:

bash
codex mcp add airq --env AIRQ_CONFIG_FILE=~/.config/airq-devices.json -- uvx mcp-airq

This writes to ~/.codex/config.toml and is automatically picked up by the Codex VSCode extension as well.

If the server fails to connect: Use the full path to uvx (see note above).

Available Tools

Read-Only

ToolDescription
list_devicesList all configured air-Q devices (with location/group if set)
get_air_qualityGet sensor readings — by device, location, or group
get_air_quality_historyGet historical sensor data as column-oriented JSON
plot_air_quality_historyRender one historical chart per sensor across all matching devices
export_air_quality_historyExport one historical sensor as one csv/xlsx across matching devices
get_device_infoGet device metadata (name, model, firmware version)
get_configGet full device configuration
get_logsGet device log entries
identify_deviceMake device blink its LEDs for visual identification
get_led_themeGet current LED visualization theme
get_possible_led_themesList all available LED visualization themes
get_night_modeGet current night mode configuration
get_brightness_configGet current LED brightness configuration

Configuration

ToolDescription
set_device_nameRename a device
set_led_themeChange LED visualization (CO₂, VOC, Humidity, PM2.5, …)
set_night_modeConfigure night mode schedule and settings
set_brightnessAdjust LED brightness (day/night)
configure_networkSet static IP or switch to DHCP

Device Control

ToolDescription
restart_deviceRestart the device (~30s downtime)
shutdown_deviceShut down the device (manual restart required)

Multi-Device Support

When multiple devices are configured, specify which device to query:

  • By exact name: "air-Q Pro"
  • By partial match (case-insensitive): "pro", "radon"

If only one device is configured, it is selected automatically.

Location and Group Queries

get_air_quality accepts two optional grouping parameters:

  • location — query all devices in the same room (e.g. "Living Room")
  • group — query all devices sharing a group tag (e.g. "Home")

Both are independent: a device can have a location, a group, both, or neither. Matching is case-insensitive and substring-based.

text
get_air_quality(location="Living Room")  → air-Q Pro + air-Q Radonget_air_quality(group="Home")            → air-Q Pro + air-Q Radon + …get_air_quality(device="air-Q Radon")   → just that one device

Exactly one of device, location, or group may be specified per call.

Historical Data

Three tools provide access to data stored on the device's SD card:

Plotting charts

plot_air_quality_history renders a chart for one sensor. When multiple devices match, each device becomes a separate series in the same chart.

[CO₂ area chart — single device]

Single device (24 h, area chart, PNG)

[CO₂ area chart — multiple devices]

Multiple devices at one location (24 h, area chart, PNG)

bash
# Single device, last 24 hours (default), PNG output (default)mcp-airq plot-air-quality-history --sensor co2 --device "Living Room"
# All devices at a location, custom time range, SVG outputmcp-airq plot-air-quality-history --sensor co2 --location "Living Room" \  --from-datetime "2026-03-16T00:00:00" --to-datetime "2026-03-17T00:00:00" \  --output-format svg --output co2.svg
# All configured devices, dark mode, line chartmcp-airq plot-air-quality-history --sensor co2 --dark --chart-type line
# Save to filemcp-airq plot-air-quality-history --sensor co2 --output co2_chart.png

Output formats: png (default), webp, svg, html (interactive Plotly chart with hover tooltips and zoom)

Customization: --title, --x-axis-title, --y-axis-title, --chart-type (line/area), --dark, --timezone-name

Exporting data

export_air_quality_history produces one CSV or Excel file containing all matching devices.

bash
# CSV export (default)mcp-airq export-air-quality-history --sensor co2 --device "Living Room" --last-hours 48
# Excel export for all devices at a locationmcp-airq export-air-quality-history --sensor radon --location "Home" \  --output-format xlsx --output radon.xlsx

Querying raw JSON

get_air_quality_history returns column-oriented JSON, useful for programmatic analysis.

bash
mcp-airq get-air-quality-history --device "Living Room" --last-hours 12 \  --sensors co2 pm2_5 --max-points 150

Common parameters

ParameterDefaultDescription
--last-hours1 (history) / 24 (plot)Hours of data to retrieve
--from-datetime / --to-datetime—ISO 8601 time range (overrides --last-hours)
--max-points300Downsample to at most N evenly spaced points
--timezone-nameUTCIANA timezone for timestamps (e.g. Europe/Berlin)

Example Prompts

  • "How is the air quality in the living room?" — queries all devices at that location
  • "What's the air quality at home?" — queries all devices in the "Home" group
  • "Show the CO₂ trend over the last 12 hours as SVG"
  • "Export the radon history from yesterday as Excel"
  • "Show me the radon level" — targets the air-Q Radon device by name
  • "Show CO₂ on the LEDs"
  • "Enable night mode from 10 PM to 7 AM"
  • "Set brightness to 50%"
  • "What's in the device log?"
  • "Make the air-Q blink"

Development

bash
git clone https://github.com/CorantGmbH/mcp-airq.gitcd mcp-airquv sync --frozen --extra devuv run pre-commit installuv run pytest

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

bash
uv run ruff check .uv run ruff format --check .uv run pyrightuv run pre-commit run --all-files

Release Process

  1. Update version in pyproject.toml.
  2. Commit and create a matching Git tag like v0.1.1.
  3. Publish a GitHub Release from that tag.

The publish workflow validates that the release tag matches pyproject.toml, uploads the package to PyPI, and then publishes the same version to the MCP Registry.

License

Apache License 2.0 — see LICENSE.

来源:README.md,提交 72ef56e

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.6.5最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分