Skip to main content
Glama
PAP Analytics MCP

PAP Analytics MCP

by drew2323

pap-analytics-mcp

Device-agnostic analytics over PAP (CPAP/APAP/BiPAP/ASV) therapy data, exposed to AI agents as an MCP server.

Ask an agent "How was last night?", "Analyse 02:10–02:40", "Compare this week with last week" – the agent calls small, aggregate-first tools instead of reading raw waveforms.

raw device data ──► vendor adapter ──► canonical PAP model ──► store ──► analytics ──► MCP tools
(ResMed SD card /      (ResMed now,       (vendor-neutral)      (DuckDB +              (stdio / HTTP)
 AirCANnect SMB share)  Löwenstein later)                         Parquet)
  • Sources (v1): ResMed AirSense/AirCurve 10/11 SD-card layout (Identification.*, STR.edf, DATALOG/). The AirCANnect SMB share uses the same layout, so a real SD card and the share both work.

  • Later: Löwenstein (prisma) and other vendors through the same adapter contract.

  • Runs: locally (uv) or in Docker, read-only over the source data.

  • Not a medical device. Output is analytical, not a diagnosis.

Status

Scaffold only. Implementation follows the work packages in docs/plan/; progress is tracked in Multica (project PAP Analytics MCP).

Related MCP server: sleepon-mcp

Quick start (development)

uv sync
uv run pytest          # quality gate (also run in CI)
uv run ruff check .
uv run pap --help

Real test data (the author's own nights, published on purpose) lives in tests/data/.

Documentation

File

Content

AGENTS.md

Rules for humans and coding agents working in this repo

docs/ARCHITECTURE.md

Stable shape: components, canonical model, contracts, invariants

docs/DECISIONS.md

Append-only decision log (ADR)

docs/plan/

Implementation plan split into self-contained work packages

tests/data/README.md

Real-data fixture description and known facts

License

MIT – see LICENSE. Parts of the EDF handling are derived from airbreak-plus (MIT).

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables AI assistants to access and analyze Oura Ring health data including sleep, readiness, activity, and stress metrics. Supports customizable queries, correlation analysis, and visualization capabilities for comprehensive health insights.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to analyze sleep quality, compare nights, generate reports, and get personalized improvement tips using Sleepon sleep tracker data.
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Query Apple Health export data with an LLM via a semantic layer that avoids common data traps, enabling accurate natural-language queries about health metrics. Optionally imports CPAP therapy data for correlation.
    3
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to query health metrics such as activity, blood pressure, glucose, heart rate, sleep, and SpO2 from a PostgreSQL-backed wellness database, returning structured data and summaries through MCP tools.
    -