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
访问服务器

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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选