22
33### 🏆 MISTRAL MCP HACKATHON WINNER 🏆
44
5- @Loucienne
6- @leotrois
7- @frogens
8- @Ulysse6307
9- @colinfrisch
5+ ** @Loucienne ** </ n >
6+ ** @leotrois ** </ n >
7+ ** @frogens ** </ n >
8+ ** @Ulysse6307 ** </ n >
9+ ** @colinfrisch ** </ n >
1010
1111A Model Context Protocol (MCP) server that provides AI assistants with access to Strava running data, route planning, and weather information. This server enables intelligent running coaching by combining Strava activity analysis with real-time weather data and route generation capabilities.
1212
13- ## Features
14-
15- ### Strava Integration
16- - ** User Statistics** : Access comprehensive running stats (recent, year-to-date, and all-time totals)
17- - ** Activity Analysis** : Retrieve detailed information about recent runs including pace, heart rate, and elevation
18- - ** Performance Visualization** : Generate heart rate and speed charts for activity analysis
19-
20- ### Route Planning
21- - ** Intelligent Itinerary Creation** : Generate running routes of specified distances from any starting location
22- - ** Round-trip Route Generation** : Create circular routes that return to the starting point
23- - ** Google Maps Integration** : Automatically generate Google Maps directions links for easy navigation
24-
25- ### Weather Intelligence
26- - ** Location-based Forecasting** : Get weather predictions for your usual running areas
27- - ** Activity-derived Location** : Automatically determine your location from previous run data
28- - ** Detailed Weather Data** : Access temperature, humidity, precipitation, and wind information
2913
3014## Setup
3115
@@ -69,16 +53,13 @@ git clone <your-repo-url>
6953cd chathletique-mcp
7054```
7155
72- 2 . ** Install Python dependencies with uv :**
56+ 2 . ** Install Python dependencies:**
7357``` bash
74- # Install uv if you don't have it (fast Python package manager)
75- curl -LsSf https://astral.sh/uv/install.sh | sh
76-
7758# Install project dependencies
78- uv sync
59+ pip install -e .
7960
8061# Install development dependencies (for contributing)
81- uv sync --extra dev
62+ pip install -e .[ dev]
8263```
8364
84653 . ** Configure environment:**
@@ -91,97 +72,12 @@ cp .env.example .env
91724 . ** Set up code quality tools (for contributors):**
9273``` bash
9374# Install pre-commit hooks for automatic code quality checks
94- uv run pre-commit install
75+ pre-commit install
9576
9677# Optional: Run pre-commit on all files to check everything
97- uv run pre-commit run --all-files
98- ```
99-
100- ## Usage
101-
102- ### Starting the Server
103-
104- ``` bash
105- # Using uv (recommended)
106- uv run python -m src.strava_mcp.main
107-
108- # Or activate the environment and run directly
109- source .venv/bin/activate # On Unix/macOS
110- python -m src.strava_mcp.main
111- ```
112-
113- The server will start on port 3000 and be accessible at ` http://localhost:3000/mcp ` .
114-
115- ### Testing with MCP Inspector
116-
117- 1 . ** Install and run the MCP Inspector:**
118- ``` bash
119- npx @modelcontextprotocol/inspector
120- ```
121-
122- 2 . ** Configure connection:**
123- - Transport Type: ` Streamable HTTP `
124- - URL: ` http://127.0.0.1:3000/mcp `
125-
126- ## 📋 Available Tools
127-
128- ### ` get_user_stats() `
129- Retrieves comprehensive Strava statistics for the authenticated user.
130-
131- ** Returns:** JSON containing recent, year-to-date, and all-time running totals
132-
133- ** Example response:**
134- ``` json
135- {
136- "recent_run_totals" : {"distance" : 50000 , "time" : 12000 , "count" : 5 },
137- "ytd_run_totals" : {"distance" : 500000 , "time" : 120000 , "count" : 50 },
138- "all_run_totals" : {"distance" : 2000000 , "time" : 480000 , "count" : 200 }
139- }
140- ```
141-
142- ### ` get_last_runs() `
143- Fetches detailed information about the user's most recent running activities.
144-
145- ** Returns:** Formatted text with activity details including distance, pace, heart rate, and elevation
146-
147- ** Data includes:**
148- - Activity name and date
149- - Distance and duration
150- - Average and maximum speed
151- - Heart rate metrics
152- - Elevation gain
153-
154- ### ` create_itinerary(starting_place, distance_km) `
155- Generates a running route of specified distance starting from a given location.
156-
157- ** Parameters:**
158- - ` starting_place ` (str): Starting location (e.g., "Opéra, Paris")
159- - ` distance_km ` (int): Desired route distance in kilometers
160-
161- ** Returns:** Google Maps directions URL for the generated route
162-
163- ** Example:**
164- ``` python
165- # Generate a 10km route starting from central Paris
166- create_itinerary(" Opéra, Paris" , 10 )
78+ pre-commit run --all-files
16779```
16880
169- ### ` get_weather_prediction() `
170- Provides weather forecast for the user's typical running area based on previous activity locations.
171-
172- ** Returns:** Detailed weather forecast including temperature, humidity, precipitation probability, and wind conditions
173-
174- ** Note:** Requires running ` get_last_runs() ` first to establish location data.
175-
176- ### ` figures_speed_hr_by_activity(number_of_activity, resolution, series_type) `
177- Generates heart rate and speed visualization charts for recent activities.
178-
179- ** Parameters:**
180- - ` number_of_activity ` (int): Number of recent activities to analyze
181- - ` resolution ` (str): Data resolution ("high", "medium", "low")
182- - ` series_type ` (str): Series type ("time" or "distance")
183-
184- ** Returns:** List of tuples containing activity names and matplotlib figures
18581
18682## Architecture
18783
@@ -232,90 +128,6 @@ The project includes automatic quality checks that run before each commit:
2321286 . ** Security scanning** : Detect potential security vulnerabilities
2331297 . ** Spell checking** : Catch typos in code and documentation
234130
235- ### Contributing Guidelines
236-
237- 1 . ** Install development dependencies:**
238- ``` bash
239- uv sync --extra dev
240- uv run pre-commit install
241- ```
242-
243- 2 . ** Run tests:**
244- ``` bash
245- uv run pytest
246- ```
247-
248- 3 . ** Run quality checks manually:**
249- ``` bash
250- # Run all pre-commit hooks
251- uv run pre-commit run --all-files
252-
253- # Run specific tools
254- uv run ruff check src/
255- uv run mypy src/
256- ```
257-
258- 4 . ** Commit your changes:**
259- ``` bash
260- git add .
261- git commit -m " Your commit message"
262- # Pre-commit hooks run automatically
263- ```
264-
265- All code is automatically checked for:
266- - ** Security vulnerabilities** (Bandit-style checks)
267- - ** Code style** (PEP 8 compliance)
268- - ** Import organization** (isort-style)
269- - ** Type annotations** (MyPy checking)
270- - ** Documentation quality** (Google docstring format)
271- - ** Common Python mistakes** (Bugbear checks)
272-
273- ### 🇫🇷 Installation et Pre-commit (French)
274-
275- ** Installation rapide avec uv :**
276- ``` bash
277- # 1. Cloner le projet
278- git clone < votre-repo-url>
279- cd chathletique-mcp
280-
281- # 2. Installer uv (gestionnaire de paquets Python ultra-rapide)
282- curl -LsSf https://astral.sh/uv/install.sh | sh
283-
284- # 3. Installer les dépendances
285- uv sync --extra dev
286-
287- # 4. Configurer les hooks pre-commit
288- uv run pre-commit install
289- ```
290-
291- ** Comment fonctionne pre-commit :**
292-
293- Pre-commit est un système qui exécute automatiquement des vérifications de qualité de code ** avant chaque commit** .
294-
295- ** Avantages :**
296- - ✅ ** Code toujours propre** : Impossible de commiter du code mal formaté
297- - ✅ ** Sécurité automatique** : Détection des vulnérabilités courantes
298- - ✅ ** Style cohérent** : Formatage automatique selon les standards Google
299- - ✅ ** Documentation forcée** : Docstrings obligatoires et bien formatées
300- - ✅ ** Imports organisés** : Tri automatique des imports
301-
302- ** Que se passe-t-il lors d'un commit :**
303- 1 . Vous faites ` git commit -m "mon message" `
304- 2 . Pre-commit lance automatiquement tous les outils de qualité
305- 3 . Si des problèmes sont détectés, le commit est ** bloqué**
306- 4 . Les outils corrigent automatiquement ce qu'ils peuvent
307- 5 . Vous revérifiez les modifications et recommitez
308-
309- ** Outils inclus :**
310- - ** Ruff** : Linter ultra-rapide (remplace flake8, isort, black)
311- - ** MyPy** : Vérification des types Python
312- - ** Codespell** : Correction des fautes de frappe
313- - ** Security checks** : Détection de failles de sécurité
314-
315- ## License
316-
317- This project is licensed under the MIT License - see the LICENSE file for details.
318-
319131
320132## Use Cases
321133
0 commit comments