Provides comprehensive access to Oura Ring health data through the Oura API v2, including sleep metrics, activity tracking, readiness scores, heart rate data, workouts, stress levels, VO2 max, SpO2, and personal health information with support for natural language date queries.
Oura MCP
A comprehensive Model Context Protocol (MCP) server for the Oura Ring API v2, providing LLMs like Claude with seamless access to sleep, activity, readiness, heart rate, and other health metrics from your Oura Ring.
Features
🔧 15+ MCP Tools: Interactive data fetching with flexible date ranges
📊 5 MCP Resources: Quick access to recent summaries without parameters
🔄 OAuth2 Token Management: Automatic token refresh with persistent storage
📅 Natural Language Dates: Support for "today", "yesterday", "last week"
🛡️ Comprehensive Error Handling: Graceful handling of API errors with detailed messages
📖 Complete API Coverage: All major Oura API v2 endpoints
Available Tools
Core Daily Summaries
get_daily_sleep- Sleep scores and contributors (deep sleep, REM, efficiency, etc.)get_daily_activity- Activity scores, steps, calories, and MET minutesget_daily_readiness- Readiness scores with HRV, temperature, and recovery metricsget_daily_stress- Stress and recovery time in seconds
Detailed Sleep Data
get_sleep_periods- Detailed sleep sessions with phases, heart rate, HRV, breathingget_sleep_time- Optimal bedtime recommendations
Activity & Workouts
get_workouts- Workout summaries with type, intensity, calories, distanceget_sessions- Meditation, breathing exercises, and nap sessions
Time-Series Data
get_heartrate- 5-minute interval heart rate measurements
Advanced Metrics
get_daily_spo2- Blood oxygen levels during sleep (Gen 3 ring)get_vo2_max- VO2 max cardiorespiratory fitness estimatesget_daily_resilience- Resilience scores and levelsget_cardiovascular_age- Predicted vascular age [18-100]
User Data
get_personal_info- Age, weight, height, biological sex, emailget_ring_configuration- Ring model, color, size, firmware versionget_enhanced_tags- User-entered tags and annotationsget_rest_mode_periods- Rest mode periods
Available Resources
Quick access to recent data without parameters:
oura://summary/today- Today's readiness, sleep, and activity scoresoura://summary/yesterday- Yesterday's complete summaryoura://personal/info- Personal information and ring configurationoura://recent/sleep- Last 7 days of sleep scoresoura://recent/activity- Last 7 days of activity scores
Prerequisites
Oura Ring Account: Active Oura Ring with synced data
Personal Access Token: Get it from Oura Cloud
That's it! For personal use, a Personal Access Token is all you need.
Getting Your Personal Access Token (Recommended - 2 minutes)
Log in with your Oura account
Click "Create A New Personal Access Token"
Give it a name (e.g., "MCP Server")
Copy the token (you won't see it again!)
Note: Personal Access Tokens don't expire but can be revoked. Perfect for personal use!
OAuth2 Setup (Advanced - For Production Apps)
Only needed if you're building a production application that requires automatic token refresh.
Create a new application
Note your
Client IDandClient SecretComplete the OAuth2 flow to get access and refresh tokens
For detailed OAuth2 flow, see Oura API Documentation.
Installation & Setup
For Claude Desktop
Get your Oura Personal Access Token:
Create a new token
Copy it immediately (you won't see it again!)
Configure Claude Desktop:
Edit your Claude Desktop config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add the server configuration:
{ "mcpServers": { "oura": { "command": "uvx", "args": ["oura-mcp"], "env": { "OURA_ACCESS_TOKEN": "YOUR_PERSONAL_ACCESS_TOKEN_HERE" } } } }For OAuth2 with auto-refresh (advanced), include all four variables:
{ "mcpServers": { "oura": { "command": "uvx", "args": ["oura-mcp"], "env": { "OURA_ACCESS_TOKEN": "YOUR_ACCESS_TOKEN_HERE", "OURA_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN_HERE", "OURA_CLIENT_ID": "YOUR_CLIENT_ID_HERE", "OURA_CLIENT_SECRET": "YOUR_CLIENT_SECRET_HERE" } } } }Restart Claude Desktop
Verify: Look for the 🔌 icon in Claude - you should see the Oura server connected
For Development
Clone or create the project:
git clone <repository-url> cd oura-mcpCreate :
cp .env.example .envEdit
.envand add your Personal Access Token:OURA_ACCESS_TOKEN=your_personal_access_token_here(For OAuth2 setup, see the comments in
.env.example)Install dependencies:
uv syncTest with MCP Inspector:
uv run mcp dev src/oura_mcp/server.pyOpen the provided URL (usually http://localhost:5173) to interact with the server.
Configuration
Environment Variables
Variable | Required | Description |
| Yes | Personal Access Token or OAuth2 access token |
| No | OAuth2 refresh token (for automatic token renewal) |
| No* | OAuth2 client ID (*required if using
) |
| No* | OAuth2 client secret (*required if using
) |
| No | Path to token storage file (default:
) |
Authentication Methods
Method 1: Personal Access Token (Recommended)
✅ Simple setup - just one token
✅ No expiration (unless you revoke it)
✅ Perfect for personal use
❌ Must manually revoke/recreate if compromised
Method 2: OAuth2 with Refresh Tokens (Advanced)
✅ Automatic token refresh
✅ Tokens expire regularly (more secure)
✅ Better for production applications
❌ More complex setup (4 variables)
Token Management
Personal Access Token:
Does not expire automatically
Can be revoked at https://cloud.ouraring.com/personal-access-tokens
No automatic refresh needed
OAuth2 Tokens:
Automatic Refresh: If you provide all OAuth2 credentials, the server will automatically refresh your access token when it expires (typically after 24 hours)
Token Persistence: Updated tokens are automatically saved to
.oura_tokens.jsonfor persistence across restartsManual Refresh: If only access token is provided, you'll need to manually update it when it expires
Usage Examples
Using with Claude
Once configured, you can ask Claude natural questions like:
"What was my sleep score last night?"
"Show me my activity data for the past week"
"How is my readiness trending over the last month?"
"What was my heart rate during my workout yesterday?"
"Show me my VO2 max progression"
Tool Parameters
Most tools accept flexible date parameters:
Resource Access
Resources provide instant access without parameters:
Simply reference
oura://summary/todayto get today's summaryUse
oura://recent/sleepfor the last week of sleep data
API Rate Limits
The Oura API has a rate limit of 5,000 requests per 5-minute rolling window. This server handles:
Automatic pagination for large datasets
Error messages when rate limits are exceeded
Efficient resource caching where appropriate
Best Practice: Use webhooks (not included in this server) for real-time updates instead of frequent polling.
Troubleshooting
"No access token available" error
Solution: Ensure OURA_ACCESS_TOKEN is set in your environment or .env file.
Get a Personal Access Token from: https://cloud.ouraring.com/personal-access-tokens
Token expired (401 error)
For Personal Access Token users:
Personal Access Tokens don't expire unless revoked
If you get this error, your token may have been revoked
Create a new token at https://cloud.ouraring.com/personal-access-tokens
For OAuth2 users:
If you have all OAuth2 credentials configured, the server will automatically refresh it
If not, manually obtain a new access token and update your configuration
"Missing scopes" error (403)
Solution: Re-authorize your application with the required scopes. The error message will indicate which scopes are needed.
Rate limit exceeded (429 error)
Solution: Wait for the rate limit window to reset (5 minutes). Consider:
Reducing query frequency
Using date ranges instead of multiple single-day queries
Implementing webhooks for real-time data (not included in this server)
Connection issues
Solutions:
Check your internet connection
Verify Oura API is accessible: https://api.ouraring.com
Ensure your access token is valid
Data not available (404)
Cause: The requested data doesn't exist for the specified date range.
Solutions:
Ensure your Oura Ring has synced recently (requires opening the mobile app)
Check that you're querying dates when you were wearing the ring
Some metrics require Gen 3 ring (e.g., SpO2)
Data Availability Notes
Sleep data: Requires manual sync via mobile app
Activity data: Syncs automatically in background
Real-time data: Not available; data appears after sync
Historical data: Available for several months to years depending on metric
Security
Token Storage:
Personal Access Tokens are stored in environment variables only
OAuth2 tokens are stored locally in
.oura_tokens.json(add to.gitignore)
Secure Transport: All API calls use HTTPS
No Data Collection: This server only communicates with Oura's API
Token Permissions: Personal Access Tokens have full account access; OAuth2 tokens can be scoped
Required API Scopes
This server requires the following Oura API scopes:
personal- Personal information (age, weight, height)daily- Daily summaries (sleep, activity, readiness, stress)heartrate- Heart rate time-series dataworkout- Workout summariessession- Meditation and breathing sessionstag- User tags and annotationsspo2Daily- SpO2 data (if using Gen 3 ring)
Development
Running Tests
Building
Publishing
Architecture
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
License
MIT License - see LICENSE file for details
Support
Oura API Documentation: https://cloud.ouraring.com/docs
Oura API Support: api-support@ouraring.com
MCP Documentation: https://modelcontextprotocol.io
Changelog
v0.1.0 (Initial Release)
Complete Oura API v2 integration
15+ MCP tools for data fetching
5 MCP resources for quick access
OAuth2 token management with auto-refresh
Natural language date parsing
Comprehensive error handling
Token persistence across restarts
Acknowledgments
Built with FastMCP
Powered by Oura API v2
Model Context Protocol by Anthropic
This server cannot be installed