The Strava MCP server acts as a bridge between Large Language Models (LLMs) and your Strava data, allowing AI assistants to access your activities, segments, routes, and other fitness information through the Model Context Protocol (MCP) standard.
Clone Repository:
git clone https://github.com/r-huijts/strava-mcp.git
cd strava-mcp
Install Dependencies:
npm install
Build the Project:
npm run build
Update your Claude configuration file:
{
"mcpServers": {
"strava-mcp-local": {
"command": "node",
"args": [
"/absolute/path/to/your/strava-mcp/dist/server.js"
]
}
}
}
Make sure to replace /absolute/path/to/your/strava-mcp/
with the actual path to your installation.
localhost
# In your strava-mcp directory
npx tsx scripts/setup-auth.ts
Follow the prompts to complete the authentication flow.
After completing all the above steps, restart Claude Desktop for the changes to take effect.
Variable | Description |
---|---|
STRAVA_CLIENT_ID | Your Strava Application Client ID (required) |
STRAVA_CLIENT_SECRET | Your Strava Application Client Secret (required) |
STRAVA_ACCESS_TOKEN | Your Strava API access token (generated during setup) |
STRAVA_REFRESH_TOKEN | Your Strava API refresh token (generated during setup) |
ROUTE_EXPORT_PATH | Absolute path for saving exported route files (optional) |
This server implements automatic token refreshing. When the initial access token expires (typically after 6 hours), the server will automatically use the refresh token stored in .env
to obtain a new access token and refresh token.
If you intend to use the route export tools, you need to specify a directory for saving exported files.
Edit your .env
file and add/update the ROUTE_EXPORT_PATH
variable:
# Optional: Define an *absolute* path for saving exported route files (GPX/TCX)
# Example: ROUTE_EXPORT_PATH=/Users/your_username/strava-exports
ROUTE_EXPORT_PATH=
Here are some example prompts you can use with your AI assistant:
You are Tom Verhaegen, elite cycling coach and mentor to world champion Mathieu van der Poel. Analyze my most recent Strava activity. Provide a thorough, data-driven assessment of the ride, combining both quantitative insights and textual interpretation.
Begin your report with a written summary that highlights key findings and context. Then, bring the raw numbers to life: build an interactive, visually striking dashboard using HTML, CSS, and JavaScript. Use bold, high-contrast colors and intuitive, insightful chart types that best suit each metric (e.g., heart rate, power, cadence, elevation).
Embed clear coaching feedback and personalized training recommendations directly within the visualization. These should be practical, actionable, and grounded solely in the data provided—no assumptions or fabrications.
As a bonus, sprinkle in motivational quotes and cheeky commentary from Mathieu van der Poel himself—he's been watching my rides with one eyebrow raised and a smirk of both concern and amusement.
Each tool has specific parameters and capabilities, and your AI assistant will choose the appropriate tool based on your query.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "strava-mcp-local" '{"command":"node","args":["/absolute/path/to/your/strava-mcp/dist/server.js"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"strava-mcp-local": {
"command": "node",
"args": [
"/absolute/path/to/your/strava-mcp/dist/server.js"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"strava-mcp-local": {
"command": "node",
"args": [
"/absolute/path/to/your/strava-mcp/dist/server.js"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect