npm @yasuakiomokawa/oura-mcpstdioMITupdated 27d ago
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.
What can you do with Oura Ring?
oura-mcp
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
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:
npx @yasuakiomokawa/oura-mcp configure --force
Prerequisites
- Register an Oura developer app at https://cloud.ouraring.com/oauth/applications
- Redirect URI must be exactly:
http://localhost:54321/callback(orhttp://localhost:<port>/callbackif you customizeOURA_CALLBACK_PORT) - Enable the read scopes you need (Email, Personal info, Daily activity, Heart rate, Workout, Tag, Session, SpO2, Ring configuration, Stress, Heart health)
- 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:
{
"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
| Tool | Purpose |
|---|---|
oura_authenticate |
Start OAuth flow in browser; returns the URL. Used after refresh_token expires. |
oura_auth_status |
Check current token validity and expiry. |
oura_clear_auth |
Wipe stored tokens. |
oura_api_list_paths |
List every supported GET endpoint with summaries. |
oura_api_get |
Generic 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:
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:
{
"schemaVersion": 1,
"clientId": "...",
"clientSecret": "...",
"callbackPort": 54321
}
Option B — environment variables (CI / Docker only)
OURA_CLIENT_ID=...
OURA_CLIENT_SECRET=... # must be set together with OURA_CLIENT_ID
OURA_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.envis readable from/proc/<pid>/environby 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.envwill 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:
{
"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) ornpx @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 indaily_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=debugfor verbose stderr logging.
Development
git clone https://github.com/YasuakiOmokawa/oura-mcp.git
cd oura-mcp
npm install
npm test
npm run build
Useful scripts:
npm run lint/npm run typecheck— Biome + TypeScript checksnpm run test:coverage— Vitest with V8 coveragenpm run update:docs— re-fetch the Oura OpenAPI schema and regenerateskills/oura-api-skill/references/
License
Install
Add Oura Ring to your client. Pick the one you use.
claude mcp add oura-mcp -- npx -y @yasuakiomokawa/oura-mcpcodex mcp add oura-mcp -- npx -y @yasuakiomokawa/oura-mcpamp mcp add oura-mcp -- npx -y @yasuakiomokawa/oura-mcp{
"mcpServers": {
"oura-mcp": {
"command": "npx",
"args": [
"-y",
"@yasuakiomokawa/oura-mcp"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"oura-mcp": {
"command": "npx",
"args": [
"-y",
"@yasuakiomokawa/oura-mcp"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"oura-mcp","command":"npx","args":["-y","@yasuakiomokawa/oura-mcp"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"oura-mcp": {
"command": "npx",
"args": [
"-y",
"@yasuakiomokawa/oura-mcp"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"oura-mcp": {
"command": "npx",
"args": [
"-y",
"@yasuakiomokawa/oura-mcp"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"oura-mcp": {
"command": "npx",
"args": [
"-y",
"@yasuakiomokawa/oura-mcp"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"oura-mcp": {
"type": "local",
"command": "npx",
"args": [
"-y",
"@yasuakiomokawa/oura-mcp"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"oura-mcp": {
"command": {
"path": "npx",
"args": [
"-y",
"@yasuakiomokawa/oura-mcp"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y @yasuakiomokawa/oura-mcpRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
5 tools
Oura Ring exposes 5 tools to a connected agent.
- oura_authenticate
- Start OAuth flow in browser; returns the URL. Used after `refresh_token` expires.
- oura_auth_status
- Check current token validity and expiry.
- oura_clear_auth
- Wipe stored tokens.
- oura_api_list_paths
- List every supported `GET` endpoint with summaries.
- oura_api_get
- Generic `GET` to `/v2/...`. Auto-paginates via `max_pages` (1-20) or accepts `next_token` in `params`.
Score
81 / 100
Excellent
- Documentation25/25
- Maintenance25/25
- Trust13/20
- Capability6/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 19 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 5 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
Version history
| Versions | Published |
|---|---|
| 0.2.13Latest | May 16, 2026 |
| 0.2.12 | May 2, 2026 |
| 0.2.11 | May 2, 2026 |
| 0.2.10 | May 2, 2026 |
| 0.2.9 | May 2, 2026 |
| 0.2.8 | May 2, 2026 |
| 0.2.7 | May 2, 2026 |
| 0.2.6 | May 2, 2026 |
| 0.2.5 | May 2, 2026 |
| 0.2.4 | May 2, 2026 |
| 0.2.3 | May 2, 2026 |
| 0.2.2 | May 2, 2026 |
| 0.2.1 | Apr 29, 2026 |
| 0.2.0 | Apr 29, 2026 |
| 0.1.4 | Apr 29, 2026 |
| 0.1.3 | Apr 29, 2026 |
| 0.1.2 | Apr 29, 2026 |
| 0.1.1 | Apr 29, 2026 |
| 0.1.0 | Apr 29, 2026 |