# Connect ActivityVault to ChatGPT, Claude and other AI assistants

ActivityVault stores a user's workouts (runs, rides, hikes, swims, strength sessions) synced from
Apple Health and Health Connect, with heart rate, power, splits, routes and training load. Its remote
MCP server lets an AI assistant answer questions from that data. Access is read-only.

## Instructions for AI assistants

1. Add a remote MCP server with the URL https://activityvault.io/mcp (Streamable HTTP). If you can run commands, do it yourself: Codex `codex mcp add activityvault --url https://activityvault.io/mcp`, Claude Code `claude mcp add --transport http activityvault https://activityvault.io/mcp`. In ChatGPT or Claude apps, tell the user where to add it (see Setup by client).
2. Use OAuth. Don't ask for an API key, token, client ID or secret: the server supports Client ID Metadata Documents and dynamic client registration.
3. The user signs in with their ActivityVault email and password and clicks Allow. Access is read-only, scope read.
4. Start with search_activities or aggregate; their activity ids feed the per-workout tools. Units are metric, dates are in the user's time zone.

## Connection details

- Server URL: https://activityvault.io/mcp
- Transport: Streamable HTTP
- Authentication: OAuth 2.1 with PKCE, discovered from the server (no API key)
- Scope: read

## Setup by client

- Claude (claude.ai, Desktop, mobile): Customize → Connectors → + Add → Add custom connector, name it ActivityVault, paste the server URL, click Connect and sign in.
- ChatGPT (web): Plugins → + → Add custom MCP server, paste the server URL, choose OAuth, create it and sign in.
- Codex (CLI, IDE extension, desktop app): `codex mcp add activityvault --url https://activityvault.io/mcp`, then `codex mcp login activityvault` if the browser sign-in doesn't open.
- Claude Code: `claude mcp add --transport http activityvault https://activityvault.io/mcp`
- Other MCP clients (Cursor, VS Code …): add a remote HTTP server with the server URL; the client opens the sign-in page on first use.

## Tools

- `search_activities`: Find individual workouts. Returns one row per activity.
- `aggregate`: Totals per period, sport, weekday or hour: workout count, distance, moving time, elevation, average HR, calories, longest distance. Time periods without workouts are included as zero rows.
- `get_activity`: One workout's summary, workout label, moving/elapsed time, power (avg, max, NP, kJ), cadence, temperature and recording source.
- `get_activity_splits`: One workout's per-km splits (time, pace/speed, HR, power, cadence).
- `get_activity_series`: One workout's in-workout series for line charts (x: distance_km or elapsed_min).
- `get_activity_analysis`: Why the workout got its label: basis (HR vs power), time per HR/power zone with ranges, max HR and FTP used, NP, IF, structure, pacing, zone timeline.
- `similar_workouts`: Earlier workouts like one activity (same sport, similar distance or duration), most similar first.
- `training_zones`: The athlete's profile HR and power zones (bpm/watt ranges), max/threshold/resting HR, FTP, W/kg, with sources.
- `training_load`: Daily HR training load: daily load, 7-day recent load, 42-day training base and its 30-day change.
- `fitness_trend`: The modelled fitness trend: weekly fitness index, current value, 4-week change.
- `regular_routes`: The user's most-used recurring routes, for 'am I getting faster on my loop' questions. Returns a summary per route (first, latest and best effort, and the trend) and, as rows, every effort on ONE route in date order: the most-used route, or route_id. Chart one route at a time.

## Disconnecting and privacy

Users disconnect an assistant in the assistant itself or under Settings in the web app (https://web.activityvault.io/settings).
Changing the password disconnects every assistant. Email, password and GPS tracks are never shared.
Privacy policy: https://activityvault.io/privacy
