Spaces:
Running
Running
Commit History
19 days ago
-
Accept client_secret_basic at the OAuth token endpoint (#1) Running
- Accept client_secret_basic at the OAuth token endpoint (87cbb3beb07b5d4ddd9a6f9578c8dee4cdbf3297)28929b7
-
Migrate to the fastmcp package for FastMCP Cloud deployment
bamySwaps mcp.server.fastmcp.FastMCP for the standalone fastmcp package, which is required to deploy on FastMCP Cloud's free tier. Rewrites SingleClientOAuthProvider as a subclass of fastmcp.server.auth.OAuthProvider (itself built on the same mcp SDK OAuth primitives), bumping the mcp dependency cap from <2.0 to <3.0 and updating ToolAnnotations kwargs to the mcp 2.x field names. README now leads with FastMCP Cloud deployment, keeping Render/Docker documented as a self-hosted alternative.13e3e7d
-
Remove duplicate Step.__str__ and apply ruff formatting
bamyStep defined __str__ twice (identical bodies); ruff F811 and mypy no-redef both flagged it. Drop the redundant second definition. Also apply 'ruff format' (pinned 0.11.11) across the tree; 24 files were not formatted to the repo standard. No behavior change.ccaec2a
-
docs(guide): document structured-workout authoring in MCP guide resource
bamyAdd a "Structured workouts" note to the guide resource: provide steps via workout_doc (the server renders them to builder DSL so Intervals.icu draws the chart), use renderable target units (%ftp/w, %hr/%lthr, %pace or absolute pace), avoid pace_zone/power_zone for pace runs, and never set the resolved _power/_pace output fields as inputs. Also strip pre-existing trailing whitespace in the guide text.7f7cd34 -
fix(workout_library): send structured steps as builder DSL so they render
bamyIntervals.icu only parses, computes (duration/load), and renders the step chart when steps are provided as workout-builder DSL text in `description`. A raw workout_doc JSON posted to the API is stored but never parsed, so create_workout/update_workout produced workouts with an empty chart and no computed metrics. Render the provided workout_doc as DSL via str(WorkoutDoc) and send it in `description` (no raw workout_doc), matching what add_or_update_event already does. schedule_workout now copies the DSL description to the event instead of the raw workout_doc for the same reason. Verified end to end against the live API: create_workout now yields a workout with computed moving_time/load and a rendered step chart.27241cb -
fix(auth): set token_endpoint_auth_method so token exchange works on mcp >= 1.23
bamymcp 1.22 defaulted a client's token_endpoint_auth_method to "client_secret_post", but 1.23+ defaults it to None and the token endpoint then rejects every request with 401 "Unsupported auth method: None". The deployed server resolves mcp unbounded (>=1.4.0) and pulls 1.27.x, so the authorization flow reached /authorize but always failed at POST /token. Set token_endpoint_auth_method="client_secret_post" explicitly on the issued client. Verified the full authorize -> token flow returns 200 on both mcp 1.22.0 and 1.27.2.aee6799 -
feat(training-plan): add training plan management tools
bamyNew training_plan module exposing: - get_training_plan: read the athlete's current plan - change_training_plan: assign a plan with start date and alias - apply_plan_changes: push pending plan changes to the calendar - apply_plan_to_calendar: schedule a plan folder onto the calendar - change_athlete_plans_bulk: bulk-assign plans across athletes Registered in the tools package and covered by sanity tests for URL, method, and payload shape.b496519 -
feat(activities): add analysis, search, and interval-editing tools
bamyNew tool modules: - activity_analysis: curves, best efforts, segments, interval stats, map, power-vs-hr, HR load and power spike models, time-at-HR, weather summary - activity_search: search_activities, interval_search, get_activities_around, get_activities_by_ids, get_activity_tags - activity_intervals: update/delete/split activity intervals Also extend activities with update/delete/create/bulk manual activities and a "gap" histogram type, fix activity streams and power-curves to use the spec-required .json extension and f1/f2/f3 filters, and allow list bodies in make_intervals_request for bulk endpoints. Ignore the local api/ OpenAPI reference spec.bc85648 -
fix(auth): accept any requested scope in single-client provider
bamyThe OAuth client was registered without scopes, so the base validate_scope rejected every scope request, including the empty "scope=" that MCP connectors send. This raised invalid_scope at the authorize step and aborted the whole flow. Override validate_scope to accept any requested scope (consistent with the permissive validate_redirect_uri), since this single-client deployment does not enforce scopes. Verified the full authorize -> token -> authenticated request flow end to end with an empty scope.d5e4861 -
fix(auth): publish protected resource metadata for OAuth discovery
bamySet resource_server_url to the public server URL so FastMCP publishes /.well-known/oauth-protected-resource (RFC 9728) and adds the resource_metadata pointer to the 401 WWW-Authenticate header. The MCP connector authorization flow requires this metadata; without it, connecting failed with "Authorization with the MCP server failed" even after the client_id resolved. The server now acts as both authorization server and resource server, both pointing at the same public URL.b313158 -
Merge pull request #1 from abamy/claude/add-claude-documentation-DJWpS
bamyUnverified signatureAdd OAuth 2.0 authentication for HTTP transportfcb0cbf -
fix(auth): resolve type errors and test pollution in OAuth layer
bamy- Wrap issuer_url in AnyHttpUrl and redirect_uris in AnyUrl, and use the "Bearer" token_type literal, fixing 3 mypy errors. - Remove unused AnyUrl import in test_auth.py (ruff F401). - Add an autouse fixture in test_auth.py that snapshots and restores intervals_mcp_server.* entries in sys.modules, so _fresh_mcp no longer leaves stale module references that broke 53 downstream tests when the full suite ran.475cb0a -
fix(workout_library): serialize WorkoutDoc instances to JSON-serializable dicts
bamyWhen FastMCP/pydantic deserializes workout_doc arguments into WorkoutDoc dataclass instances, json.dumps() in make_intervals_request() fails with TypeError. Add _serialize_workout_doc() helper to convert WorkoutDoc instances to dicts via .to_dict() before sending to the API. Affects create_workout() and update_workout(). Add tests that exercise the serialization path with real WorkoutDoc instances. Also add schedule_workout to README tool list.832233f
-
Replace static bearer token auth with OAuth 2.0 authorization code flow
ClaudeUnverified signatureImplements SingleClientOAuthProvider — a minimal OAuth 2.0 authorization server that supports the authorization code + PKCE flow used by Claude.ai. FastMCP publishes /.well-known/oauth-authorization-server automatically so clients can discover the token endpoint. Configure with MCP_CLIENT_ID, MCP_CLIENT_SECRET, and MCP_SERVER_URL. Enter the same client ID and secret in Claude.ai's connector OAuth fields. No persistent storage needed: the client_secret doubles as the access token.618b4aa -
Add bearer token authentication for HTTP transport
ClaudeUnverified signatureIntroduces MCP_API_KEY env var: when set, FastMCP's token_verifier middleware requires clients to send 'Authorization: Bearer <key>' on all HTTP/SSE connections. Timing-safe comparison via secrets.compare_digest. stdio transport is unaffected. Includes tests and .env.example docs.b0340ea
-
Add workout library tools to server (#44)
Copilot +2: copilot-swe-agent[bot], eoinoconnUnverified signature* Add workout library tools: get_workout_folders, list_workouts, get_workout, create_workout, update_workout Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/f87224f0-f00c-4ce0-b820-7f8f950897e1 Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * Fix list_workouts for shared folders: fall back to /folders endpoint children Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/467d07c6-c6d8-480d-b964-35322a427c0d Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * Address code review: rename test, initialize workouts variable Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/467d07c6-c6d8-480d-b964-35322a427c0d Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * Add shared indicator to folder and workout responses Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/41684ef0-dc1c-41b6-963f-3c59ff8e75bd Co-authored-by: …2215271
-
Add training load, fatigue, and fitness to add_or_update_event response (#38)
Copilot +2: copilot-swe-agent[bot], eoinoconnUnverified signature* Add training load, fatigue (ATL), and fitness (CTL) to event response Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/1697fbd0-a7c1-49be-91b2-35e0798c487a Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com>1f46571 -
Add get_races() tool (#40)
Copilot +3: copilot-swe-agent[bot], eoinoconn, eoinoconnUnverified signature* Initial plan * Add get_races() tool using events API with race category filter and 1-year default range Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/597e97cc-6f62-47da-9cb8-457ee46c7a6f Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * change date naming --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> Co-authored-by: eoinoconn <eoinoconn@gmail.com>1667edb
-
Eoinoconn/add render instructions (#33)
Eoin O'ConnellUnverified signature* fix: read FASTMCP_HOST from env when creating FastMCP instance * fix: use python entrypoint in Dockerfile so MCP_TRANSPORT is respected * update readme to include render instructions * use http insteadc5917f4 -
[intervals-mcp-server] Add activity histogram tool (power, HR, pace) (#18)
Copilot +3: copilot-swe-agent[bot], eoinoconn, eoinoconnUnverified signature* Initial plan * Add activity power, HR, and pace histogram tools Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/32563904-362d-4123-844c-8b87d538fa45 * Combine histogram tools into single get_activity_histogram tool Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/1843eefa-455c-4e21-8366-48b7e47c7f3e Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * Update README to document get_activity_histogram and get_activity_streams tools Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/ffb53a8d-e070-4778-ac1f-d2e7570394f6 Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> Co-authored-by: eoinoconn <eoinoconn@gmail.com>d3474e4
-
Add category filter to get_events (#27)
Copilot +3: copilot-swe-agent[bot], eoinoconn, eoinoconnUnverified signature* Initial plan * Add category filter to get_events for notes, holidays, races support Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/d395d837-ad3a-44fc-a34b-0ae3b1cbdaf5 Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * Validate event categories against known types in get_events Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/060aab49-7fb4-4fcf-8a7f-24602e5f744a Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * Use API category query param instead of client-side filtering; update valid categories to match API enum Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/11ee4087-da3d-493d-b465-69b8b3f6426a Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> Co-authored-by: …223c0f2 -
Add required MCP tool annotations (title, readOnlyHint, destructiveHint) (#30)
Copilot +3: copilot-swe-agent[bot], eoinoconn, eoinoconnUnverified signature* Initial plan * Add required MCP tool annotations (title, readOnlyHint, destructiveHint) to all tools Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/21861435-e510-4cb5-9103-2940704539b1 Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> Co-authored-by: eoinoconn <eoinoconn@gmail.com>0eed497 -
[intervals-mcp-server] Fix activity date filtering and MCP Inspector optional params (#28)
Eoin O'Connell +1: copilot-swe-agent[bot]Unverified signature* Fix activity date filtering and use simple types for MCP Inspector compatibility - Filter get_activities results to only include activities within the requested date range (API returns beyond the oldest boundary) - Remove _fetch_more_activities which fetched outside the user's range - Replace str | None = None with str = '' and int | None = None with int = 0 across all tool signatures so MCP Inspector renders input fields (anyOf schemas are not supported by the Inspector UI) - Update resolve_athlete_id, _prepare_request_config, and internal helpers to treat empty strings as 'not provided' - Add date filtering unit and integration tests * Update cadence docstring and validation message to document 0 sentinel behavior Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/ea1341f8-7999-4023-993b-d6c12a24bb61 Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * Fix date parsing in _filter_activities_by_date and document events sentin…d0ae48b
-
Merge remote-tracking branch 'origin/main' into develop
3deeb8c -
refactor: merge get_full_wellness_data into get_wellness_data as an option
Add include_all_fields parameter to get_wellness_data (default False) instead of maintaining a separate tool. When True, the response includes any additional or custom fields beyond the standard set. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>9d2e5bc
-
refactor: replace hardcoded known_keys with _KeyTracker for auto-detection
Use a dict wrapper that records accessed keys at runtime, so the "Other Fields" section automatically excludes any key touched by the formatting helpers — no manual set to maintain. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>04b3262
-
feat: format get_full_wellness_data output and address review feedback
Format get_full_wellness_data output as a human-readable string using format_wellness_entry with a new include_all_fields flag, which appends any other fields not handled by the standard formatting sections. Also fix the server module docstring to match current tool exports and add tests for the new tool and formatting flag. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>9fbedd3
-
feat: add get_full_wellness_data tool for unfiltered API response
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>3db7ee1
-
Merge pull request #23 from eoinoconn/feature/forward-looking-training-summary
Eoin O'ConnellUnverified signatureFeature/forward looking training summaryec99dd3 -
fix sport_agg type annotations using TypedDicts
copilot-swe-agent[bot] +1: eoinoconnUnverified signatureAgent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/81addec2-abfd-421d-8325-065bd6264945 Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com>871cb82 -
Refactor: move ignore flags formatting to shared helper in formatting.py
copilot-swe-agent[bot] +1: eoinoconnUnverified signatureAgent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/831afc61-7608-48d3-a81f-6c77908c476d Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com>c962530 -
Add ignore flags (icu_ignore_time, icu_ignore_power, icu_ignore_hr) to activity details and intervals
copilot-swe-agent[bot] +1: eoinoconnUnverified signatureAgent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/831afc61-7608-48d3-a81f-6c77908c476d Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com>0589a04 -
order the weeks reponse
0a9575d
-
update get_fitness_summary to look at events ahead
2811cd2 -
[intervals-mcp-server] Fix incorrect types in add_or_update_event docstring (#91)
Eoin O'ConnellUnverified signature* fix docstring with bad format suggestion * address copilot comments * address pylint scored95c790 -
Improve event creation/update response message (#90)
Eoin O'ConnellUnverified signature- Include event ID in success message for better user feedback - Update test assertions to match new message format - All tests now pass with the improved response formatc3d65a1 -
[intervals-mcp-server] Add activity messages tools (#86)
Unverified signature* feat: add activity messages tools for reading and posting notes Add get_activity_messages and add_activity_message MCP tools that expose the /activity/{id}/messages API endpoint. This allows LLMs to read notes and comments written on activities in Intervals.icu, and to post new ones. * fix(types): resolve all mypy errors across codebase Initialize FastMCP directly in mcp_instance.py instead of deferred None assignment, add Dict[str, Any] annotations to to_dict() methods, guard Optional access in _format_units, rename __str__(nested) to _to_str() to match object.__str__ signature, and type failed_events list in _delete_events_list. * docs: update stale tool lists in server.py, test_server.py, and CLAUDE.md The tool inventory in docstrings and CLAUDE.md was outdated after adding activity message tools. Updated to reflect all 12 registered tools. * test: add error handling test for get_activity_messages Covers the API error branch that returns {"error": True, "message": ...}, whi…0db0a8c
-
get_event_by_id bugfix
5ad9917 -
Add intervals.icu guide resource (#20)
Copilot +3: copilot-swe-agent[bot], eoinoconn, eoinoconnUnverified signature* Initial plan * Add intervals.icu guide resource at intervals-icu://guide Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/9e99bcd2-e8a8-42a7-a79c-86a4f1f2575d * Update guide.py * Rename usage_guide to coaching_context_protocol Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/7eec849b-4d3b-484e-9f89-5eaf25f21526 * update guide --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> Co-authored-by: eoinoconn <eoinoconn@gmail.com>c635cca
-
[intervals-mcp-server] Add compact flag for get_events (#16)
Copilot +3: copilot-swe-agent[bot], eoinoconn, eoinoconnUnverified signature* Initial plan * Add compact flag for get_events with training load metrics Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * fix parameter names * Round event load metrics to one decimal place Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> Agent-Logs-Url: https://github.com/eoinoconn/intervals-mcp-server/sessions/29049b6a-c49e-47cc-b944-17078071e4c3 * update date formatting --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> Co-authored-by: eoinoconn <eoinoconn@gmail.com>8771fbb
-
Add workout compliance to activity details (#13)
Copilot +3: copilot-swe-agent[bot], eoinoconn, eoinoconnUnverified signature* Initial plan * Add workout compliance to format_activity_summary Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * fix formatting for percentage and correct key value --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> Co-authored-by: eoinoconn <eoinoconn@gmail.com>d9e15c8 -
Add `get_training_summary` tool for coaching-ready training snapshots (#12)
Copilot +2: copilot-swe-agent[bot], eoinoconnUnverified signature* Initial plan * feat: add get_training_summary tool with concurrent API calls and tests Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * refactor: simplify _strip_nulls by removing dead zero-check code Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * fix: fetch compliance from activities endpoint instead of events Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * feat: make start_date and end_date optional, defaulting to last 30 days Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * fix: capture datetime.now() once in default dates test to avoid midnight race Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * refactor: remove unused keep_zero_keys arg from strip_nulls and move to utils/formatting Co-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com> * refactor: extract set_if utility for conditional dict assignment Co-authored-by: eoi…b16922c
-
feat: add last_updated field to athlete zones output
copilot-swe-agent[bot] +1: eoinoconnCo-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com>72b671b -
fix: add guard clauses for non-positive speed in pace converters
copilot-swe-agent[bot] +1: eoinoconnCo-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com>81f8ada -
feat: convert pace zones to human-readable units (min/km, sec/100m)
copilot-swe-agent[bot] +1: eoinoconnCo-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com>98e04ba -
feat: add get_athlete_zones tool for training zone definitions
copilot-swe-agent[bot] +1: eoinoconnCo-authored-by: eoinoconn <19649582+eoinoconn@users.noreply.github.com>9d32796
-
address bad merge
081d31e -
Merge branch 'copilot/add-athlete-power-curves-tool' into staging
de6b5fc -
update activity resolution
d8c0353 -
Merge branch 'copilot/add-athlete-power-curves-tool' into staging
a4339a7