running-coach-mcp
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., "@running-coach-mcpshow me my last 5 runs from the past 30 days"
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.
running-coach-mcp
A small, read-only Model Context Protocol (MCP) server that connects an AI client to a personal Intervals.icu account.
Milestone 1 exposes a single tool, get_recent_runs, which returns the athlete's most recent running activities as clean, normalized JSON.
Architecture
Garmin → Intervals.icu → Next.js backend (this app) → MCP → AI clientGarmin — the athlete's watch/activity source, synced into Intervals.icu.
Intervals.icu — source of truth for activity data. Accessed read-only via HTTP Basic Auth.
Next.js backend (
src/lib/intervals/*) — a small server-only client and domain layer that fetches raw activities and converts them into our own normalized model (src/types/activity.ts). MCP code never touches the raw Intervals.icu response shape directly.MCP (
src/app/api/mcp/route.ts) — exposes the domain layer as MCP tools over Streamable HTTP, viamcp-handler.AI client — any MCP-compatible client (Claude Desktop, Cursor, MCP Inspector, etc.) that calls
get_recent_runs.
src/
app/
api/
health/route.ts # GET /api/health — liveness + config check (no secrets, no Intervals calls)
mcp/route.ts # MCP endpoint (Streamable HTTP) — registers get_recent_runs
page.tsx # minimal info page (no UI framework needed)
lib/
intervals/
auth.ts # reads INTERVALS_API_KEY / INTERVALS_ATHLETE_ID, builds Basic Auth header
client.ts # server-only fetch wrapper (GET only, timeout, no-store, error mapping)
activities.ts # domain layer: getRecentRuns() — fetch, filter, sort, limit
normalizers.ts # IntervalsActivity -> RunningActivity conversion
running/
pace.ts # pure pace calculation/formatting helpers
types/
activity.ts # IntervalsActivity (raw) and RunningActivity (our model)This milestone is intentionally read-only: no database, no OAuth, no write endpoints. The IntervalsClient layer is structured so that future methods (getActivity, getActivityStreams, getWellness, getCalendar, and eventually write operations) can be added without reshaping what's already here — see the comments in src/lib/intervals/client.ts.
Related MCP server: Intervals.icu MCP Server
Setup
Install dependencies:
npm installCreate
.env.local(see.env.example):INTERVALS_API_KEY=<your personal Intervals API key> INTERVALS_ATHLETE_ID=0Get your API key from Intervals.icu under Settings → Developer Settings.
INTERVALS_ATHLETE_IDdefaults to0(your own athlete) if omitted.Run the dev server:
npm run dev
MCP endpoint:
http://localhost:3000/api/mcpHealth check:
http://localhost:3000/api/health
Testing the MCP endpoint with MCP Inspector
With the dev server running, in another terminal:
npx @modelcontextprotocol/inspectorThis opens the Inspector UI in your browser. Connect with:
Transport:
Streamable HTTPURL:
http://localhost:3000/api/mcp
Once connected, open the Tools tab, select get_recent_runs, and call it (optionally with limit and days) to see your recent runs as JSON.
The get_recent_runs tool
limit (optional integer, 1–20, default 5) — max number of runs to return.
days (optional integer, 7–365, default 90) — how far back to search.
It fetches up to 100 recent activities from Intervals.icu within the date window, filters to running types (Run, TrailRun, VirtualRun), sorts newest first, and returns up to limit normalized runs. If fewer runs exist in the window, it returns whatever is available.
Quality checks
npm run lint # ESLint
npx tsc --noEmit # TypeScript type checking
npm run test # unit tests (vitest)
npm run build # production buildMilestone status
Milestone 1 (this milestone) is strictly read-only: no database, no Supabase, no OAuth, no write operations (no POST/PUT/PATCH/DELETE calls to Intervals.icu).
Future milestones will build on this foundation to add:
Activity streams (
getActivityStreams)Wellness data (
getWellness)Calendar / planned workouts (
getCalendar)Deeper training analytics
Eventually, workout creation/editing (
createWorkout,updateWorkout,deleteWorkout) — write access, once OAuth and stronger safeguards are in place
Notes / assumptions
Never commit
.env.localor any file containing a real API key (.env*is git-ignored;.env.exampleis explicitly un-ignored so the template can be committed).
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect Claude to your Intervals.icu watch data for fitness, workout review, and plan writing.
AI running coach. Reads Strava, Suunto, Polar, Apple Health or Health Connect. Adapts to your feel.
Garmin data in Claude & ChatGPT via the Garmin Health API. OAuth sign-in, no password sharing.
Pace is a remote MCP server that exposes wearable and fitness data to Claude via the Model Context Protocol. It connects to Garmin, Oura, Whoop, Polar, Fitbit and 20+ devices and provides 15 tools for querying sleep, activity, recovery, and training data. Hosted on Google Cloud Run, OAuth 2.1 authentication, Streamable HTTP transport. Instructions: First you need to create an account at: https://pacetraining.co and connect your wearables. After that you can connect the remote Server via Custom Connector in Claude and OAuth 2.1 Flow startet.
Related MCP Servers
- AlicenseAqualityCmaintenanceConnects Claude with the Intervals.icu API to retrieve fitness data including activities, workouts, wellness metrics, and training events.10350GPL 3.0
- FlicenseAqualityDmaintenanceEnables AI assistants to interact with Intervals.icu fitness tracking and wellness data, allowing users to fetch, filter, and group activities or health metrics. It provides structured summaries of workouts and physical well-being through natural language queries.4-
- FlicenseAqualityDmaintenanceEnables AI assistants to access and analyze intervals.icu training data including activities, fitness metrics (CTL/ATL/TSB), wellness stats, and calendar events. Supports natural language querying of athletic performance for training insights and workout planning.6-
- AlicenseAqualityDmaintenanceEnables interaction with Intervals.icu data, including activities, wellness, and calendar events, via natural language.1018 npm1MIT