Skip to main content
Glama

myair-mcp

License: MIT

An MCP (Model Context Protocol) server that wraps the ResMed myAir cloud API. Query your CPAP therapy data (nightly usage, AHI, mask leak, myAir score) conversationally from Claude Code or any MCP-compatible client.

Read-only and local-only. The server only fetches data, and it runs over stdio only. There is no HTTP transport, because this is health data.

ResMed has no official public API. This wraps the reverse-engineered endpoints the myAir web app uses. Credit to prestomation/resmed_myair_sensors, the canonical reference. The endpoints are unsupported and could change without notice.

The data is informational only. Do not use it for medical decisions; talk to your care provider.

Tools

Tool

Description

get_devices

CPAP device(s) and mask: name, series, serial, last data upload time

get_sleep_records(days=30)

Nightly records for the last days nights, newest first

get_latest_sleep

Most recent night, served from the cached history with no extra API call

reset_cache

Clear cached data and the login token

Each nightly record has these fields:

Field

Meaning

date

Therapy night (the evening the session started), YYYY-MM-DD

usage_minutes

Mask-on time. Unused nights are included with 0

ahi

Apnea-hypopnea index (events/hour)

leak_95th_l_per_min

95th-percentile mask leak (L/min)

mask_on_off_count

Times the mask was put on or taken off

myair_score

Total myAir score (0-100). It is the sum of usage_score (max 70), ahi_score (5), mask_score (5) and leak_score (20)

The machine uploads over cellular after a session ends, so last night's record may not exist until mid-morning. Compare get_devices → last_sleep_data_report_time with the latest date.

Related MCP server: oura-ring-mcp

Configuration

MYAIR_USERNAME=your_myair_account_email
MYAIR_PASSWORD=your_myair_account_password

Only North America accounts are supported. Login uses Okta (primary auth, then a PKCE authorization code, then a token). Accounts that require email MFA (the EU region) are rejected with a clear error. myAir issues no refresh token, so the server logs in again when the 1-hour access token expires. After a failed login it does not retry in a loop, which avoids locking the account.

The full history comes back in a single API call. The server caches it in memory for 30 minutes and slices it per request. Nothing is written to disk.

Run locally

python -m venv .venv
.venv\Scripts\pip install -r requirements.txt
copy .env.example .env  # then fill in credentials
.venv\Scripts\python server.py

Connect to Claude Code

Add to ~/.claude.json under mcpServers:

{
  "mcpServers": {
    "myair": {
      "type": "stdio",
      "command": "C:\\path\\to\\myair-mcp\\.venv\\Scripts\\python.exe",
      "args": ["C:\\path\\to\\myair-mcp\\server.py"],
      "env": {
        "MYAIR_USERNAME": "your_myair_account_email",
        "MYAIR_PASSWORD": "your_myair_account_password"
      }
    }
  }
}

Tests

.venv\Scripts\pip install -r requirements-dev.txt
.venv\Scripts\python -m pytest

Project structure

myair_client.py   # Okta login + AppSync GraphQL client
server.py         # MCPServer (mcp 2.x) tool definitions + in-process cache (stdio only)
tests/            # respx-mocked client tests + server cache tests
requirements.txt
.env.example

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      A Model Context Protocol (MCP) server that brings your Withings health data into Claude, allowing natural conversation access to sleep patterns, body measurements, workouts, heart data, and more.
      47
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides natural-language access to Oura health data through Claude, with a local SQLite mirror and MCP tools for analyzing patterns with personal annotations.
      111 npm
      3
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A local MCP server that connects Claude to the WHOOP Developer API, allowing natural language queries about recovery, sleep, strain, workouts, and body measurements. All data stays on your machine with read-only access.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      A local, single-user, read-only MCP server that gives Claude Code access to your Garmin health and training data, exposing tools for health snapshots, training status, run details, body metrics, and training analysis.
      1
      MIT