An MCP server that pulls your Strava data and gives you a run recommendation from Claude, rendered as a dashboard.
- Fetches recent activities and all-time stats from the Strava API
- Shows them in a Prefab UI dashboard (rides, runs, distance, suffering index)
- Has a button that sends your last N days of runs to Claude and gets back a plain-English recommendation for today's run
- FastMCP — the MCP server itself, with
FastMCPAppfor the UI-facing tools - Prefab — the dashboard UI, written in Python instead of JSX
- Anthropic API — generates the run recommendation
httpx— talks to Stravauv— dependency management and running the thing
uv add fastmcp anthropic httpxYou need a Strava API app (create one at strava.com/settings/api) and a one-time OAuth flow to get a refresh token. Scope needs to include activity:read_all — the default read scope isn't enough.
Run the setup script (not part of the server itself) to get your first refresh_token, then it lives in strava_tokens.json.
Create a .env:
ANTHROPIC_API_KEY=sk-ant-...
STRAVA_CLIENT_ID=...
STRAVA_CLIENT_SECRET=...
STRAVA_TOKEN_PATH=./strava_tokens.json
uv run --env-file .env --with fastmcp fastmcp dev apps mcpserver.py --reloadmcpserver.py # the server: tools, UI, everything
strava_auth.py # token refresh logic
strava_tokens.json # your access/refresh token (gitignored)
.env # secrets (gitignored)
- Dashboard loads → fetches Strava data server-side, renders stats
- Click "Get Recommendation" → calls
get_run_recommendation, a private tool the UI can hit but the model can't call directly in chat - That tool re-fetches recent runs, trims to the fields that matter (distance, pace, HR, suffer score), sends them to Claude with a coaching system prompt
- Response comes back, gets dropped into the page via state
- Strava rate limits are tight (100 req/15min, 1000/day)
max_tokensneeds headroom if thinking is ever turned on — thinking and output share the budget
