Skip to main content
Glama
rollecode

Oura MCP server

by rollecode

Oura MCP server

Version Python Node OAuth

从 Claude.ai 和 Claude Code 读取你的 Oura 戒指:睡眠数据(含评分背后的完整睡眠时段)、准备度、活动、锻炼、心率、压力、SpO2、恢复力、心血管年龄、VO2 max 就寝建议、标签和休息模式。它能对接有文档的 Oura API v2,并在前方加一层 OAuth 2.1 登录,这样你可以将其作为自定义连接器添加到 Claude.ai。Claude Code 则可以直接使用普通 token。

为什么不用 npm 包

这个项目最初是对 @daveremy/oura-mcp 的封装,后来它被替换掉了,因为那个包对你提出的多数请求都不返回任何结果。它以 start_date == end_date 的方式查询单日范围,而 Oura API 不会按照名称所暗示的方式处理这些查询:

  • sleep 按 UTC 时区的 bedtime_start 进行过滤,所以一个在本地时间(UTC+3)00:31 开始的夜晚会落在前一个 UTC 日期,从而被排除在天当日的窗口之外

  • daily_activityworkoutend_date 视作开区间,这使得同一天的范围变成零宽度

结果是“静默的”:在每次单日查询中,oura_sleep 返回一个带有空 periods 数组的评分,oura_activity 返回 null,而 oura_workouts 返回 []。没有任何报错,所以看起来像是“没有记录数据”而不是“查询方式有误”。

此服务器会在范围两端各扩展,再按每条记录自身的 day 字段过滤回来,这样在时区上是对的;并且它会不断传入 next_token 直到取完所有数据,而不是只返回一页就默默结束。

工具

工具

返回内容

daily_summary

一天内的睡眠评分、准备度评分、睡眠时段和活动数据,一次调用即可

oura_sleep

每日睡眠分数及其贡献因子,外加原始睡眠时段:时长、阶段、心率、HRV

oura_sleep_time

Oura 推荐的就寝时间窗口,以及实际就寝时间与其对比

oura_readiness

准备度分数及其贡献因子

oura_resilience

长期恢复力水平,以及睡眠和白天恢复的贡献因子

oura_cardiovascular_age

估算的血管年龄和脉搏波传导速度

oura_vo2_max

估算的 VO2 max

oura_activity

分数、步数、卡路里、距离以及各项活动时间分布

oura_workouts

锻炼记录,包含心率、卡路里、时长和强度

oura_heart_rate

某个时间窗口内的连续心率样本

oura_stress

每日压力与恢复时间

oura_spo2

每夜平均血氧

oura_sessions

冥想、呼吸和放松练习的 session

oura_tags

一天内记录的标签,包括传统标签和加强型标签

oura_rest_mode

覆盖某一日的休息模式时段

oura_ring

所有配对过的 Oura 戒指,以及电量读数

oura_personal_info

年龄、体重、身高、生理性别、电子邮箱

oura_trends

一段时间内睡眠、准备度、活动和压力评分的趋势

每个按日期查询的工具都接受可选的 date 参数(格式为 YYYY-MM-DD),默认为今天。Oura 会把一晚的数据记为醒来当天的数据。

oura_vo2_maxoura_sleep_timeoura_cardiovascular_age 本身是稀疏型数据:Oura 是定期计算而不是每天计算,因此返回空结果是正常的,并不是同步失败。

结构

Claude.ai / Claude Code
        |  HTTPS
   Cloudflare Tunnel, or any proxy that gives you HTTPS
        |
   nginx  127.0.0.1:8441
        |
   auth-server.js  :8442    handles the login and the tokens
        |
   oura-mcp  :8440          streamable HTTP, local only
        |
   api.ouraring.com

端口使用 8440-8442,因此不会和同主机上的其他 MCP 冲突。:8440 端口上的服务器本身没有登录保护,而且只允许绑定到 loopback,因此它只能经过登录层来访问节点访问。

设置

需要 Python 3.12 或更高版本,以及用于登录层的 Node。

python3 -m venv .venv
.venv/bin/pip install -e .
npm install --omit=dev

mkdir -p ~/.config/oura-mcp && chmod 700 ~/.config/oura-mcp
echo "OURA_TOKEN=your-personal-access-token" > ~/.config/oura-mcp/env
chmod 600 ~/.config/oura-mcp/env

CONFIG_DIR=~/.config/oura-mcp node set-password.js 'your-password-here'
openssl rand -hex 32 > ~/.config/oura-mcp/token
chmod 600 ~/.config/oura-mcp/token

cloud.ouraring.com 获取 Oura token。

然后在 systemd/*.servicenginx/oura-mcp.conf 中对应填写 YOUR_USER 和主机名,然后运行:

sudo cp systemd/*.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now oura-mcp oura-mcp-auth
sudo cp nginx/oura-mcp.conf /etc/nginx/sites-enabled/oura-mcp
sudo nginx -t && sudo systemctl reload nginx

将隧道或 HTTPS 代理指向 127.0.0.1:8441。OAuth 需要 HTTPS。

从外部检查:discovery 应返回元数据,而没有 token 的 /mcp 必须返回 401

curl https://your-host/.well-known/oauth-authorization-server
curl -o /dev/null -w '%{http_code}\n' -X POST https://your-host/mcp

连接

Claude.ai:Settings → Connectors → Add custom connector,填写 https://your-host/mcp,client ID 和 secret 留空。

Claude Code:

claude mcp add --transport http oura https://your-host/mcp \
  --header "Authorization: Bearer $(cat ~/.config/oura-mcp/token)" --scope user

改为通过 stdio 运行,不使用任何登录层:

OURA_TOKEN=your-token .venv/bin/oura-mcp

致谢

登录层来自 rollecode/obsidian-remote-mcp

-
license - not tested
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • WHOOP recovery, strain, sleep and workouts in Claude via official WHOOP OAuth. Free, open source.

  • Connect your Oura Ring account securely in minutes. Enable authorized access to your sleep, activi…

  • Garmin data in Claude & ChatGPT via the Garmin Health API. OAuth sign-in, no password sharing.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rollecode/oura-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server