oura-mcp
The oura-mcp server gives Claude access to your Oura Ring health data, returning summarized metrics instead of raw JSON (raw data available via raw=True). You can retrieve:
Daily summary (
get_daily_summary) – Combined sleep, readiness, and activity scores.Detailed sleep (
get_sleep) – Sleep stages, efficiency, HRV, resting HR, breathing, temperature.Sleep score (
get_sleep_score) – Sleep score and its contributors.Readiness (
get_readiness) – Readiness score, HRV balance, temperature deviation.Activity (
get_activity) – Activity score, steps, active/total calories.Heart rate (
get_heartrate) – Daily stats (mean, min, max); raw mode returns full time series.SpO₂ (
get_spo2) – Blood oxygen during sleep and breathing disturbance index.Stress (
get_stress) – Time under stress load/recovery and daily stress score.Heart health (
get_heart_health) – Cardiovascular age and VO₂max (default 30‑day window).Tags (
get_tags) – Manual notes entered in the Oura app.Server status (
get_status) – Check server mode and authorization.
Each tool supports date ranges: use days_back (defaults vary) or explicit start_date/end_date. The server can run locally via stdio (for Claude Code) or remotely via streamable-http (for claude.ai on browser/mobile and remote Claude Code). Timezone‑correct handling prevents data misplacement, and sandbox mode allows testing with synthetic data.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@oura-mcp how was my sleep last night?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
my-oura-mcp
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:
{
"metric": "sleep_detail",
"period": { "start": "2026-07-23", "end": "2026-07-29", "days": 7 },
"stats": {
"total_h": { "mean": 7.1, "min": 5.9, "max": 8.4 },
"deep_h": { "mean": 1.3, "min": 0.9, "max": 1.8 },
"avg_hrv": { "mean": 42, "min": 31, "max": 55, "trend_per_week": 1.8 },
"efficiency": { "mean": 88, "min": 82, "max": 93 }
}
}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.
Related MCP server: whoop-ai-mcp
Quick start
Requires uv. No Oura token needed for this part.
git clone https://github.com/AntVsl/oura_mcp && cd oura_mcp
cp .env.example .env
uv syncCheck that data flows (hits Oura's sandbox, no auth required):
uv run python -m my_oura_mcp.smokeConnect it locally — the server prints the commands with the absolute path already filled in, and writes nothing itself:
uv run my-oura-mcp installThen ask your client for an Oura summary. The get_status tool reports which
mode the server is in.
Tools
Tool | Returns | Default range |
| Sleep, readiness and activity scores at once | 7 days |
| Sleep stages, efficiency, HRV, resting HR, breathing, temperature | 7 days |
| Daily sleep score only — lighter than | 7 days |
| Readiness score, HRV balance, temperature deviation | 7 days |
| Activity score, steps, calories | 7 days |
| Per-minute heart rate collapsed to daily stats | 3 days |
| Blood oxygen during sleep, breathing disturbance index | 7 days |
| Time under load and in recovery | 7 days |
| Cardiovascular age, VO₂max | 30 days |
| Tags you entered in the Oura app | 30 days |
| Server mode and authorization state | — |
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.
What to do | |
1 | Register an application at developer.ouraring.com |
2 | Put |
3 |
|
4 | Set |
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.
Variable | Purpose |
| Oura application credentials |
| Must match the application exactly |
|
|
| Timezone deciding what "today" means. Set explicitly on servers |
| Shared secret guarding the HTTP endpoint; also the consent-page password |
| Public |
| Comma-separated OAuth client origins; defaults to Claude.ai and ChatGPT |
| Where the OAuth flow writes tokens. Not set by hand |
| SQLite cache file. An empty value disables caching |
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
Client | Command |
Claude Code |
|
Codex |
|
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.
Client | How it connects |
Claude.ai, ChatGPT | OAuth. No client ID or secret to enter — the client registers itself and the consent page asks for |
Claude Code |
|
Codex |
|
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
stdio, local | HTTP, on a server | |
Claude Code and Codex on this machine | yes | yes |
Other devices | no | yes |
Claude.ai, ChatGPT, phone | no | yes, over OAuth |
Needs a domain and a host | no | yes |
Data leaves this machine | no | yes, to your server |
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.
uv run my-oura-mcp cache --status # what is cached
uv run my-oura-mcp cache --clear # forget itThree 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:
cp -r skills/oura ~/.claude/skills/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:
mkdir -p ~/.codex/skills
cp -R skills/oura skills/oura-mcp-maintenance ~/.codex/skills/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
uv run pytestTests 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
Available Tools
11 toolsget_activityC
Активность: оценка, шаги, активные и общие калории.
Inputs: raw, end_date, days_back, start_date. Returns: object
get_daily_summaryA
Общая картина по дням: оценки сна, готовности и активности сразу.
Самый частый запрос — начинай с него, а за деталями иди в get_sleep и остальные инструменты.
Inputs: raw, end_date, days_back, start_date. Returns: object
get_heart_healthB
Сосудистый возраст и VO2max. Обновляются редко — бери период пошире.
Inputs: raw, end_date, days_back, start_date. Returns: object
get_heartrateA
Поминутный пульс, свёрнутый посуточно (среднее, минимум, максимум).
raw=True отдаёт весь ряд — это тысячи точек в сутки, бери узкий диапазон.
Inputs: raw, end_date, days_back, start_date. Returns: object
get_readinessC
Готовность (readiness): оценка, баланс HRV, отклонение температуры.
Inputs: raw, end_date, days_back, start_date. Returns: object
get_sleepC
Детальный сон: стадии, эффективность, HRV, пульс покоя, дыхание, отклонение температуры тела. Здесь же лежат ночные HRV и lowest_hr.
Inputs: raw, end_date, days_back, start_date. Returns: object
get_sleep_scoreC
Только дневная оценка сна и её вклады. Легче, чем get_sleep.
Inputs: raw, end_date, days_back, start_date. Returns: object
get_spo2C
Насыщение крови кислородом во сне и индекс нарушений дыхания.
Inputs: raw, end_date, days_back, start_date. Returns: object
get_statusB
Режим работы сервера и состояние авторизации. Полезно при отладке.
Inputs: no named parameters. Returns: object
get_stressC
Дневной стресс: время под нагрузкой и в восстановлении, оценка дня.
Inputs: raw, end_date, days_back, start_date. Returns: object
get_tagsC
Отметки, проставленные вручную в приложении Oura.
Inputs: raw, end_date, days_back, start_date. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool targets a distinct area (status, daily summary, sleep, readiness, activity, heart rate, SpO2, stress, heart health, tags). Even overlapping tools like get_sleep and get_sleep_score are clearly differentiated by detail level.
All tools follow a consistent get_verb_noun pattern in snake_case, making them predictable and easy to navigate.
11 tools cover the core Oura API endpoints without excess, providing a well-scoped set for health data retrieval.
The set covers key health metrics (sleep, readiness, activity, heart rate, stress, etc.). Minor gaps like workout details or raw data streams are acceptable for typical use.
Related MCP Connectors
Multi-tenant hosted MCP server for Oura Ring — 21 read-only tools, OAuth per user.
MCP server for Withings health data — sleep, activity, heart, and body metrics.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Hosted Apple Health MCP: workouts, sleep and HRV in ChatGPT, Claude, Gemini, Grok. Free, no export.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceMCP server that connects Whoop fitness data to Claude, enabling natural language queries about recovery, sleep, workouts, and more.-
- AlicenseNot gradedqualityBmaintenanceMCP server that connects AI assistants like Claude to WHOOP health data, enabling natural language queries about recovery, sleep, workouts, and more.331 npm181MIT
- FlicenseNot gradedqualityDmaintenanceA private, read-only MCP server that lets Claude retrieve your Oura Ring health data for a daily check-in, self-hosted on Cloudflare with OAuth authentication.-
- AlicenseAqualityCmaintenanceMCP server for the Oura Ring API v2, enabling natural language queries about sleep, readiness, activity, heart rate, and more.2190 npm1MIT