Oura MCP Server
A Model Context Protocol (MCP) server that provides AI assistants with structured, semantic access to your Oura Ring health data.
README
Oura MCP Server
A Model Context Protocol (MCP) server that provides AI assistants with structured, semantic access to your Oura Ring health data.
Features
š Raw HRV Data Access (v0.7.0) ā
- Raw HRV Trend:
get_hrv_trendā retrievesaverage_hrvin real milliseconds from the detailed sleep endpoint (not score-based), with resting HR (lowest nightly value), sleep stages, and automatic trend analysis across configurable time windows (NEW in v0.7.0)
Features
š½ļø Nutrition Intelligence (v0.6.0) ā
- Calorie Needs Prediction: 7-day TDEE forecasts based on activity patterns (NEW in v0.6.0)
- Flexible Macro Planning: Choose from 9 nutrition styles OR set custom carb limits (NEW in v0.6.0)
- BMR & TDEE Calculation: Mifflin-St Jeor formula with Oura activity integration (NEW in v0.6.0)
- Weekly Pattern Analysis: Day-of-week calorie expenditure patterns (NEW in v0.6.0)
- Personalized Recommendations: Protein/carb/fat targets based on your approach (NEW in v0.6.0)
š§ Health Intelligence (v0.5.0) ā
- Chronotype Analysis: MSF-based classification (Night Owl, Morning Lark) with personalized recommendations
- Personalized Sleep Need: Auto-detection via readiness correlation - no more one-size-fits-all 8h target
- Analytics: Comprehensive statistical reports with correlations and trend detection
- Predictions: 7-day forecasts for sleep, readiness, and activity with ensemble learning
- Sleep Optimization: Optimal bedtime calculator and personalized sleep debt tracking
- Supplement Analysis: Correlation tracking between supplements and health metrics
- Illness Detection: Multi-signal early warning system (1-2 day advance notice)
- Health Alerts: Automated monitoring with personalized, adaptive thresholds
- Weekly Reports: Comprehensive summaries with week-over-week comparisons
- Recovery Detection: Multi-signal recovery assessment with weighted scoring
- Training Readiness: Sport-specific recommendations (general, endurance, strength, HIIT)
- Anomaly Detection: Statistical detection of concerning patterns
š Data Access Tools (v0.3.0+) ā
- Detailed Sleep Sessions: Exact sleep/wake times, biphasic/polyphasic tracking
- Heart Rate Monitoring: Time-series data with HR zones and activity breakdown
- Workout Sessions: Complete workout history with metrics
- Stress & Recovery: Daily stress levels and recovery time tracking
- SpO2 Monitoring: Blood oxygen saturation trends
- VO2 Max: Cardiorespiratory fitness estimates
- User Tags: Custom notes and activity tracking
š„ Health Resources (v0.2.0+) ā
- Sleep Analysis: Detailed sleep stages, efficiency, scores
- Readiness Metrics: HRV, temperature, recovery indicators
- Activity Tracking: Steps, calories, activity scores
- HRV Insights: Baseline comparison and trend detection
- Personal Info: Age, weight, height, biological sex
š§ Core Features ā
- Modular Architecture: Clean separation of concerns (v0.3.1)
- Smart Caching: Respects Oura API rate limits
- Privacy Controls: Configurable access levels and audit logging
- Comprehensive Testing: 100% test coverage for all features
Project Structure
oura-mcp-server/
āāā src/oura_mcp/
ā āāā api/
ā ā āāā client.py # Oura API v2 client
ā āāā core/
ā ā āāā server.py # MCP server orchestration (1,100+ lines)
ā āāā resources/ # MCP Resources (health data endpoints)
ā ā āāā formatters.py # Data formatting utilities
ā ā āāā health_resources.py # Sleep, readiness, activity, HRV
ā ā āāā metrics_resources.py # Personal info, stress, SpO2
ā āāā tools/ # MCP Tools (analysis functions)
ā ā āāā analytics_tools.py # Statistics, sleep debt, supplements
ā ā āāā prediction_tools.py # Forecasting with ensemble learning
ā ā āāā intelligence_tools.py # Recovery, training, illness detection
ā ā āāā data_tools.py # Data access (sessions, HR, workouts)
ā ā āāā debug_tools.py # Weekly reports and utilities
ā āāā utils/
ā āāā sleep_aggregation.py # Biphasic/polyphasic sleep handling
ā āāā chronotype_analysis.py # Chronotype detection (MSF-based)
ā āāā illness_detection.py # Multi-signal illness warning system
ā āāā sleep_debt.py # Sleep debt tracking with recovery
ā āāā baselines.py # Baseline tracking (30-day averages)
ā āāā anomalies.py # Anomaly detection engine
ā āāā interpretation.py # Health insights interpreter
ā āāā config.py # Configuration management
ā āāā logging.py # Structured logging
āāā tests/
ā āāā test_server.py # Basic server tests
ā āāā test_advanced_features.py # Intelligence features tests
ā āāā test_api.py # API integration tests
āāā docs/ # Comprehensive documentation
āāā config/ # Configuration templates
āāā main.py # Server entry point
Quick Start
Prerequisites
- Python 3.10+ (or Docker)
- Oura Ring with API access
- Personal Access Token from Oura Cloud
Option 1: Docker (Recommended)
# Set your token
export OURA_ACCESS_TOKEN="your_token_here"
# Start with Docker Compose
docker-compose up -d
# View logs
docker-compose logs -f
See docs/DOCKER.md for complete Docker documentation.
Option 2: Local Python Installation
# Install dependencies
pip install -r requirements.txt
# Configure your Oura token
export OURA_ACCESS_TOKEN="your_token_here"
# Run the server
python main.py
Configuration
Copy config/config.example.yaml to config/config.yaml and customize:
oura:
api:
access_token: "${OURA_ACCESS_TOKEN}"
cache:
enabled: true
ttl_seconds: 3600
mcp:
server:
name: "Oura Health MCP"
transport: "stdio"
Usage with AI Clients
Claude Desktop
Add to your Claude config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"oura": {
"command": "python",
"args": ["/path/to/oura-mcp-server/main.py"]
}
}
}
Example Queries
Basic Queries:
- "How did I sleep last night?"
- "What's my readiness score today?"
- "Give me my daily health brief"
Detailed Data (NEW in v0.3.0):
- "Show me my sleep sessions for the last 3 days"
- "What was my heart rate during my workout yesterday?"
- "Get my stress levels for the past week"
- "Show me my blood oxygen levels"
- "What's my VO2 Max?"
- "Show me the tags I created this week"
Nutrition & Calorie Planning (NEW in v0.6.0):
- "Predict my calorie needs for the next 7 days with max 30g carbs"
- "Show me my TDEE forecast with keto macros"
- "What's my calorie expenditure prediction with carnivore diet?"
- "Calculate my macro targets for next week with 50g carb limit"
Chronotype & Sleep Optimization:
- "What's my chronotype based on my sleep patterns?"
- "Calculate my personal sleep need using my readiness data"
- "What's my sleep debt and how long will recovery take?"
- "Calculate my optimal bedtime based on recent patterns"
Analytics & Statistics:
- "Generate a statistics report for the last 30 days"
- "Does my magnesium supplement improve my sleep quality?"
- "Show me a comprehensive weekly health report"
Predictions & Intelligence:
- "Predict my sleep quality for the next 7 days"
- "Forecast my readiness and activity scores for this week"
- "Am I at risk of getting sick? Check for early warning signs"
- "Generate health alerts for any concerning trends"
Recovery & Training:
- "Am I recovered enough for a hard workout today?"
- "Assess my readiness for high-intensity training"
- "What's my HRV trend over the last week?"
- "Is there a correlation between my sleep and activity levels?"
- "Are there any concerning anomalies in my recent data?"
Development
# Run all tests
python3 tests/test_advanced_features.py
# Run API tests
python3 tests/test_api.py
# Run server tests
python3 tests/test_server.py
# Run with debug logging
python main.py --log-level debug
# Type checking
mypy src/
# Linting
ruff check src/
Documentation
- v0.6.0 Release Notes - Nutrition intelligence & calorie forecasting (NEW)
- v0.5.0 Release Notes - Personalized health insights
- v0.4.0 Release Notes - Complete v0.4.0 documentation
- Phase 2 Quick Start Guide - User guide for intelligence features
- Implementation Summary - Complete Phase 2 documentation
- MCP Design - Architecture and design documentation
- Release Notes - Version history and changelog
- Bug Fixes - Known issues and fixes
- Oura API Research - API documentation
- Test Results - Test validation results
Security
- Tokens stored in environment variables only
- Audit logging of all MCP requests
- Configurable access levels (summary/standard/full)
- Local-only data processing
Roadmap
- [x] v0.1.0 - v0.2.0: Core MVP (basic resources + authentication)
- [x] v0.3.0: Complete API coverage (all Oura v2 endpoints) ā 2025-01-15
- [x] v0.3.1: Code refactoring & modular architecture ā 2026-01-17
- [x] v0.4.0: Health intelligence platform (analytics, predictions, illness detection) ā 2026-01-17
- [x] v0.5.0: Personalized health insights (chronotype, adaptive thresholds) ā 2026-01-17
- [x] v0.6.0: Nutrition intelligence & calorie forecasting ā 2026-01-18
License
MIT
Contributing
This is a personal project, but suggestions and improvements are welcome via issues.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.