Quantified Self MCP
Your health data. Your AI. Your machine.
Quantified Self MCP is a privacy-first Model Context Protocol (MCP) server that gives AI agents controlled access to your personal health data stored locally.
Built with Python, FastMCP, and SQLite, it works with both local LLMs and cloud-based LLMs. You choose where your AI runs.
What Is It?
Quantified Self MCP connects an AI agent to your personal health data through the Model Context Protocol (MCP).
┌─────────────────────┐
│ AI Agent │
│ │
│ Local LLM / Cloud │
└──────────▲──────────┘
│
MCP tool result
│
MCP tool call
│
┌──────────┴──────────┐
│ Quantified Self MCP │
│ FastMCP │
│ LOCAL │
└──────────▲──────────┘
│
SQL / data
│
┌──────────┴──────────┐
│ Local SQLite │
│ Health Data │
│ LOCAL │
└─────────────────────┘
The MCP server does not require a specific AI provider.
You can run the entire AI stack locally, or connect the server to an online model when you prefer.
🏠 Local AI or ☁️ Cloud AI
The important distinction is between the MCP server and the AI model.
Fully Local
Your Health Data
↓
Local SQLite
↓
Quantified Self MCP
↓
Local AI Agent
↓
Local LLM
With a local MCP-compatible agent and local LLM, your health data and AI inference can remain on your machine.
Cloud LLM
Your Health Data
↓
Local SQLite
↓
Quantified Self MCP
↓
AI Agent
↓
Cloud LLM
You can also connect the same MCP server to a hosted model.
In that setup, your database and MCP server remain local, while data returned by MCP tools may be sent to the cloud model provider.
The choice is yours.
Quantified Self MCP does not lock you into Claude, OpenAI, or any other model provider.
🔒 Privacy First
Your health data is stored locally in SQLite, and the MCP server runs on your machine.
The server itself does not require a cloud database, account, or hosted data store.
For maximum privacy, use a local LLM so the entire pipeline can remain on your machine.
┌───────────────────────────────────┐
│ YOUR MACHINE │
│ │
│ Health Data │
│ ↓ │
│ Local SQLite │
│ ↓ │
│ Quantified Self MCP │
│ ↓ │
│ Local AI Agent │
│ ↓ │
│ Local LLM │
│ │
└───────────────────────────────────┘
Optional Private Fields
If specific metrics should never be returned to the model, configure:
HEALTH_PRIVATE_FIELDS=weight_kg,mood
Private fields can still be stored and logged, but MCP read operations return them as null.
This gives you another layer of control over which health metrics an AI agent can access.
❤️ What Can It Track?
Quantified Self MCP currently supports:
- 👟 Daily steps
- 😴 Sleep duration
- ❤️ Resting heart rate
- ⚖️ Weight
- 🏋️ Workout minutes
- 🙂 Mood
- 💧 Water intake
Every metric is optional, so you can track only the measurements you actually use.
💬 What Can You Ask?
Once connected to an MCP-compatible AI agent, you can ask questions naturally.
For example:
How has my sleep changed over the last 30 days?
What was my average step count this week?
Show me my resting heart rate trend.
How much water did I drink on average this month?
What patterns do you see in my recent health data?
You can also log information through the AI agent:
Log 7.5 hours of sleep for today.
Or correct a mistake:
Clear today's mood entry.
🧠 MCP Tools
The server currently provides three MCP tools:
| Tool | Purpose |
|---|---|
read_health_data |
Read health metrics for a selected date range |
log_daily_metric |
Record one or more health metrics for a specific day |
clear_metric |
Clear a single metric without affecting other data |
The server also exposes read-only MCP resources for health metric schemas and individual days.
All data operations are scoped to the supported health metrics. The server does not expose arbitrary SQL execution to the model.
📥 Import Your Health Data
You can initialize the local database from CSV data.
quantified-self-init-db sample_data/health_sample.csv
The supported health fields include:
date
steps
sleep_hours
resting_heart_rate
weight_kg
workout_minutes
mood
water_ml
You can also import an Apple Health export:
quantified-self-init-db export.xml
The importer maps supported Apple Health records into the local database.
⚡ Installation
PyPI
pip install quantified-self-mcp
This installs:
quantified-self-mcp
quantified-self-init-db
From Source
git clone https://github.com/Thecimal/quantified-self-mcp.git
cd quantified-self-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Docker
docker build -t quantified-self-mcp .
The included Docker configuration can be used for containerized MCP deployments, including Glama.
🚀 Quick Start
1. Install
pip install quantified-self-mcp
2. Load your health data
quantified-self-init-db your-health-data.csv
3. Connect the MCP server
Connect Quantified Self MCP to an MCP-compatible AI agent.
4. Choose your model
Use either:
- A local LLM
- A cloud-based LLM
5. Ask your health data questions
How has my sleep changed over the last 30 days?
The AI agent retrieves the relevant health data through MCP and analyzes it.
🔌 MCP Client Compatibility
Quantified Self MCP uses the standard Model Context Protocol, so the server is designed to work with MCP-compatible clients and models rather than being tied to a single AI application.
The project includes configuration for clients supported by FastMCP, and standard MCP configuration can be generated for other compatible clients.
For local AI setups, pair the server with an MCP-compatible client and a local LLM runtime.
For example:
Local LLM
+
MCP-compatible Agent
+
Quantified Self MCP
This allows the complete AI workflow to remain local.
🏗️ Architecture
┌────────────────────┐
│ AI Agent │
└─────────┬──────────┘
│
MCP Protocol
│
▼
┌────────────────────┐
│ Quantified Self │
│ MCP │
│ │
│ FastMCP │
└─────────┬──────────┘
│
▼
┌────────────────────┐
│ Local SQLite │
│ │
│ Health Data │
└────────────────────┘
The AI model and the MCP server are separate components.
This means you can change the AI model without changing how your health data is stored or exposed.
🛠️ Technology
| Component | Technology |
|---|---|
| Language | Python |
| Protocol | Model Context Protocol |
| MCP Framework | FastMCP |
| Database | SQLite |
| Containerization | Docker |
| CI | GitHub Actions |
| Package | PyPI |
🧪 Development
Clone the repository:
git clone https://github.com/Thecimal/quantified-self-mcp.git
cd quantified-self-mcp
Create a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
Install dependencies:
pip install -r requirements-dev.txt
Run tests:
pytest
Build the package:
python -m build
GitHub Actions validates the project in a clean environment.
📁 Project Structure
quantified-self-mcp/
├── .github/
│ └── workflows/
├── sample_data/
├── tests/
├── Dockerfile
├── fastmcp.json
├── glama.json
├── init_db.py
├── logic.py
├── import_adapters.py
├── server.py
├── pyproject.toml
├── requirements.txt
├── requirements-dev.txt
├── SECURITY.md
├── CONTRIBUTING.md
├── LICENSE
└── README.md
🛡️ Security
Health information is sensitive personal data.
Never commit:
- Personal health records
- Private SQLite databases
- API keys
- Passwords
- Authentication tokens
- Other sensitive personal information
For security vulnerabilities, please follow the instructions in SECURITY.md.
⭐ Glama
Quantified Self MCP is available through the Glama MCP directory.
Glama Score
A / A / B
| Category | Score |
|---|---|
| License | A |
| Quality | A |
| Maintenance | B |
The project is listed as a Python / Local MCP server on Glama, and its current MCP inspection shows three health-data tools with maintained activity.
View Quantified Self MCP on Glama →
🤝 Contributing
Contributions, bug reports, documentation improvements, and ideas are welcome.
Before contributing, please read:
If you find a bug, please open an issue with enough information to reproduce it.
📄 License
MIT License.
Links
- GitHub: https://github.com/Thecimal/quantified-self-mcp
- PyPI: https://pypi.org/project/quantified-self-mcp/
- Glama: https://glama.ai/mcp/servers/Thecimal/quantified-self-mcp
- Author: https://github.com/Thecimal
Quantified Self MCP
Your health data. Your AI. Your machine.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quantified_self_mcp-0.2.2.tar.gz.
File metadata
- Download URL: quantified_self_mcp-0.2.2.tar.gz
- Upload date:
- Size: 55.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49da6f9a1c072f775b40be493a59217c1f477d128fbcd135840a03651b4575f4
|
|
| MD5 |
ba80ad5086c2a015907383a591564f35
|
|
| BLAKE2b-256 |
05072247d0e2c9a52256014a9295053dd1f7d143fe52732c118cc9a06f2389ec
|
File details
Details for the file quantified_self_mcp-0.2.2-py3-none-any.whl.
File metadata
- Download URL: quantified_self_mcp-0.2.2-py3-none-any.whl
- Upload date:
- Size: 30.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bed15f5a4771977185949abad01c236b38987f84a080d5974d0a57e7dff48519
|
|
| MD5 |
bbd78da3bcaa83de5c1fc5545294a7e3
|
|
| BLAKE2b-256 |
be224f19e39dc6d3608a0624508d52189bfed5a4f5e21256ed270100f3a6a99d
|