Oura MCP Server

Oura MCP Server

A Model Context Protocol (MCP) server that provides AI assistants with structured, semantic access to your Oura Ring health data.

Category
Visit Server

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 — retrieves average_hrv in 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

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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured