Public
Remote MCP server wrapping the Oura Ring API v2 for Claude
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

Oura MCP Server

A remote MCP server that lets Claude (web + iPhone) read your Oura Ring data. It wraps the Oura API v2, handles the one-time Oura OAuth2 flow, and stores the refresh token in Val Town blob storage so it survives restarts.

Architecture

Rendering mermaid diagram...

Files

  • main.ts — HTTP entrypoint / router (/, /auth, /callback, /mcp/<secret>)
  • mcp.ts — MCP JSON-RPC handler and the tool catalogue
  • oura.ts — Oura token storage/refresh + authenticated GET helper

Setup

1. Create an Oura OAuth app

At https://cloud.ouraring.com/oauth/applications, create an application. Set the Redirect URI to your val's callback URL:

https://<your-val-url>/callback

Grab the Client ID and Client Secret.

2. Set environment variables

This val needs three env vars:

KeyValue
OURA_CLIENT_IDfrom your Oura OAuth app
OURA_CLIENT_SECRETfrom your Oura OAuth app
MCP_SECRETa long random string you invent — guards the endpoint

3. Connect Oura (once)

Visit https://<your-val-url>/auth?key=<MCP_SECRET> in a browser, approve access, and you'll see "✅ Connected to Oura."

4. Add to Claude

Add this as a custom connector / MCP server in Claude:

https://<your-val-url>/mcp/<MCP_SECRET>

Security model

  • The MCP URL itself is the credential — the MCP_SECRET path segment is unguessable. Wrong secrets and wrong methods return a plain 404, indistinguishable from any miss.
  • /auth is gated behind ?key=<MCP_SECRET> so randoms can't start the flow or overwrite your stored tokens.
  • The root / returns a bare ok unless ?key=<MCP_SECRET> is supplied, in which case it shows connection status and ready-to-copy URLs.

Tools exposed to Claude

get_daily_sleep, get_daily_readiness, get_daily_activity, get_daily_stress, get_daily_spo2, get_sleep, get_workouts, get_sessions, get_heartrate, get_personal_info.