
Oura Ring
io.github.AntVsl由 GitHub 帳號 AntVsl 發布v0.4.2更新於 Oct 24, 2026
Sleep, readiness, HRV, resting heart rate, activity and stress from your Oura Ring
概覽
讓助理讀取你的 Oura Ring 資料——睡眠、準備度、HRV、心率、活動、血氧與壓力,並以逐日彙總與趨勢的形式回傳。
- 可以做什麼
- 取得睡眠分期、效率、HRV、靜止心率與體溫,或只取每日睡眠分數
- 取得準備度、活動分數、步數與卡路里,以及睡眠期間的血氧與呼吸干擾指數
- 取得每分鐘心率彙整成的每日統計、心血管年齡與最大攝氧量,以及你在 Oura 應用程式標記的標籤
- 取得睡眠、準備度與活動分數的合併每日摘要,或查看伺服器模式與授權狀態
- 以 MCP 資源讀取今天、昨天與本週摘要,並可依需求取得 Oura 原始回應
- 適用情境
- 適合用自然語言詢問助理自己睡得如何、恢復得怎樣,或查看一週、一個月的戒指資料趨勢,而不必自行匯出檔案。適用於 Claude Code、Codex、claude.ai 或 ChatGPT 中的個人健康回顧。
- 執行需求
- 以 Python 套件形式透過 uv 在本機執行(也可用 Docker 映像以 streamable HTTP 執行)。Oura 沙盒模式不需要任何憑證;使用自己的資料需在 Oura 開發者平台註冊應用程式,設定 OURA_CLIENT_ID 與 OURA_CLIENT_SECRET,完成一次瀏覽器授權,並將 OURA_API_MODE 設為 production。遠端 HTTP 使用需要 OURA_MCP_TOKEN,網頁用戶端走 OAuth 還需 OURA_PUBLIC_URL。在伺服器上建議明確設定 OURA_TZ。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Oura Ring,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
my-oura-mcp
[CI] [License: MIT] [Python 3.12+]
Gives Claude, ChatGPT, and Codex access to your Oura Ring data: sleep, readiness, HRV, resting heart rate, activity, SpO₂, stress.
Ask "how did I sleep last week" and your MCP client calls the right tool and gets a summary back — not a wall of JSON:
New to MCP? Model Context Protocol lets AI clients reach external data. Install this server, connect it once, then ask about your sleep in plain language. No coding involved.
Works locally in Claude Code and Codex, and remotely in claude.ai and ChatGPT once it is deployed to a server of your own.
Читать по-русски: README.ru.md
Why another one
- Compact by default. Tools return per-day values plus statistics with a
trend, not the raw API payload. Raw responses stay one
raw=Trueaway. A month of heart-rate data shrinks by more than 10×. - One codebase, two transports.
stdiofor local use,streamable-httpfor remote. A flag apart, not a rewrite. - Timezone-correct. Oura filters some endpoints by an internal UTC
timestamp while returning a local
dayfield, and returns heart-rate timestamps in UTC. Both quietly lose or misplace data outside UTC. This server handles it — see Timezone handling. - Survives flaky networks. Follows
next_tokenpagination, retries dropped connections with exponential backoff, and turns HTTP status codes into messages that say what to fix. - Try before authorizing. Oura's sandbox works with no credentials at all.
Quick start
Requires uv. No Oura token needed for this part.
Check that data flows (hits Oura's sandbox, no auth required):
Connect it locally — the server prints the commands with the absolute path already filled in, and writes nothing itself:
Then ask your client for an Oura summary. The get_status tool reports which
mode the server is in.
Tools
Every data tool takes either days_back or an explicit start_date/end_date
pair (YYYY-MM-DD), plus raw to get Oura's untouched response.
Using your own data
The sandbox returns synthetic data. For your own you need an Oura application and a one-time authorization — no review to pass, a fresh application works immediately.
When registering: Redirect URI is http://localhost:8765/callback, matched
byte for byte. Scopes are daily, heartrate, tag, spo2, stress,
heart_health. Everything else is arbitrary.
Tokens refresh themselves from there. Check with my-oura-mcp auth --status,
forget them with auth --logout.
Personal Access Tokens no longer work: Oura stopped issuing them in December 2025.
Refresh tokens are single-use. Each refresh kills the old one, so two instances sharing a token store knock each other out. The symptom is a
400mentioning single use; the cure is re-runningauthand keeping one instance.
Configuration
Everything lives in .env (see .env.example). Secrets never reach git.
Running it
One codebase, two transports: stdio next to a client on this machine, HTTP on
a server so the web clients and your phone can reach it.
Locally
uv run my-oura-mcp install prints these with the absolute path already filled
in. --scope user makes the server visible from any directory; without it, only
from where the command ran. Verify with claude mcp list / codex mcp list.
Nothing is exposed and no network is involved. To debug the transport itself:
uv run my-oura-mcp --transport http --port 8000 — no secret needed on loopback.
On a server
This is what makes the server reachable from any device, from Claude.ai and from ChatGPT. Step by step in docs/DEPLOY.md (Russian): how to let traffic in, how to move Oura authorization across, how to connect web clients.
OURA_PUBLIC_URL turns OAuth on: the server becomes its own authorization
server with dynamic client registration, restricted to https://claude.ai and
https://chatgpt.com. Another client needs its exact origin in
OURA_OAUTH_ALLOWED_REDIRECT_ORIGINS; the consent page names the client and its
return origin before asking for the secret.
Two ways to expose it, and the choice is not cosmetic. Caddy is simpler, but its certificate lands in Certificate Transparency — a public log revealing that this address hosts a service. A Cloudflare Tunnel opens no inbound ports at all. If a VPN lives on the same host, only the tunnel will do.
Which one
Keep exactly one live instance: Oura's refresh token is single-use, and two servers sharing a token store will knock each other out of authorization.
Timezone handling
Three separate bugs came from Oura's date semantics, all of which lost data silently rather than raising an error. Worth knowing if you build against this API yourself:
sleepanddaily_activityare filtered by an internal UTC timestamp, not by thedayfield Oura itself returns. At UTC+3 a night that starts after midnight lands in the previous UTC day: asking for28..28returns nothing while the record withday=28plainly exists. The server widens the window and trims bydayafterwards. Verified by sweeping every endpoint; the other six behave.heartratereturns timestamps in UTC. Grouping by the first ten characters of that string splits a local day in two, pushing 00:00–03:00 local into the previous day — exactly the resting heart rate you care about. Grouping usesOURA_TZ.- Oura returns several sleep records per day — the night plus naps. Picking
an arbitrary one lets a 12-minute nap displace a full night. The record typed
long_sleepwins, or the longest one; naps are reported separately asnaps_hso their HRV never averages with the night's.
Security
.env, the token store and the cache are in.gitignore. Verify before committing:git status --porcelain.- The token store and SQLite cache are written with owner-only (
600) file permissions. - The HTTP endpoint is guarded by
OURA_MCP_TOKENusing a constant-time comparison. The access model is deliberately simple: one secret, one owner, no per-user separation. - The server refuses to start on a non-loopback address without a secret
rather than quietly serving health data to the open internet. Try it:
uv run my-oura-mcp --transport http --host 0.0.0.0. /healthzis intentionally open — a reverse proxy needs it, and it returns nothing butok.- Caddy strips the
Authorizationheader from its logs.
Caching
Older days go into SQLite. The two most recent completed days are rechecked on every request because late syncs can update them; older history is served from the cache without a network call.
Three things worth knowing. Today is never cached — Oura is still writing it. Empty days are not cached either: an empty day means either "did not wear the ring" or "has not synced yet", and the second resolves itself within hours, whereas a cached blank would last forever. The mode is part of the key, so sandbox data cannot surface in production.
Per-minute heart rate bypasses the cache: its rows carry no day field.
MCP resources
Clients that support resources can read oura://today, oura://yesterday,
and oura://week. They provide the same sleep/readiness/activity summaries
as the tools, without choosing arguments manually.
Skill with recipes
skills/oura ships a Claude-oriented skill — not more tools, but workflows on top of them: whether sleep is actually improving, whether today can take load, what the body was doing on a bad day, whether a change in routine did anything. Each is a sequence of calls plus a way to reason about the answer, which no single tool can express.
Install it by copying into your client's skills directory:
The recipes are checked against the code by tests: a field name that no tool
returns fails uv run pytest instead of quietly sending the model nowhere.
Codex can also load these repository skills after copying them to its skills directory:
oura interprets data through the MCP server. oura-mcp-maintenance guides
safe changes to this repository and its Claude/ChatGPT/Codex integration.
When something doesn't work
Claude says there are no Oura tools. The server didn't connect. claude mcp list shows its state. A common cause is a relative path where a full one is
required — uv run my-oura-mcp install prints the command with the right one.
"Авторизация не пройдена — токенов нет". The server is in production mode
but has never signed in to Oura. Run uv run my-oura-mcp auth; check token state
with uv run my-oura-mcp auth --status.
401 against a server on a VPS. OURA_MCP_TOKEN doesn't match. Header
values are sent verbatim, so the word Bearer and the space belong to the value:
Bearer abc123, not abc123.
Data comes back for the wrong day. OURA_TZ isn't set. A server clock is
almost always UTC, so "today" starts hours off from yours and a night's sleep
lands in the previous day. Set it explicitly, e.g. OURA_TZ=Europe/Moscow.
"refresh-токен отвергнут". Oura's refresh token is single-use, and this
happens when a second instance spent it. Keep exactly one alive: once the VPS is
up, point local Claude Code at it too. Recover with my-oura-mcp auth.
Requests to api.ouraring.com fail with SSL_ERROR_SYSCALL or a timeout.
Usually not the server: the client retries four times with backoff. If that
doesn't help, a VPN generally does.
claude.ai won't connect to your server. Check that OURA_PUBLIC_URL is set
and matches the connector URL character for character, including https:// and
no trailing slash. The startup banner says whether OAuth came up. Beyond that,
see docs/DEPLOY.md.
You press Allow on the consent page and nothing happens. Check the server
logs: a POST /oauth/consent returning 303 with no POST /token after it
means the browser blocked the hop back to claude.ai. That is what an over-strict
Content-Security-Policy looks like — and curl cannot reproduce it, since it
does not enforce CSP at all.
"Запрос устарел" / request expired. Authorization requests live in process memory, so restarting the server invalidates any consent page already open. The secret is not the problem — go back to claude.ai and start the connection again.
Development
Tests never touch the network; Oura's responses are stubbed with respx.
Tool tests go through mcp.call_tool() rather than calling the functions
directly — some bugs only appear on the real protocol layer, where MCP clients
pass declared defaults as explicit arguments.
For Codex and other coding agents, repository instructions and a task/review structure live in AGENTS.md and docs/agents.
x86_64 macOS: cryptography 49+ ships no wheel for this platform and tries
to build from Rust sources. pyproject.toml pins 48.0.0 for it specifically;
Linux and native arm64 are untouched. This bites Apple Silicon too whenever
Homebrew lives in /usr/local rather than /opt/homebrew — check with
file $(which python3).
Flaky network: if requests to api.ouraring.com fail with
SSL_ERROR_SYSCALL or time out, it usually isn't the server. The client makes
four attempts with backoff; beyond that, try a VPN.
See docs/ROADMAP.md for what's planned and what was deliberately deferred.
License
MIT
來源:README.md,提交 6029244
工具
0版本歷史
1- v0.4.2最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分