Oura Ring

io.github.YasuakiOmokawa由 GitHub 账号 YasuakiOmokawa 发布v0.2.13更新于 Oct 24, 2026

MCP server for Oura Ring API v2 (sleep, activity, readiness, heart rate, workouts).

已验证STDIO仅桌面位置与生活数据与分析

概览

AI 生成的概览

本地 MCP 服务器,通过 OAuth 连接 Oura Ring API v2,让助手读取睡眠、活动、准备度、心率和锻炼数据。

可以做什么
  • 通过浏览器 OAuth 流程完成 Oura 授权,检查令牌有效性与过期时间,并清除已保存的令牌
  • 列出 Oura API v2 所有受支持的 GET 端点及其摘要
  • 向 /v2 路径发起通用 GET 请求,可通过 max_pages 或 next_token 参数自动分页
  • 返回包含状态、数据、下一页令牌、已抓取页数和是否还有更多数据的结构化结果
适用场景
适合希望助手在桌面 MCP 客户端中读取本人 Oura Ring 健康数据(睡眠、活动、准备度、心率或锻炼),用于周度回顾、趋势查看或恢复情况总结的场景。
运行要求
通过 npx 在本地运行(需要 Node.js)。需要一个 Oura 开发者应用,重定向 URI 与回调端口(默认 54321)一致,并启用所需的只读权限范围。凭据为 Oura Client ID 和 Client Secret,可通过 configure 向导写入配置文件,或通过 OURA_CLIENT_ID 与 OURA_CLIENT_SECRET 环境变量提供;OURA_CALLBACK_PORT 为可选项。OAuth 步骤需要浏览器。
安装前请注意
服务器会把 OAuth 客户端密钥和访问/刷新令牌保存在用户配置目录中,向导还会改写检测到的 MCP 客户端配置文件(会先备份)。README 不建议使用环境变量,因为更易泄露;切勿把密钥放在命令行参数中。访问虽为只读,但涉及敏感的个人健康数据,令牌会发送至 Oura 的 API。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Oura Ring,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

oura-mcp

[CI] [npm] [License: MIT]

A Model Context Protocol server for the Oura Ring API v2. Exposes sleep, activity, readiness, heart rate, and workout data to MCP-compatible clients (Claude Desktop, Claude Code, Cursor, ...) via OAuth.

Quick start

bash
npx @yasuakiomokawa/oura-mcp configure

The wizard collects your Oura Client ID/Secret, walks through browser OAuth, saves tokens to ~/.config/oura-mcp/, and adds an mcpServers.oura entry to any detected MCP client config. Restart the client and the tools below are available.

Re-running configure pre-fills the saved Client ID / port so you only need to press Enter to keep them. Type --force to wipe saved state and start from scratch:

bash
npx @yasuakiomokawa/oura-mcp configure --force

Prerequisites

  1. Register an Oura developer app at https://cloud.ouraring.com/oauth/applications
  2. Redirect URI must be exactly: http://localhost:54321/callback (or http://localhost:<port>/callback if you customize OURA_CALLBACK_PORT)
  3. Enable the read scopes you need (Email, Personal info, Daily activity, Heart rate, Workout, Tag, Session, SpO2, Ring configuration, Stress, Heart health)
  4. Note the Client ID and Client Secret — you'll enter them in npx @yasuakiomokawa/oura-mcp configure

Installation

Three paths depending on your client:

1. MCP Registry (auto-discovery clients)

Once published to the official MCP Registry, supported clients can install io.github.YasuakiOmokawa/oura-mcp from their UI. The wizard step still has to run once to obtain OAuth tokens.

2. Manual config (Claude Desktop / Claude Code / Cursor)

Run npx @yasuakiomokawa/oura-mcp configure — Step 4 of the wizard auto-detects:

  • Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
  • Claude Code (user): ~/.claude.json
  • Claude Code (project): ./.mcp.json
  • Cursor (user): ~/.cursor/mcp.json
  • Cursor (project): ./.cursor/mcp.json

Each detected file is backed up to <file>.bak.<ISO-timestamp> before an atomic write.

To configure manually, add to your client config:

json
{  "mcpServers": {    "oura": {      "command": "npx",      "args": ["-y", "@yasuakiomokawa/oura-mcp"]    }  }}

3. Skill (optional)

The companion oura-api-skill ships per-endpoint reference and three workflow recipes (weekly review / sleep trend / recovery check). Bundle it as a Claude Code plugin or import into your skills directory.

Tools provided

ToolPurpose
oura_authenticateStart OAuth flow in browser; returns the URL. Used after refresh_token expires.
oura_auth_statusCheck current token validity and expiry.
oura_clear_authWipe stored tokens.
oura_api_list_pathsList every supported GET endpoint with summaries.
oura_api_getGeneric GET to /v2/.... Auto-paginates via max_pages (1-20) or accepts next_token in params.

oura_api_get returns structuredContent with { status, data, next_token, pages_fetched, has_more }.

Configuration

Two ways. The config file (Option A) is the recommended path — it stores secrets at-rest with 0600 and is self-healing. Environment variables (Option B) are kept for CI / Docker / ephemeral environments where writing a file is impractical, but they leak more easily and are not recommended for daily use.

Option A — config file (recommended)

Run the wizard once and forget about it:

bash
npx @yasuakiomokawa/oura-mcp configure

This writes:

~/.config/oura-mcp/config.json   # 0600, contains clientId / clientSecret / callbackPort~/.config/oura-mcp/tokens.json   # 0600, contains the OAuth access / refresh tokens

Permissions are re-checked on every load and chmod'd back to 0600 if anything else touched them.

config.json schema:

json
{  "schemaVersion": 1,  "clientId": "...",  "clientSecret": "...",  "callbackPort": 54321}

Option B — environment variables (CI / Docker only)

bash
OURA_CLIENT_ID=...OURA_CLIENT_SECRET=...        # must be set together with OURA_CLIENT_IDOURA_CALLBACK_PORT=54321      # optional; safe to set in env regardless of Option A/B

When the server boots and both OURA_CLIENT_ID and OURA_CLIENT_SECRET are set, it uses them and emits a config.env_credentials warning to stderr.

Why not recommended:

  • process.env is readable from /proc/<pid>/environ by any process running as the same user.
  • Environment is inherited by every child process the server spawns.
  • Crash dumps and observability tools that capture process.env will leak the secret.
  • OURA_CLIENT_SECRET=... npx ... typed at the shell ends up in shell history.

OURA_CALLBACK_PORT is not a secret and is fine to pass via env in either mode.

Never use args for secrets

Process arguments are visible to other users via ps / /proc/<pid>/cmdline. Use the env block of your MCP client config:

json
{  "mcpServers": {    "oura": {      "command": "npx",      "args": ["-y", "@yasuakiomokawa/oura-mcp"],      "env": { "OURA_CLIENT_ID": "...", "OURA_CLIENT_SECRET": "..." }    }  }}

Troubleshooting

  • "refresh_token expired" — run oura_authenticate (in chat) or npx @yasuakiomokawa/oura-mcp configure (in terminal).
  • Port 54321 already in use — set OURA_CALLBACK_PORT=<other port> and update the redirect URI in your Oura developer app to match.
  • "Path not found" — verify the path with oura_api_list_paths. Common slips: missing /v2/ prefix, typo in daily_sleep.
  • Setup hangs at "Waiting for authorization" — you haven't approved in the browser yet, or the authorize page was opened in a different browser session than the one with localhost reachability.
  • No log output — set OURA_LOG_LEVEL=debug for verbose stderr logging.

Development

bash
git clone https://github.com/YasuakiOmokawa/oura-mcp.gitcd oura-mcpnpm installnpm testnpm run build

Useful scripts:

  • npm run lint / npm run typecheck — Biome + TypeScript checks
  • npm run test:coverage — Vitest with V8 coverage
  • npm run update:docs — re-fetch the Oura OpenAPI schema and regenerate skills/oura-api-skill/references/

License

MIT

来源:README.md,提交 92b0c66

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.13最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分