dbx
Query databases from AI agents using connections configured in DBX.
T8t8y2/dbx32k726 new stars in the last 7 days
Local SQLite MCP server for health exports (Apple Health, Oura, Health Connect, WHOOP, CSV).
Local SQLite health storage, Python analytics, and an MCP server — with source provenance and data-quality caveats.
A local-first Model Context Protocol (MCP) server for personal health exports (Apple Health, Oura, Health Connect, Google Fit, WHOOP v2 JSON, and CSV). Keep storage and math on your machine, use LM Studio / Ollama for local inference or connect Claude Desktop / Cursor / Windsurf with field-level redaction.
⚡ Instant Client Setup • 🚀 Quick Start • 💡 Why This? • 🔎 Data-Quality Checks • 📊 Supported Data • 💬 Community & Discussions • 📚 Documentation
Connect Quantified Self MCP to your favorite AI assistant in seconds:
Add this to your Claude Desktop configuration:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json{
"mcpServers": {
"quantified-self": {
"command": "uvx",
"args": ["quantified-self-mcp"]
}
}
}
(Or point "command" to your installed quantified-self-mcp binary if installed via pip).
In Cursor, navigate to Settings → Features → MCP Servers → Add New MCP Server, or add to .cursor/mcp.json:
{
"mcpServers": {
"quantified-self": {
"command": "uvx",
"args": ["quantified-self-mcp"]
}
}
}
Add to your mcp_config.json:
{
"mcpServers": {
"quantified-self": {
"command": "uvx",
"args": ["quantified-self-mcp"]
}
}
}
Tip
Need guides for LM Studio, Open WebUI, or Android Health Connect? See our step-by-step Client Guides.
pip install quantified-self-mcp
Quantified Self MCP automatically creates and manages a local SQLite database (health.db). You can test it immediately with 60 days of realistic sample data, or import your personal health history:
# Instant demo mode (seeds 60 days of synthetic health data):
quantified-self-init-db --demo
# Or import your own wearable exports:
quantified-self-init-db export.zip # Apple Health (.zip or export.xml)
quantified-self-init-db oura.json --source oura # Oura Ring API (v2)
quantified-self-init-db health_connect_export.json --source health-connect # Android Health Connect
quantified-self-init-db takeout-fit.zip --source google-fit # Google Fit (Google Takeout)
quantified-self-init-db whoop.json --source whoop # WHOOP Developer API (v2, synthetic-tested)
quantified-self-init-db your-health-data.csv # CSV
Run the built-in diagnostic tool to verify Python dependencies, schema integrity, and database readiness:
quantified-self-doctor
Open your MCP-connected assistant and ask questions in plain English:
"How has my sleep and resting heart rate changed over the last 30 days?"
"Why did my HRV drop last week?"
"What patterns exist between my workout minutes and sleep quality?"
"Which of my health metrics changed the most this month?"
Most health apps either trap your data in a closed cloud dashboard or feed raw numbers blindly into an LLM. Quantified Self MCP provides a trustworthy, analytical bridge:
| Feature | Standard Health Dashboards | Naive LLM Prompts | Quantified Self MCP |
|---|---|---|---|
| Data Ownership | ❌ Locked in Cloud | ⚠️ Raw exports pasted to cloud | ✅ Local SQLite (health.db) |
| Privacy Redaction | ❌ All or nothing | ❌ Raw data dumped | ✅ Granular Field Exclusion |
| Data-Quality Checks | ⚠️ Uncalibrated percentages | ❌ Hallucinated correlations | ✅ Sample, Gap & Source Caveats |
| Provenance Tracking | ❌ Opaque | ❌ None | ✅ Per-device origin resolution |
| Atomic Snapshots | ⚠️ Manual exports | ❌ None | ✅ WAL-safe backup/restore |
Your database and MCP server run locally in SQLite with no proprietary health cloud or telemetry. Local storage is not local inference: if you connect a cloud assistant (like Claude Desktop or Cursor), the JSON returned by tool calls goes to that LLM provider. For end-to-end local privacy, pair the server with a local model via LM Studio or Ollama.
You can also redact specific sensitive metrics from being exposed to any AI client:
export HEALTH_PRIVATE_FIELDS=weight_kg,mood
Private fields remain stored in SQLite for your own records, but are blocked from all AI queries and analytics.
When an AI summarizes your personal health logs, a percentage without coverage context is easy to misread.
If an LLM sees a 24% drop in HRV, did it come from 30 continuous days of wearable data, or 14 sparse readings with a 5-day gap or a mid-month device switch?
Quantified Self MCP runs deterministic N=1 data-quality checks in Python (qs_evidence/registry.yaml) alongside every analytical result:
Analysis Result
↓
claim: ClaimEvidence
├── evidence → Raw coverage observed (days logged, max gap, freshness)
├── profile → Dimension checks (sample size, temporal spread, missingness, provenance)
└── decision → Claim tier + mandatory caveats (must_state):
[ insufficient | suggestive | detectable_not_meaningful | supported ]
Without Caveats (Naive LLM):
"Your HRV dropped 24% over the last month. You may be overtraining."
With Quantified Self MCP Caveats:
"Your HRV decreased 24% over the last 30 days — though HRV was logged on 71% of days with a 5-day gap, so this is capped at
suggestiverather thansupported. (Source: Apple Watch)."
Note
The cutoffs in
qs_evidence/registry.yamlare conservative engineering heuristics (not clinical criteria). Today, trends, comparisons, correlations, and anomalies cap atsuggestive(practical_not_evaluated) until practical effect-size checking is implemented; onlybaselinecan reachsupported. See Evidence Thresholds & Claim Tiers for the exact numbers.
Quantified Self MCP ships with 20 specialized tools spanning raw measurements, longitudinal statistics, and data health:
AI Agent (Claude / Cursor / LM Studio)
│
MCP Protocol
│
▼
┌──────────────────────────────────────────────────┐
│ Quantified Self MCP │
│ │
│ • Data Access • Longitudinal Analytics │
│ • Workout Tracking • ClaimEvidence Engine │
│ • Provenance Resolver • Data Freshness/Health │
└────────────────────────┬─────────────────────────┘
│
▼
Local SQLite (health.db)
| Metric | Category | Standard Unit | Notes |
|---|---|---|---|
| 👟 Steps | Activity | count | Summed per day with multi-source deduplication |
| 😴 Sleep | Recovery | hours | Provenance-checked interval handling |
| ❤️ Resting Heart Rate | Cardiovascular | bpm | Daily baseline tracking & anomaly detection |
| 📈 HRV (Heart Rate Variability) | Recovery | ms | RMSSD/SDNN normalized |
| ⚖️ Weight & Body Fat | Measurements | kg / % | High-precision episodic measurement tracking |
| 🏋️ Workouts | Activity | minutes / kcal | Individual workout sessions with sport metadata |
| 🙂 Mood | Wellness | 1-5 scale | Subjective well-being logs |
| 💧 Water Intake | Nutrition | ml | Daily fluid tracking |
The schema is fully extensible with custom metric definitions in metric_registry.py.
| Client / Assistant | Compatibility | Documentation |
|---|---|---|
| Claude Desktop | ✅ Official Support | Claude Desktop Setup Guide |
| Cursor | ✅ Full Support | Cursor IDE Setup Guide |
| Windsurf | ✅ Full Support | Configure via mcp_config.json |
| LM Studio | ✅ Local AI | LM Studio Setup Guide |
| Open WebUI | ✅ Self-Hosted | Open WebUI Setup Guide |
| Android Health Connect | ✅ Export & Ingest | Health Connect Guide |
Never copy health.db while your server or MCP client is running: SQLite runs in WAL mode, meaning uncommitted writes live in health.db-wal.
Use the built-in backup CLI, which takes a live, consistent snapshot:
# Create a verified snapshot:
quantified-self-backup create ~/backups/health-2026-11-04.db
# Safe restore (checks schema integrity before moving old DB aside):
quantified-self-backup restore ~/backups/health-2026-11-04.db
Run anytime to check your Python runtime, database version, and environment configuration:
quantified-self-doctor
Deep-dive documentation and technical specs:
Contributions are warmly welcomed! We are actively looking for contributions in:
Please review CONTRIBUTING.md and CODE_OF_CONDUCT.md before opening a pull request.
Licensed under the MIT License.
Query databases from AI agents using connections configured in DBX.
T8t8y2/dbx32k726 new stars in the last 7 days
Run Windmill scripts and flows and manage jobs, schedules, resources and variables.
WIwindmill-labs/windmill19k82 new stars in the last 7 days
MCP Toolbox for Databases enables your agent to connect to your database.
GOgoogleapis/mcp-toolbox17k77 new stars in the last 7 days
Open-source, self-hosted alerting for metrics, logs, and databases. Includes a built-in AI agent and MCP server.
CCccfos/nightingale14k10 new stars in the last 7 days
Real-time Kubernetes network traffic visibility and API analysis for HTTP, gRPC, Redis, Kafka, DNS.
KUkubeshark/kubeshark12k5 new stars in the last 7 days
Let your users work with their own data through an AI assistant, limited to what they can see.
NHnhost/nhost9.4k1 new stars in the last 7 days