Oura Ring MCP Server
A Python-based Model Context Protocol server that provides AI assistants with access to Oura Ring health and fitness data across 15+ endpoints. It enables querying metrics like sleep, activity, readiness, and cardiovascular health through simple authentication and date-range filtering.
README
Oura Ring MCP Server
A Model Context Protocol (MCP) server that provides seamless access to your Oura Ring health and fitness data. Built with Python and FastMCP, this server enables AI assistants like Claude to query your sleep, activity, readiness, and other health metrics.
Features
- Comprehensive Health Data Access: 15+ data endpoints covering all major Oura Ring metrics
- Simple Authentication: Personal Access Token support for easy setup
- FastMCP Integration: Built on the FastMCP framework for reliable MCP protocol support
- AWS Bedrock Ready: Includes deployment scripts and configuration for AWS Bedrock AgentCore
- Date Range Queries: Flexible date filtering for all metrics
- Type-Safe: Fully typed Python implementation
Available Tools
The server provides the following tools to query your Oura Ring data:
Sleep & Recovery
get_daily_sleep- Daily sleep scores, duration, efficiency, and sleep stagesget_sleep_sessions- Detailed sleep sessions with heart rate, HRV, and movementget_sleep_time- Sleep timing information (bedtime and wake time)get_daily_readiness- Daily readiness scores and contributing factors
Activity & Exercise
get_daily_activity- Steps, calories, and activity levelsget_workouts- Workout sessions with activity type, duration, and intensityget_sessions- Meditation, breathing exercises, and other sessions
Health Metrics
get_daily_spo2- Blood oxygen saturation levelsget_daily_stress- Stress levels and recovery statusget_daily_resilience- Resilience scores and trendsget_daily_cardiovascular_age- Cardiovascular age estimatesget_vo2_max- VO2 max measurements and trends
Device & Profile
get_ring_configuration- Ring hardware configurationget_rest_mode_period- Rest mode periodsget_personal_info- User profile information
All date-based tools accept optional start_date and end_date parameters in YYYY-MM-DD format. If not provided, defaults to the last 30 days.
Quick Start
Prerequisites
- Python 3.10 or higher
- An Oura Ring and account
- Oura Personal Access Token (get one at cloud.ouraring.com/personal-access-tokens)
Installation
- Clone this repository:
git clone https://github.com/yourusername/oura-mcp-python.git
cd oura-mcp-python
- Install dependencies:
pip install -r requirements.txt
- Create a
.envfile with your Oura credentials:
cp .env.example .env
# Edit .env and add your OURA_PERSONAL_ACCESS_TOKEN
- Run the server:
python server.py
Note: The server runs silently and waits for MCP protocol messages. To verify it's working, use the test script (see Testing section below).
Testing
Before configuring with Claude Desktop or deploying to AWS, test your setup:
python test_server.py
This will:
- Verify your Oura API token is valid
- Test connection to the Oura API
- Retrieve sample data (personal info, sleep, readiness)
- Confirm all tools are working
Expected output:
============================================================
Testing Oura MCP Server
============================================================
Test 1: Getting personal info...
✓ Personal info retrieved
Preview: {'id': 'xxx', 'age': 30, ...}...
Test 2: Getting daily readiness (last 7 days)...
✓ Daily readiness retrieved
Date range: 2024-01-10 to 2024-01-17
Preview: {'data': [{'day': '2024-01-17', 'score': 85, ...}]}...
Test 3: Getting daily sleep (last 7 days)...
✓ Daily sleep retrieved
Date range: 2024-01-10 to 2024-01-17
Preview: {'data': [{'day': '2024-01-17', 'score': 82, ...}]}...
============================================================
All tests passed! ✓
============================================================
If tests fail, verify:
- Your
OURA_PERSONAL_ACCESS_TOKENis correct in.env - Your Oura Ring has synced recent data
- You have internet connectivity
Configuration for Claude Desktop
Add this to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"oura-ring": {
"command": "python",
"args": ["/absolute/path/to/oura-mcp-python/server.py"],
"env": {
"OURA_PERSONAL_ACCESS_TOKEN": "YOUR_TOKEN_HERE"
}
}
}
}
After adding the configuration, restart Claude Desktop.
AWS Bedrock Deployment
This server is ready to deploy to AWS Bedrock AgentCore. Follow these steps:
Prerequisites
- AWS CLI installed and configured
- Docker installed
- AWS account with Bedrock access
- Your Oura Personal Access Token
Automated Deployment
Run the deployment script:
export OURA_PERSONAL_ACCESS_TOKEN="your_token_here"
./deploy-bedrock.sh
The script will:
- Create an ECR repository
- Build and push the Docker image
- Set up IAM roles for Bedrock
- Store your Oura token in AWS Secrets Manager
- Provide instructions for creating the Bedrock Agent
Manual Deployment Steps
If you prefer manual deployment:
- Build and push Docker image:
# Login to ECR
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin YOUR_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com
# Build image
docker build -t oura-mcp-server .
# Tag and push
docker tag oura-mcp-server:latest YOUR_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/oura-mcp-server:latest
docker push YOUR_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/oura-mcp-server:latest
- Store secrets in AWS Secrets Manager:
aws secretsmanager create-secret \
--name oura-mcp-server/token \
--secret-string '{"OURA_PERSONAL_ACCESS_TOKEN":"your_token_here"}' \
--region us-east-1
- Create Bedrock Agent:
- Go to AWS Bedrock Console
- Create a new Agent
- Configure MCP server with your container image
- Add environment variables from Secrets Manager
- Test the agent
Usage Examples
Once configured with Claude Desktop or Bedrock, you can ask questions like:
- "Show me my sleep data from last week"
- "What was my readiness score yesterday?"
- "How many steps did I take this month?"
- "What's my average heart rate variability?"
- "Am I getting enough deep sleep?"
- "Show me my workout history for this week"
Development
Project Structure
oura-mcp-python/
├── server.py # Main MCP server implementation
├── requirements.txt # Python dependencies
├── pyproject.toml # Project metadata and configuration
├── Dockerfile # Container image for AWS deployment
├── deploy-bedrock.sh # Automated AWS deployment script
├── bedrock-agent.json # Bedrock agent configuration
├── .env.example # Example environment variables
└── README.md # This file
Running Tests
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
Code Quality
# Format code
black server.py
# Lint code
ruff check server.py
API Reference
OuraClient
The OuraClient class handles authentication and API requests:
client = OuraClient()
data = await client.make_request("daily_sleep", {"start_date": "2024-01-01"})
Date Formatting
The format_date() helper validates and formats dates:
formatted = format_date("2024-01-15") # Returns "2024-01-15"
formatted = format_date(None) # Returns date 30 days ago
Troubleshooting
Authentication Errors
If you see authentication errors:
- Verify your Personal Access Token is correct
- Check that the token hasn't expired
- Ensure the token has the necessary scopes
Missing Data
If queries return empty results:
- Verify you're wearing your Oura Ring
- Check that data has synced to the Oura Cloud
- Try a different date range
Docker Build Issues
If Docker build fails:
- Ensure Docker is running
- Check that you have internet connectivity
- Verify Python base image is accessible
Security Notes
- Never commit your
.envfile or expose your Personal Access Token - Use AWS Secrets Manager for production deployments
- Rotate your tokens periodically
- Review AWS IAM permissions regularly
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
Resources
Support
For issues and questions:
- GitHub Issues: Report a bug or request a feature
- Oura API Support: cloud.ouraring.com/docs
Acknowledgments
- Inspired by the TypeScript implementation at elizabethtrykin/oura-mcp
- Built with FastMCP
- Powered by Oura Ring API v2
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。