sapphire-wellness-mcp
Sapphire Health MCP Server
Ein Python-Model Context Protocol (MCP)-Serv, der Gesundheitsmetriken aus der Sapphire Health App für KI-Assistenten bereitstellt.
Verfügbare Metriken
Metrik | Tool | Datenpunkte |
Aktivität |
| Schritte, Kalorien, Distanz, aktive Minuten |
Blutdruck |
| Systolisch/iastolischer (mmHg), AHA-Category |
Glucose |
| Blutglucose (mg/dL), Mahlzeitkontext, Ze it im Zielsbereich |
Herfrequenz |
| BPM-Erte, Durchschnitt/Maximum/Rast, Ruhepuls |
Schlaf |
| Dauer, Tief-/Leicht-/REM-/Wachphasen, Effizienz |
SpO2 |
| Sauerstoffsättigung (%), Anzahl Dodesignssereigniße mit niederer Sättigung |
Zusammenfasser |
| Alle 6 Metriken in einer einzelnen Aufruf |
Related MCP server: Sapphire Wellness MCP Server
Architektur
Agent Container
│ HTTP SSE
▼
sapphire-mcp:8000 ──asyncpg──▶ PostgreSQL:5432Transport: HTTP SSE – erforderlich für Multi-Container-Bereitungen (stdlib funktioniert nur, wenn der Agent eDen MP-Server als Kindprozess startet)
Datenbank: PostgreSQL mit Metriktabellen im OpenTelemetry-Stil (
time,metric_name,metric_value, `attributes JSONB“, ...)Framework: FastMCP mit Pydantic-v2-Antwortmodellen
Für das vollständige Architekur-Document siehe Design.md.
Projektstruktur
MCPServers/
├── sapphire_wellness/
│ ├── server.py # FastMCP app + SSE entry point
│ ├── config.py # Settings (DB_URL, HOST, PORT via env)
│ ├── models/ # Pydantic response models per metric
│ ├── db/ # asyncpg pool + shared base query
│ ├── repositories/ # DB → model mapping (one per metric)
│ └── tools/ # MCP tool definitions (one per metric)
├── Design.md # Architecture reference
├── pyproject.toml
├── Dockerfile
├── podman-compose.yml
└── .env.exampleVoraussetzungen
Pyth Herm, ... C Preter her
Voraussetzungen
MCPServers/
├── sapphire_wellness/
│ ├── server.py # FastMCP app + SSE entry point
│ ├── config.py # Settings (DB_URL, HOST, PORT via env)
│ ├── models/ # Pydantic response models per metric
│ ├── db/ # asyncpg pool + shared base query
│ ├── repositories/ # DB → model mapping (one per metric)
│ └── tools/ # MCP tool definitions (one per metric)
├── Design.md # Architecture reference
├── pyproject.toml
├── Dockerfile
├── podman-compose.yml
└── .env.examplePrerequisites
Python 3.11+
PostgreSQL 14+ mitden angelegten 6 Wellnes-Mess-Metriktabellen
[podman-kom](https://github.com/containers/pod… compose) oder Docker Compose (for containerisierte Bereitstellung)
Schnellstart
Lokal Entwickung
# 1. Create and activate a virtual environment
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activate
# 2. Install dependencies
pip install -e .
# 3. Configure environment
cp .env.example .env
# Edit .env — set DB_URL to your PostgreSQL connection string
# 4. Run the server
python -m sapphire_wellness.server
# Server starts at http://0.0.0.0:8000Containerisierung (pod-compose)
# Build and start all services (postgres + mcp server)
podman-compose up --build
# Tear down
podman-compose downDer MCP-Server ist verfügbar unter http://localhost:10002/sse.
Um Ihren Agent-Containner zu verbinden, setzen Sie:
MCP_SERVER_URL=http://sapphire-mcp:10002/sseConfiguration
All settings read from environment variables (or .env file): "All settings are read from environment variables (or a .opt) file.
Variable | Standard | Beschreibung |
|
| PostgreSQL-Benutzername |
|
| PostgreSQL-Passwort |
|
| PostgreSQL-Host ( |
|
| PostgreSQL-Port |
|
| PostgreSQL-Datenbankname |
|
| Bind-Adresse des MCP-Servers |
|
| Bind-Port des MCP-Servers |
Tool-Referenz
Alle Tools teach these parameters:
Parameter | Type | Default | Description |
| user_id | str | — | User whose data to query |
| date | str | "today" | ISO-Datum YYYY-MM-DD oder "today" |
| period | str | "day" | "day" (24 h), "week" (7 Tage), "month" (30 Tage) |
**All tools share these parameters. vor." table. re...
get_activity
Gibt Schritte, Kalorien, Distanz und aktive Minuten zurück. Die Gesamtsummen werden den Zeitraum summiert.
get_blood_pressure
Liefert systolische/diastolische Messwerte in mmHg. Jeder Messwert wird anhand der AHA-Kategorien klassifiziert:
Normal — systolisch <120 und diastolisch <80
Erhöht — systolisch 120–129 und diastolisch <80
Hoch Stufe 1 — systolisch 130–139 oder diastolisch 80–89
Hoch Stufe 2 — systolisch ≥140 oder diastolisch ≥90
Hypertensive Krise — systolisch >180 oder diastolisch >120
get_glucose
Liefert Glukose-Werte in mg/dL mit Mahlzeitigkeitsspring. Mahlzeit context (fasting, pre_meal, post_meal, bedtime, random) und Statistik inklusive Zeit im Zielbereich (Ziel: 70–180 mg/dL).
get_heart_rate
Liefert Herzfrequenz-Messwertphe in BPM (active and ruhend) mit Dischnitt, Min., Max. und durchschnittlichen Ruhepuls.
###get_sleep
Liefert die Schlafphasen-Aufhdiederung (Tie-Schlaf, Leich-Schlaf, REM, Wachphasen) in Minuten, die Gesamtée! unddie Schlaf-effizienz in %.
get_he2
Liefert SpO2–Messwerte in % mit Durschnitt, Min., Max. und der Anzahl der Meldereignèíse mit niederer Sättigung (unter 95 %).
get_health_summary
Ruft alle 6 Metriken-Repositorien gleichzeitig auf und gibt eine einzelne zusammengefasste Antworte zurück –– ideal für täiche Gesundheitsberichte.
Investigating Tools
Use the [MCP Inspector](https://github.com/modelntextent も)-tool to explore tool schema и test calls:
npx @modelcontextprotocol/inspector http://localhost:8000/sseConnect to Claude Desktop
Add to your claude_desktop_config.json:
To connect Claude Desktop, add to your claude_desktop_config.json:
{
"mcpServers": {
"sapphire-wellness": {
"url": "http://localhost:8000/sse"
}
}
}Then ask Claude: „Wie war mein Blutdruck diese Woche?" – und it wird get_blood_pressure mit period="week" aufrufen.
Database Schema
All 6 timestamps: heartrate, bloodpressure, glucose, s, activity, sleep — the exact same OpenTelemetry-style schema. The metric_name column distinguishes sub-metrics within each table (e.g. systolic anddiastol are separate rows in bloodpressure). For full DDL and sub-metric mapping see Design.md.
Extending
Adding a new metric:
Erzuellen Sie
saphhire_wellness/models/<metric>.py– Pydantic-ModellErstellen Sie
sapphire_wellness/repositories/<metric>_repo.py– DB query + mappingErstellen Sie
sapphire_wellness/tools/<metric>.py– define@mcp.tool()Registieren Sie in
server.py
Swapping the database:
Implement a new class that imitates the method signatures in repositories/base.py and pass it to the register() functions in server.py.
Adding check_health_erts:
This tool is geplant for Phase 2. It marks values outside the normal threshold (e.g. BP >140/90, SpO2 <95%) and returns structured alerts with severity levels.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceExposes health metrics (activity, blood pressure, glucose, heart rate, sleep, SpO2) from the Sapphire Wellness App to AI assistants via the Model Context Protocol.
- FlicenseNot gradedqualityCmaintenanceExposes health metrics from the Sapphire Wellness App to AI assistants via MCP, enabling queries on activity, blood pressure, glucose, heart rate, sleep, and SpO2 data.
- FlicenseNot gradedqualityCmaintenanceExposes health metrics from the Sapphire Wellness App to AI assistants, enabling natural language queries for activity, blood pressure, glucose, heart rate, sleep, and SpO2 data.
- AlicenseNot gradedqualityCmaintenanceExposes Apple Health data as three read-only MCP tools (now, detail, trends) for AI to query health metrics, sleep, and trends via HTTP.MIT
Related MCP Connectors
63 tools for Apple Health, Fitbit, Oura & Health Connect data in Claude, ChatGPT, Grok & Mistral.
Garmin data in Claude & ChatGPT via the Garmin Health API. OAuth sign-in, no password sharing.
WHOOP recovery, strain, sleep and workouts in Claude via official WHOOP OAuth. Free, open source.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/IBMC-WORK-REDESIGN-FDE-COHORT-SB/sapphire-wellness-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server